daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action( 'admin_notices', 'wpse332074_donotedit' );
  2. function wpse332074_donotedit {
  3.   if (is_page('ID-of-forbidden-page')) {
  4.     $class = 'notice notice-error';
  5.     $message = __( 'Do not edit this page!', 'your-text-domain' );
  6.     echo '<div class="' . $class . '"><p>' . $message . '</p></div>';
  7.     }
  8.   }
  9.    
  10. add_filter ('edit_post_link','wpse332074_disable_edit',10,3);
  11. function wpse332074_disable_edit ($link, $ID, $text ) {
  12.   if ($ID == 'ID-of-forbidden-page')) return '';
  13.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top