Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Enables the Custom Fields metabox for reviews
- *
- * To use this snippet, paste it in your active theme's functions.php file.
- *
- * @return void
- */
- add_action('admin_init', function () {
- add_post_type_support('provider', 'custom-fields');
- });
- /**
- * Unprotect Site Reviews' hidden meta keys used for assigned rating counts
- *
- * Use this if you have cloned a page that had assigned reviews, this will
- * allow you to remove the obsolete meta keys with the Custom Fields MetaBox.
- *
- * @param bool $protected
- * @param string $metaKey
- * @return bool
- */
- add_filter( 'is_protected_meta', function( $protected, $metaKey ) {
- return !in_array( $metaKey, ['_glsr_average', '_glsr_ranking', '_glsr_reviews'] )
- ? $protected
- : false;
- }, 10, 2 );
Add Comment
Please, Sign In to add comment