• Resolved sharris203

    (@sharris203)


    Anyone know any CSS to hide the “Quick Edit” link for pages?

Viewing 10 replies - 1 through 10 (of 10 total)
  • esmi

    (@esmi)

    I’m pretty sure that any CSS changes to hide this link will hide it for Posts too.

    Look back at the example i gave you here..
    http://wordpress.org/support/topic/370002?replies=32#post-1429691

    Then add to it..

    span.inline {display:none!important}

    And the quick edit link will be gone.

    Thread Starter sharris203

    (@sharris203)

    Thanks!

    Complete code for those who come next:

    add_action('admin_init','my_init_method');
    function my_init_method() {
    	// Hook onto print styles action for edit-pages page only
    	add_action('admin_print_styles-edit-pages.php','hide_quick_edit_css');
    }
    function hide_quick_edit_css() {
    	?>
    	<style type="text/css">
    	span.inline {display:none!important}
    	</style>
    	<?php
    }

    NOTE: The code will stop working as of WP 3.0 due to changes in how pages are handled in the backend. Pages will be handled by edit.php with a post type of page, instead of the current seperate edit-pages.php

    Just something to remember for the future.

    Thread Starter sharris203

    (@sharris203)

    Good to know! Another CSS question:

    I want to hide various options on the admin General Settings page (specifically only show the Blog Title, Tagline, and Save button). Just hide, not disable. I’ve tried this code but it doesn’t work. Anything more I need to add?

    <div style=”display:none;”>
    // the code I want to hide from being vivible
    </div>

    I can’t see any hooks for specifically hiding stuff in the general options page, i can’t say i know of any way other then directly modifying the areas you want to hide.

    Next best thing i can suggest is the following plugin, handy for hiding areas of the admin.
    http://wordpress.org/extend/plugins/adminimize/

    Thread Starter sharris203

    (@sharris203)

    I figured it out. I added the style code into the table html, like this: <tr valign="top" style="display:none;">

    I just started using that plugin you mention now for other things and it’s great. Thanks for your help!

    I just want to share a little mod on the subject.
    If you are looking to eliminate the quick edit from post edit pages and limit this to all non admins (so admins will still have the function) use the following:

    add_action('admin_init','my_init_method');
    function my_init_method() {
    	// Hook onto print styles action for edit-posts page only
    	add_action('admin_print_styles-edit.php','hide_quick_edit_css');
    }
    function hide_quick_edit_css()
    {
    if (!current_user_can('level_10'))
    {
    	?>
    	<style type="text/css">
    	span.inline {display:none!important}
    	</style>
    	<?php
    }
    }

    I needed to add the custom-fields support in order to make use of the Verve Meta Boxes plugin – but didn’t want to show the user/admin the actual custom fields box. The aforementioned fixes doesn’t seem to work with 3.0, but I found a solution which does:

    http://www.smashingmagazine.com/2009/12/14/advanced-power-tips-for-wordpress-template-developers-reloaded/

    Check out the “Hiding Fields Based on User Role” segment for the solution:

    //hook the admin init
    add_action('admin_init','customize_meta_boxes');
    
    function customize_meta_boxes() {
         remove_meta_box('postcustom','post','normal');
    }

    Sweet! This also works for custom post types.

    mmikkel

    You are right in WP 3.0 the edit urls have changes. So for posts use edit.php for posts and edit.php?post_type=page for pages

    Everything else should stay the same. Not tested though.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘CSS to hide “Quick Edit” link?’ is closed to new replies.