Support

Account

Forum Replies Created

  • I’m a little bit late to the party, but the previous post is obvious, I hope @jmcbade has solved it meanwhile.

    The Fatal error says it all:
    Fatal error: Uncaught Error: Call to undefined function is_user_logged_id()

    It’s probably a mistyped function name, maybe it should’ve been is_user_logged_in?

  • I just stumbled upon this 2 years old question searching for something else but for whom it may concern there are couple of things that can be immediately identified as weird:

    1. These 2 lines will never get executed because they are after the return call:

    
    
        wp_reset_query();
        restore_current_blog();
    

    2. The name of the function in the add_filter call is staffMemberProfilesQuery while the name of the function defined at the beginning of the code block is MemberProfilesQuery

  • I just tried using acf/prepare_field to alter the conditional_logicof a field in one group, that’s cloned in another group, but as a replace field, not as group, which means the UI won’t display the Conditional Logic checkbox.

    And it works.

    The only thing to note is that I had to use key={key of the clone field}_{key of the field in a cloned group}, something like 'acf/prepare_field/key=field_62704081a8489_field_62703f61a8487'

  • I just used this code and can confirm the behavior (most likely a bug):

    
    function test__before__render_field( $field ){
    	echo '<p>This is the Before test</p>';
    }
    add_action( 'acf/render_field', 'test__before__render_field', 9, 1 );
    
    function test__after__render_field( $field ){
    	echo '<p>This is the After test</p>';
    }
    add_action( 'acf/render_field/type=text', 'test__after__render_field', 10, 1 );
    

    Notice that the last action (after) is hooked to a field type.

    If I just put ‘acf/render_field’ there, both actions appear before my text field, even if I set priority 999 instead of 10.

    But if the field type is defined, it all works as in the docs: priority < 10 hooks before rendering the fields and priority >= 10 hooks after.


    @ewijdemans
    I hope I have helped you solve your issue, at least until @hube2 doesn’t bring it to developer’s attention.

    (Tested using ACF Pro 5.6.7)

    edit: after reading the OP one more time, I realized that it’s clear from the beginning that field type is working properly 🙂

  • I would also like to see this as a native ACF feature, both:
    – fields hidden for certain (low) user levels
    – fields read only for certain (low) user levels

  • Sorry, I have just joined the forums but I’ve noticed the same error with the first look I threw at your code.

    $tracks = "a simple variable";

    If you want to store tracks, then you should declare it as an array.

    
    $tracks = array();
    
    // now you should fill the array with data within your loop like this
    
    $tracks[] = "some value";
    

    Remember, when you want to retrieve values, you need to loop through the $tracks

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