• Hello there,

    I am trying to hide the ‘Add New’ option on the back end post listings.

    I originally tested my code within the inspect window of chrome and it successfully hid the ‘Add New’ option.

    I then used the WordPress Additional CSS box as I would normally and added the following code: .wrap .page-title-action{
    display:none;}.

    However, the css changes did not have any effect. I tried clearing cache but this did not help. I also tested the additional CSS by changing a button colour on the front end and this worked.

    This makes me believe that it may have something to do with back end/back office CSS as I have never tried to alter CSS for the beck end before.

    Any help here would be much appreciated.

    Many thanks
    Matt

    • This topic was modified 3 years, 2 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Are you using Customizer>Additional CSS? it is not 100% clear from your post. I’m not sure what you mean by back end/back office CSS as I have never tried to alter CSS for the beck end before

    A screen shot would help you can link any image sharing service here.

    — I just re-read your post —

    You are trying to hide a dashboard option.

    Is this really what you want to do? As hiding with CSS is not secure of course as anyone can change in browsers.

    Would you not be better off using the built in roles & applicability functions, or extend those with a role manager plugin?

    • This reply was modified 3 years, 2 months ago by Alan Fuller. Reason: Better understanding of question
    Thread Starter matt070292

    (@matt070292)

    Hi Alan,

    Thank you for your reply.

    After a bit more digging elsewhere, I went ahead and removed the capability of creating shop order post types.

    For anybody looking to do the same, the following worked for me:

    add_filter( 'woocommerce_register_post_type_shop_order','remove_add_order' );
    function remove_add_order($fields) {
            $fields['capabilities'] = array(
                'create_posts' => false,
              );
            return $fields;
        }

    Glad you found a way

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘css editor has no effect on back end’ is closed to new replies.