How do you hide the "Delete Note" link in the Order Notes panel? Is there a hook that can be used?
2 Answers
You can try adding this in your functions.php file:
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>';
}
}
-
I just removed
$screen
and the condition below it to make it simple. Thank you again.– wptentCommented Jan 29, 2020 at 1:28
The answer given by Dharmishtha Patel is a good method to use. Another method requiring less processing is the "Additional CSS" functionality.
Within your Dashboard select "Appearance | Customize | Additional CSS" to display an edit box.
If the style you want to change is a.delete_note type the following;
.a.delete_note { display: none; }
or perhaps
a.delete_note { display: none }
This method can be used for hiding many elements and overrides existing css styles.
-
-
@wptent Sorry, I was unaware this was within the admin panel. :( Having said that, the css options are good for hiding other things on your blog and perhaps you can use it for something else. :) Good luck. Commented Jan 29, 2020 at 1:37
-