Disable “quick edit” for specific pages in functions.php

To reference the post ID you need the post object itself. <?php // Increase the number of arguments passed. add_filter( ‘page_row_actions’, ‘remove_page_row_actions’, 10, 2 ); // 2, not 1 // pass $post object as second argument. function remove_page_row_actions( $actions, $post ) { $post_types_affected = array(‘page’); $post_ids_affected = array( 111, 222 ); if ( in_array( $post->post_type, … Read more

Rename a row action label

Put this in your functions.php file: function rename_delete_action($actions) { // replace Delete Permanently text, if present // (i.e., if the current user is able to delete posts) if (isset($actions[‘delete’])) $actions[‘delete’] = preg_replace(‘@>(.*)<@’, ‘>WHATEVER<‘, $actions[‘delete’]); return $actions; } // function rename_delete_action if (‘edit.php’ === $GLOBALS[‘pagenow’]) { // add filter for Edit pages only add_filter(‘post_row_actions’, ‘rename_delete_action’); add_filter(‘page_row_actions’, … Read more

{$taxonomy}_row_actions for all custom taxonomies

You could use the tag_row_actions hook (which was deprecated in WP v3.0.0, but then restored in WP v5.4.2) to target any taxonomies (Tags/post_tag, Categories/category, a_custom_taxonomy, etc.), so just replace the category_row_actions with tag_row_actions: add_filter( ‘tag_row_actions’, ‘category_row_actions’, 10, 2 ); Or you could use get_taxonomies() with an early hook like admin_init (that runs after init), and … Read more

tech