Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'admin_notices', 'wpse332074_donotedit' );
- function wpse332074_donotedit {
- if (is_page('ID-of-forbidden-page')) {
- $class = 'notice notice-error';
- $message = __( 'Do not edit this page!', 'your-text-domain' );
- echo '<div class="' . $class . '"><p>' . $message . '</p></div>';
- }
- }
- add_filter ('edit_post_link','wpse332074_disable_edit',10,3);
- function wpse332074_disable_edit ($link, $ID, $text ) {
- if ($ID == 'ID-of-forbidden-page')) return '';
- }
Add Comment
Please, Sign In to add comment