get_post_types doesn’t work in plugin
I don’t think you’ll be able to get all the post types that are registered on init. (other plugins may register extra post types) Can’t you hook into wp_loaded?
I don’t think you’ll be able to get all the post types that are registered on init. (other plugins may register extra post types) Can’t you hook into wp_loaded?
This can be achieved with Multiple Taxonomy Handling. Try this code. <?php $args = array( ‘post_type’ => ‘note’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘terms’ => array( ‘class 11’, ‘chemistry’ ), // Add suitable term slugs here ‘field’ => ‘slug’ ) ) ); $my_query = new WP_Query( $args ); if( $my_query->have_posts() ) { while … Read more
Based on the description of your issue it sounds like there is one key piece of information missing. When the form is submitted you need to insert a custom meta value in wp_usermeta that will create a relationship between the new user and the corresponding custom post type. Lets call it meta_key = ‘user_post_id’ for … Read more
Yes. Use capabilities! When registering a post type, take a look at the capability_type and capabilities. You can define a custom capability map for the standard edit_post, delete_post, etc. for your post type. The thing you remember is, if you customize the capabilities, YOU DON’T HAVE THESE CAPABILITIES EITHER! This means you’ll have to get … Read more
Best way to group posts based on custom post type terms
Next/Previous Post Links in single-[custom-post-type].php file
Getting wrong ID
Your code… function wpuf_update_vehicle_year( $post_id ) { $year = get_post_meta( $post_id, ‘seek_property_year’, true ); update_post_meta( $post_id, ‘seek_property_year’, $year ); } add_action( ‘wpuf_add_post_after_insert’, ‘wpuf_update_vehicle_year’ ); is probably executed, but nothing will change anyway because the thing it does is to grab meta data (with get_post_meta) for seek_property_year and then update the same meta data with the … Read more
It’s not clear if you mean 800ms for total page load with assets and network overhead (which is quite good) or for page generation time alone (much less good). In any case you are making a large mistake of guessing that query is your performance bottleneck. That’s not how performance optimization works. You need to … Read more
There are definitely some issues, I’d question what exactly you’d gain from having the same structure for all. You could create conflicts if you have two different posts with the same slug. There would be nothing enforcing slug uniqueness between post types, so you’d have to write that code yourself to run whenever a post … Read more