You should probably check out pre_post_update
.
Use pre_post_update
to check for a post update within your custom post type Container of Things. Check for your conditions. Then, get the connected Things and use wp_update_post
to unpublish these posts.
Related Posts:
- How do I run through a WordPress loop called from a filter function?
- Some doubts about how the main query and the custom query works in this custom theme?
- WP_Query vs get_posts
- How to list some posts first in the loop based on post id
- Using OR conditions in meta_query for query_posts argument
- Order posts by ID in the given order
- Get the number of posts from the current page results
- WordPress Custom Query to show posts from last x years
- How to order posts tag by tag?
- Query Custom Meta Value with Increment
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- 2 loops on page – one with orderby rand second orderby date
- ACF – Get lowest & highest value from field
- Query posts by specific word on title
- Multiple taxonomy And acf filter group by
- Five posts from a category in footer
- Multiple loops without repeating content
- Any number in meta key (wp query)
- WP_Query condition affects posts_per_page count
- Bypass “supress_filters” in WP Query
- Excluding pages in WP_query using ACF
- Add class to first post in custom loop using post_class filter
- Some doubts about how the main query and the custom query works in this custom theme?
- Stuck in the query loop
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- Is there a better way to pull in custom content without querying posts?
- How do I rewrite this loop as a new WP_Query style-loop?
- Include current post into loop
- Filter Custom Taxonomy Posts
- How to provide meta_key array to wp_query?
- Filter post query to only show direct children of category
- get_posts output always same post
- How to create custom query by keyword in post title?
- Conditional operator OR not working with custom fields
- Get posts that do not have the same tags as current
- Should I reset $wp_query?
- Expecting statement error from php loop using ACF plugin
- Filtering by multiple conditions in the loop
- 2 queries with counters
- relation OR instead of AND – Filtered term ID’s in loop
- Paginate pages with dynamic query
- filter posts by meta key with pagination
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Why does apply_filters behave different inside and outside a loop?
- Determine if ID is page or post and query the ID
- Custom template for password protected page
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Optimising WP_Query with ACF Fields
- Populate select list with meta values from all posts of a Custom Post Type
- Duplice post with standard WP loop – fixed by using query_posts() instead
- ACF: How can I publish values of ACF fields in a loop while using wp_query?
- How do I stop the same post showing multiple times in a archive?
- Custom query for custom post type not getting correct post ID
- Problem with my loops
- Sorting query_posts() with a complex orderby filter
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- WP_Query doesn’t works inside loop
- query_posts() doesn’t seem to be called in my page
- Some doubts about how the main query and the custom query works in this custom theme?
- Ordering Posts by parent category, name ascending
- Issue in If else condition [closed]
- query post based on comparison
- Creating array to compare custom field values
- Converting an existing query_posts to WP_Query
- Multiple loop for “featured” items returns wrong posts
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- Show number of posts AND number on current page (cannot make it work)
- WP_query shortcode inside acf Repeater breaks the repeater loop
- WP_Query filtering in ACF field containing dates
- active link for most recent post on vertical tabs
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- Create a hierarchical loop at predefined markup requirements
- Pagination returns 404 after page 20
- How to order by datediff in WP loop?
- Problems with WP_Query, Loop, a condition and Posts per Page
- how to exclude store in clipper theme wordpress code php
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- WP_Query secondary query failing
- custom query – offset to pagination
- WP_query for posts with same post type AND same post category
- How to solve this script problem in theme directory?
- Custom query with post_class filter using current_post not working
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WP_Query within save_post doesn’t include the item that triggered the action?
- WP_Query a custom field value bringing back 0 results
- Display post list within category list sorted by name [duplicate]
- Set Transient on CPT
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Pagination not working with WP_QUERY
- Show posts in category
- Can’t get the_content to show
- Both WP_Query and get_posts returning 1 post
- Custom search (wp query by custom fields)
- Geo location query inside wp_query?
- Optimising specific Query with ACF meta objects
- Add filter to Orderby Parameter using Array