One custom taxonomy with unique sets of labels for two post types?
One custom taxonomy with unique sets of labels for two post types?
One custom taxonomy with unique sets of labels for two post types?
Is “Contributor” a safe custom type name?
Help with right recipe ierarchy post type and taxonomy
If your posts store the date in a consistent format like YYYY-MM-DD HH:MM:SS, etc, you could compare with strings using regular expressions, like: $current_date = new DateTime(); $datemonth = $current_date->format(“m-d”); // MM-DD $args = array( // … ‘meta_query’ => array( array( ‘key’ => ‘birthday’, ‘compare’ => ‘REGEXP’, // Regular expression explanation: // ^ – Start … Read more
Linking and embedding two custom post types with the REST API
The filter wp_title won’t pass $id to your function. Drop the parameter and instead retrieve it with get_queried_object_id(): function dw_listing_title( $title ) { if ( is_singular() && $id = get_queried_object_id() ) { // Modify $title as required } return $title; }
Yes it is, and to also sort by the post title, you would just need to add , {$wpdb->posts}.post_title <ASC or DESC> after the FIELD(), like so which results in a clause that looks like ORDER BY FIELD(wp_posts.post_type, <types>), wp_posts.post_title ASC: // Replace this: return $orderby = “FIELD( {$wpdb->posts}.post_type,” . $post_type__in_string . ‘ )’; // … Read more
The issue with your code appears to be related to the hook wp_after_insert_post being nested within the publish_service action. This setup can lead to the wp_after_insert_post action being added multiple times, which may cause the repeated creation of products. Here are a few steps to resolve this issue: Separate the Actions: Instead of nesting wp_after_insert_post … Read more
After thorough investigation, I identified the root cause of the issue. TL;DR: A bug in my JavaScript code was causing the post form to be submitted without the necessary publish parameter. Consequently, WordPress interpreted the request as an attempt to save a draft. I resolved the issue by updating the code to include the publish … Read more
You don’t need to use add_submenu_page() for custom post types and taxonomies, WordPress adds them to the menu automatically when you use the show_in_menu parameter.