Row actions not showing? Why?

In display_rows() you are using the following code to print the ‘name’ column: echo ‘<td ‘.$attributes.’><strong><a href=”‘.$editlink.'” title=”Edit”>’.stripslashes($rec->name).'</a></strong></td>’; Nowhere do you call column_name(), which is the function you’ve defined to display the item’s and row actions: function column_name($item){ $actions = array( ‘edit’ => sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/76517/?page=%s&action=%s&testimonial=%s”>Edit</a>’,$_REQUEST[‘page’],’edit’,$item[‘ID’]), ‘delete’ => sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/76517/?page=%s&action=%s&testimonial=%s”>Delete</a>’,$_REQUEST[‘page’],’delete’,$item[‘ID’]), ); //Return the title contents return … Read more

Removing sorting option for columns on the post lists page

The filter hook manage_edit-post_sortable_columns contains all the columns, which are sortable. So you could hook into this filter and unset the title: <?php add_filter( ‘manage_edit-post_sortable_columns’, ‘wse_240787’ ); function wse_240787( $col ) { unset( $col[‘title’] ); return $col; } This filter is documented in wp-admin/includes/class-wp-list-table.php: /** * Filters the list table sortable columns for a specific … Read more

How i add new link after Edit | Quick Edit | Trash | View in quick edit section

You can do it by creating a hook for post_row_actions filter. If your CPT is hierarchical post type use page_row_actions filter. add_filter( ‘post_row_actions’, ‘wpse8170_row_actions’, 10, 2 ); function wpse8170_row_actions( $actions, WP_Post $post ) { if ( $post->post_type != ‘my-custom-post-type’ ) { return $actions; } $actions[‘wpse8170-pdf’] = ‘<a href=”http://your/url/here”>PDF</a>’; return $actions; }

URL Redirect and Bulk Actions in wp_list_table

Understand hierarchy, You don’t need to redirect as form are posting values on same page. function process_bulk_action() { // Some security check code here // Get the bulk action $action = $this->current_action(); if ($action == ‘bulk_trash’) { // Code for the “delete process” $delete_ids = esc_sql($_POST[‘bulk-delete’]); //loop over the array of record ids foreach($delete_ids as … Read more

How do I limit the status options for bulk/quick edit to only Published and Draft?

Answering this Question, came to a jQuery solution to Ana Ban’s one. add_action( ‘admin_head’, ‘wpse_56551_script_enqueuer’ ); function wpse_56551_script_enqueuer() { global $current_screen; /** /wp-admin/edit.php?post_type=post /wp-admin/edit.php?post_type=page /wp-admin/edit.php?post_type=cpt == gallery in this example */ if( ‘edit-gallery’ == $current_screen->id ) { ?> <script type=”text/javascript”> jQuery(document).ready( function($) { $(“a.editinline”).live(“click”, function () { var ilc_qe_id = inlineEditPost.getId(this); setTimeout(function() { $(‘#edit-‘+ilc_qe_id+’ select[name=”_status”] … Read more

How to stop _wpnonce and _wp_http_referer from appearing in URL

This issue arrises because of a couple of problems: 1) WP_List_Table::search_box() inserts the default _wpnonce and _wp_http_referer fields by using wp_nonce_field() without giving you the ability to override and say “I’ve already go a nonce field thanks”. 2) You need to use GET as your method of form submission when subclassing WP_List_Table because WP_List_Table::print_column_headers() only … Read more

Replacing the List table of a Post Type

No, you cannot replace the list table. There is no filter, everything is hard-coded. But you can change the post type registration, set show_ui to FALSE to prevent the built-in page, and add a custom page for the post type listing to show the editable items. add_action( ‘wp_loaded’, function(){ register_post_type( ‘test’, array( ‘labels’ => array( … Read more

WP_list_table bulk_action get edit and delete

So, I found the problem. First of all, I was not selecting the right ID’s on my checkbox or buttons, so I changed to code to do so: function column_name($item){ $item_json = json_decode(json_encode($item), true); $actions = array( ‘edit’ => sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/265648/?page=%s&action=%s&id=%s”>Edit</a>’, $_REQUEST[‘page’], ‘edit’, $item_json[‘id’]), ‘delete’ => sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/265648/?page=%s&action=%s&id=%s”>Delete</a>’, $_REQUEST[‘page’], ‘delete’, $item_json[‘id’]), ); return ‘<em>’ . … Read more