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
- Show default content if custom WP_Query has no posts
- Display one latest post from multiple categories
- meta_query on a date range using an array of values
- Remove ellipsis from the excerpt retrieved using get_the_excerpt()
- WP query exclude post within the last month / only show over 1 month old
- WordPress query for most recent posts from multiple categories
- Too many posts cause slow load when paginating
- How to prevent writing duplicate loops?
- Slow page loads due to WordPress Core Query
- 1/3 of posts different class
- Reset WordPress Post Query to default
- Is_single() conditional tag returns null in query
- ACF accessing a field from the query, but not in post
- filter wp_query result with custom field values
- Posts in loop all show the same author when there are many authors
- If have posts a week old, display, else display a different loop
- How to filter query loop block with a search string from the query parameters
- WP_Query – How to get all posts of specific days of week by custom field date?
- How can I comment comma-separated array values?
- Custom post type – filter content by custom meta box content
- Query post with content only
- Merge two queries and remove duplicate
- Why is my query not giving results?
- posts_per_page increment additional post
- Multiple loops on index page with sticky post and pagination
- Pagination in category.php not functioning
- tax_query not working properly with get_posts
- the_excerpt() not working in custom archive