Support

Account

Home Forums General Issues getField() returns still value after rule deleted

Helping

getField() returns still value after rule deleted

  • Hi everyone,

    I used this great plugin to create two submenues, which are displayed depending on which kind of page the user is.
    I created two different groups with a ‘Nav Menu’ in each group. I added two new menues (menu-1 , and menu-2) and added some php code to display when the field is set.

    <?php if( get_field('kommunikationsmenu')):?>
    <div id="sub-menu-wrap" role="navigation">
    	<nav class="base-menu sub-menu communication-menu">
    		<?php
    			do_action('open_sub_menu');
    			infinity_base_nav_menu( 'menu-1' );
    			do_action('close_sub_menu');
    		?>
    	</nav>
    </div>
    <?php endif; ?>

    After adding the rules nothing happened, until I edited my pages and updated them (Can somebody explain that?). OK. So far, everything went pretty much as expected.
    But here comes my problem:
    I removed some rules (in the end all, except the initial one) and saved the field group (the database was updated correctly – I checked). But the menues are still visible. The reason is, that the function getField() still retrieves a value. I reloaded the site and cleansed my whole cache. But still the value is set and the menu won’t go away.

    I tested it several times and it was always reproduceable. On my server and on my local machine.

    Why does the getField()-method still return a value? Is there another way to check, if the rule is still delivering true?

  • Check your wp_postmeta table for these entries. Though you removed the rule the meta data is likely still available, and being called by get_field().

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.