• Resolved VegasHero

    (@vegashero)


    It looks like some of the hook/filters doesn’t work in this list:
    https://github.com/MyThemeShopTeam/WP-Review/blob/master/filter-list.php

    for example, we are trying to hide certain meta boxes in a theme and it won’t take effect:

    function mts_wp_review_hide_item_metabox_fields( $fields ) {
    	unset( $fields['location'], $fields['fontcolor'], $fields['bordercolor'] );
    	// Or remove all (except features which can't be removed) with:
    	// $fields = array();
    	return $fields;
    }
    add_filter( 'wp_review_metabox_item_fields', 'mts_wp_review_hide_item_metabox_fields' );

    can you assist with this?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Suraj Vibhute

    (@suraj78)

    Hello @vegashero,

    Are you trying to hide the whole review meta box?

    Above filter is not for hiding the review box meta. It is used for hiding below fields in meta boxes.

    To hide meta boxes, you can use remove_meta_box() function https://developer.wordpress.org/reference/functions/remove_meta_box/

    There are options to hide meta box options in the multisite.

    $fields = array(
            'location' => true,
            'color' => true,
            'inactive_color' => true,
            'fontcolor' => true,
            'bgcolor1' => true,
            'bgcolor2' => true,
            'bordercolor' => true,
            'fontfamily' => true,
            'custom_colors' => true,
            'custom_location' => true,
            'disable_features' => true,
        );

    Hope this helps.
    Thank you.

    • This reply was modified 5 years, 9 months ago by Suraj Vibhute.
    Thread Starter VegasHero

    (@vegashero)

    right, I phrased the question wrong: we are trying to hide the location and custom_location meta box items.

    Tried the method you mentioned to remove fields, doesn’t work either.

    Plugin Support Suraj Vibhute

    (@suraj78)

    Hello @vegashero,

    Looks like custom_location option was missing in the filter,

    We have added it and released the new version, please test.

    Thank you.

    Thread Starter VegasHero

    (@vegashero)

    Worked well for hiding the location options. Thank you for that.

    Plugin Support Suraj Vibhute

    (@suraj78)

    My pleasure 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Filter to hide meta box doesn’t work’ is closed to new replies.