custom_list_table edit/delete bulk actions

above is my check box, normally name=”book[]” can someone explain what the purpose of the [] is? This is allowing the checked values to be returned as an array when getting the results, if you have more than one value checked. Besides that, I can’t tell what you’re trying to do in order to be … Read more

Custom WP_List_Table: How to create an unapproved row?

Well, the yellow comes from <tr class=”unapproved”> and this is, in crass contrast to what the usual WP_List_Table introduction might suggest, not an automatism, but generated very verbatim: See e.g. single_row() in wp-admin/includes/class-wp-comments-list-table.php: function single_row( $a_comment ) { global $post, $comment; $comment = $a_comment; $the_comment_class = join( ‘ ‘, get_comment_class( wp_get_comment_status( $comment->comment_ID ) ) ); … Read more

Remove Admin Notice on page refresh

This is done by wp_admin_canonical_url: It calls wp_removable_query_args to fetch a list of query string parameters to remove, which includes settings-updated. It then writes some script into the page header to use window.history.replaceState to remove the query string from your browser’s URL bar. <link id=”wp-admin-canonical” rel=”canonical” href=”http://example.com/wp-admin/admin.php?page=xyz”> <script> if ( window.history.replaceState ) { window.history.replaceState( null, … Read more

How can I add a column in the wp_list_table of the admin area?

I think what you need is the set of filters and actions to add custom columns to post edit screens: manage_edit-post_type_columns: used to add columns manage_posts_custom_column: used to print the content of each row of the column manage_edit-post_type_sortable_columns: used to register sortable columns. Undocumented. request: you may need to use this filter in combination with … Read more