0

I'm using wordpress as a content manager or something, so i'm using backend only (and i've disabled the frontend with a ghost theme which redirect to the admin panel).

The question is: how could i disable the "view" post button and generally every mention to "preview" posts, view categoryes, pages etc?

enter image description here

Solved!

Thank you cristian.raiber! It worked perfectly. I've also put this lines to hide the previews in single posts:


function posttype_admin_css() {
global $post_type;
$post_types = array(
                        /* set post types */ 
                        'progetti',
                        'post',
                        'page',
                  );
    if(in_array($post_type, $post_types))
    echo '#post-preview, #view-post-btn{display: none;}';
}
add_action( 'admin_head-post-new.php', 'posttype_admin_css' );
add_action( 'admin_head-post.php', 'posttype_admin_css' );

add_action('admin_head', 'hide_quick_view');

function hide_quick_view() { echo ' span.view {display: none !important; visibility: hidden !important; opacity: 0 !important;} '; }

0

Instead of disabling it, you'd be better off by hiding it using a bit of CSS trickery.

Try this and let me know if it works:

    add_action('admin_head', 'hide_quick_view');

function hide_quick_view() {
  echo '<style>
    span.view {display: none !important; visibility: hidden !important; opacity: 0 !important;}
  </style>';
}

This should be placed in your functions.php file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.