Advertisement
geminilabs

[site-reviews] Unprotect the assigned rating meta keys

Jul 19th, 2019 (edited)
352
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Unprotect Site Reviews' hidden meta keys used for assigned rating counts
  3.  *
  4.  * Use this if you have cloned a page that had assigned reviews, this will
  5.  * allow you to remove the obsolete meta keys with the Custom Fields MetaBox.
  6.  *
  7.  * This snippet should not be kept active!
  8.  *
  9.  * @param bool $protected
  10.  * @param string $metaKey
  11.  * @return bool
  12.  */
  13. add_filter('is_protected_meta', function ($protected, $metaKey) {
  14.     if (in_array($metaKey, ['_glsr_average', '_glsr_ranking', '_glsr_reviews'])) {
  15.         return false;
  16.     }
  17.     return $protected;
  18. }, 10, 2);
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement