PHP Web Development Wordpress

Disable Post Edit link on post title in admin

/**
* Disable editing of on posts in admin
* it is only the visual component;
* Author: Naveen Pal
* Note: This code is required to add in functions.php of active theme.
*/
function disable_edit_post_type() {
    // Hide link on listing page
    if (isset($_GET['post_type']) && $_GET['post_type'] == 'POST_TYPE_NAME') {
        echo '<style type="text/css">
         .row-title{
          pointer-events: none;
          cursor: default;
          text-decoration: none;
          color: black;}
        </style>';
    }
}
// Hook this function to admin_menu hook
add_action('admin_menu', 'disable_edit_post_type');

Leave a Reply

Your email address will not be published. Required fields are marked *


CAPTCHA Image
Reload Image