Support

Account

Forum Replies Created

  • As I came across this when looking I thought I’d update it with correct information for others who come across it as well.

    But from ACF;
    If multiple field groups appear on an edit screen, the first field group’s options will be used (the one with the lowest order number)

    Cheers

  • Thanks for the pointer in Eric’s version ^ the add_filter line is missing;
    add_filter(‘posts_where’, ‘my_posts_where’);

    Otherwise, works like a charm, just wait till your WP is 4.8.3 to implement as it’ll kill 4.8.2 and lower.

  • Thanks for this guys was very helpful. If you don’t want to replace the existing style just use .= to append your style, simply remember to have it be a space before your class.

    And if you need to only affect a specific metabox you can use the $content[‘ID’] to compare.

    Here’s what I’ve done to add Woo’s hide_if_external class to remove my metabox for external products;

    function change_style_test($content) {
    
        if ( ! empty( $content ) && array_key_exists( 'ID', $content ) && ! empty( $content['ID'] ) && $content['ID'] == 4970) {
    
            $content['style'] .= ' hide_if_external';
    
        }
    
        return $content;
    
    }
    add_filter('acf/get_field_group', 'change_style_test');

    All the best,
    Cheers

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