As my client uses the WPJM plugin and employer users are adding more & more job listings, they would like to be able to keep track of who’s posting, what they are posting, and how much they are posting in one place in WordPress. This would help in their interactions with actual employers and users assigned to help post jobs for employers.
The current backend Job Listings page has no such filter option to filter the list by employers (users). And the Search Jobs function does not appear to be able to search by usernames or emails.
Since the Jobs are not detectable by WordPress as posts, when looking at our list of Users with Employer roles, post counts are all “0”.
Do you have any suggestions? Could filtering by employer/users be in the WordPress admin be added in a future update?
Regards,
Frank
Now i’m no coder but i asked ChatGPT and it tweaked the plugin and it works.
<?php
/**
* Admin Slug Column (Streamlined Version)
*
* @package Admin_Slug_Column_Simplified
* @wordpress-plugin
* Plugin Name: Admin Slug Column (Streamlined)
* Description: Adds a sortable "Slug" column to the admin posts/pages list without additional columns.
* Version: 1.0
* Author: Adapted Plugin
*/
// If this file is called directly, abort
if ( ! defined( 'WPINC' ) ) {
die;
}
// Only run plugin in the admin
if ( ! is_admin() ) {
return;
}
// Add slug column to admin posts/pages lists
function add_slug_column($columns) {
$columns['slug'] = __('Slug');
return $columns;
}
add_filter('manage_posts_columns', 'add_slug_column');
add_filter('manage_pages_columns', 'add_slug_column');
// Populate slug column with the post slug
function display_slug_column_content($column, $post_id) {
if ($column === 'slug') {
$post = get_post($post_id);
echo esc_html($post->post_name); // Display the post slug
}
}
add_action('manage_posts_custom_column', 'display_slug_column_content', 10, 2);
add_action('manage_pages_custom_column', 'display_slug_column_content', 10, 2);
// Make slug column sortable
function add_slug_column_sortable($columns) {
$columns['slug'] = 'slug';
return $columns;
}
add_filter('manage_edit-post_sortable_columns', 'add_slug_column_sortable');
add_filter('manage_edit-page_sortable_columns', 'add_slug_column_sortable');
// Modify the query to sort by slug when requested
function sort_by_slug_column($query) {
if (!is_admin() || !$query->is_main_query()) {
return;
}
$orderby = $query->get('orderby');
if ('slug' == $orderby) {
$query->set('orderby', 'name'); // 'name' represents the slug in the database
}
}
add_action('pre_get_posts', 'sort_by_slug_column');
]]>I have an issue with the plugin. When all posts are loaded, the plugin sorts them alphabetically instead of by the newest. However, when I click on a category, it sorts them correctly.
]]>The theme features a custom post type for Events. So, by clicking the left menu I get to the main Events page, where I find the list of any event (the traditional WP table list).
The problem: since I’m NOT the administrator of the website, I never noticed the table doesn’t sort correctly the posts. To have it working I have to click two times the Date label in the header. I don’t know if this has always been its behavior because I never received any complaint.
I searched anywhere through the files of the theme but I could not find what is causing this issue (moreover, some years ago I made a plugin for this website and the plugin features an identical table that shows no issue).
Apparently, the only thing related to Events is the following (I found it in a theme-init file):
function events_post_register()
{$labels = array(
'name' => __('Events', 'taxonomy general name', CORE_THEME_NAME),
'singular_name' => __('Event', CORE_THEME_NAME),
'search_items' => __('Search Events', CORE_THEME_NAME),
'all_items' => __('All Events', CORE_THEME_NAME),
'parent_item' => __('Parent Event', CORE_THEME_NAME),
'edit_item' => __('Edit Event', CORE_THEME_NAME),
'update_item' => __('Update Event', CORE_THEME_NAME),
'add_new_item' => __('Add New Event', CORE_THEME_NAME),
'menu_name' => __('Events', CORE_THEME_NAME)
);
$args = array(
'labels' => $labels,
'singular_label' => __('Events', CORE_THEME_NAME),
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'hierarchical' => true,
'exclude_from_search' => true,
'capability_type' => 'post',
'query_var' => 'event',
'rewrite' => array(
'slug' => 'event',
'with_front' => false,
),
'menu_icon' => 'dashicons-calendar',
'supports' => array(
'title',
'editor',
'thumbnail',
'excerpt',
'comments',
'custom-fields'
)
);
register_post_type( 'event', $args );
}
Any help is appreciated.
]]>I have two custom taxonomy created with CPT.
The first taxonomy hasn’t problem, so the sort works perfectly. The error is with the second taxonomy.
I have sort alphabetically the taxonomy and move the term “Altro” as the last of the list ( see the screenshot below)
But in the ACF Frontend Admin doesn’t affect this sort
I have noticed that the plugin sort only 18 terms but the terms should be 76.
Have you some ideas or advice?
]]>Comment sorting option is not displayed, even if Display Comment Sorting Options is enabled.
It must have been some general change in the settings because it was showing up at the beginning, but I have no idea what exactly.
Please help
Thank you
]]>Can you please add an FAQ or some kind of documentation on your site that addresses the ability to sort photos on the front end by the users. This is sort of a big deal key feature one would want to have if they’re going to take the time to let users rate photos.
]]>