• Hello,

    In woocommerce’s order page’s note section, admins are allowed to add not and can also delete the note. I want to disable the delete button. Is there way to remove/hide the delete text, so no one could delete the note?

    Snapshot:- https://i.imgur.com/1o7xCsW.png

    EDIT:- I used the following code, but its not working

    add_action('admin_head', 'hide_delete_note_from_edit_order');
    function hide_delete_note_from_edit_order()
    {
        $screen = get_current_screen();
        if ($screen->post_type === "shop_order" && $screen->base === "post") {
            echo '<style>a.delete_note { display:none; }</style>';
        }
    }
    • This topic was modified 3 years, 4 months ago by sillyninja.
    • This topic was modified 3 years, 4 months ago by sillyninja.
Viewing 1 replies (of 1 total)
  • Well, the code you provided works as intended on a basic install with just the WooCommerce plugin. You could troubleshoot by logging the value of $screen to the console by adding this line.

    echo '<script>console.dir(' . json_encode($screen) . ')</script>';

    Or try a plugin that helps with adding CSS, such as Simple Custom CSS and JS.

Viewing 1 replies (of 1 total)
  • The topic ‘Hide the delete text from WooCommerce’s order page’ is closed to new replies.