Default sort on admin columns with meta date hides draft posts with empty date value

I too was struggling with this (only I was sorting by a text-based meta value). Here’s what seems to have fixed the problem: $meta_query = array( ‘relation’ => ‘OR’, array( ‘key’ => ‘property_reference’, ‘value’ => false, ‘type’ => ‘BOOLEAN’, ), array( ‘key’ => ‘property_reference’, ‘compare’ => ‘NOT EXISTS’, ‘value’ => ”, //have to set value … Read more

Admin WP List Table Columns Missing

This is a bug with the wordpress AJAX trying to update manageedit-pagecolumnshidden on the admin table pages when columns are hidden. It completly breaks the entire admin tables when the table headers are visually hidden. Thanks to Michael Ecklund’s clue I was able to figure it out. I created the Ticket here: https://core.trac.wordpress.org/ticket/29030 And a … Read more

how to remove dash (-) post status from post title on posts listing page wordpress

Try the following: add_filter(‘display_post_states’, ‘__return_false’); The function responsible for printing the post state on the post list table is: _post_states() Located in wp-admin/includes/template.php. The following logic determines whether the state will be printed: /** * Filter the default post display states used in the posts list table. * * @since 2.8.0 * * @param array … Read more

Add acf field in title (admin table)

Use this to filter the title: add_action( ‘admin_head-edit.php’, ‘wpse264139_edit_post_change_title_in_list’ ); function wpse264139_edit_post_change_title_in_list() { add_filter( ‘the_title’, ‘wpse264139_construct_new_title’, 100, 2 ); }` `function wpse264139_construct_new_title( $title, $id ) { if(get_post_type($id) == ‘post_type’) { $field = get_field(‘place’, $id); return $field . ” ” . $title; } else { return $title; } } NOTE: most of the code came from: … Read more

Fallback media image for featured image not working in admin column

wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0] will only echo the URL of the image. You need to add it to html to display the image. Try this: echo ‘<img src=”‘.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0].'”/>’; You could add the width etc as well echo ‘<img src=”‘.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0].'” width=”.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[1].” height=”.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[2].” />’; what happens if someone deletes this image though? Do you have … Read more