Custom Meta fields Update hook?
Yes, there is number of hooks in generic low level update_metadata() function. Limited to the post meta you would probably want to use update_postmeta or updated_postmeta.
Yes, there is number of hooks in generic low level update_metadata() function. Limited to the post meta you would probably want to use update_postmeta or updated_postmeta.
In typical use cases the performance cost of booting WordPress core for page load is significantly higher than querying for data. In other words it doesn’t quite matter, because it won’t be a bottleneck. You have to estimate: How close your data is to native WordPress concepts How much work (if any) it would be … Read more
Your argument for is_singular() is wrong It should be an array is_singular(array(‘post’,’movie’)) You can read more about the argument passed from this link here
Hook in when a post is deleted, check for the post type, then manipulate post_parent of potential child posts (or delete the posts): function wp_dev_174635_update_posts( $parent_id ) { $parent = get_post( $parent_id ); if ( $parent->post_type !== ‘type2’ ) { return; } $posts = get_posts( array( ‘post_type’ => ‘type1’, ‘post_parent’ => $parent_id, ) ); foreach … Read more
Well I felt I better update this old question, the SEO plugin by Yoast now allows assigning of all SEO abilities to custom post type archives. So that’s the best solution.
The main query runs before the template is loaded. WordPress knows what template to load based on the results of that query. If you want to insert an additional query into the content area, either create a shortcode, or add a filter on the_content and do your page check/query output there.
There is some information about this problem in the Action Reference for save post: If you are calling a function such as wp_update_post that includes the save_post hook, your hooked function will create an infinite loop. To avoid this, unhook your function before calling the function you need, then re-hook it afterward. So something like … Read more
The posts page is a special case that’s hardcoded into core- it lets a page’s main query be converted to a posts query. In this situation, the posts page ceases to be a “page” in the conventional sense- is_page is false, you can’t access the page’s content, etc.. Doing this page-query-to-posts-query conversion with the main … Read more
The problem you are having is that get_queried_object returns results based on the query that was run. On author.php, the queried object was an author. On single.php, page.php, or any custom post type template, the queried object will be the post, not the author. This means that if you want to use $wp_query->get_queried_object();, you will … Read more
I’m not sure exactly how you want ‘term_single’ formatted, but you can amend the below as required if it’s not quite what you are looking for. I’d also suggest not using the name $posts for your array, as I believe that WP has a global of the same name, so it could cause funkyness that … Read more