For cron jobs, take a look at the Transients API.
The rest could maybe be acchieved with something like the following. I have never ever used the transient API before and code’s not tested.
function set_post_to_draft()
{
global $post;
if ( get_post_meta( $post->ID, 'set_to_draft_key' ) == true );
return $post->post_status == 'draft';
}
set_transient( 'post_to_draft_transient', set_post_to_draft(), 60*60*12 ); // 12h interval
Related Posts:
- Importing data for advanced custom fields plugin?
- Gutenberg add a custom metabox to default blocks
- How to rename a custom field?
- Filter post listing by meta value which is a date
- Extra profile field as select box?
- Matching Serialized Arrays with meta_query
- Pre-filling custom fields on New Post
- Make Custom Field Into A Link On The Front End?
- How to activate “custom fields” section in WP3
- Why isn’t my code to save custom fields in quick edit working?
- Add meta data to the menu
- How to oEmbed from custom field, responsive to container size and responsive
- Custom Meta Boxes: Store two values in one repeatable field
- Copy SEO Meta Desc “Custom Field” to Excerpt field?
- Custom fields won’t display on my blog page
- How to customize default wordpress editor?
- Problem in custom meta boxes
- Add an advert every nth Paragraph
- How to edit multiple post with Custom fields
- Undefined index error when saving content on metabox
- Metabox with multiple fields added by user and upload box
- How to update custom user meta field in wp?
- Get all meta keys assigned to a post type
- sort search results by custom fields using dropdown
- How can I show custom fields in the loop only to specific user roles?
- Add conditional custom option to ‘Display name publicly as’ dropdown
- Custom fields not getting saved in the databse when added to the add new user profile page
- I want to send an email when each post is published
- Creating a widget with a number of custom fields
- How to loop through certain custom field values
- Show 1 post and after a specific date show the next one
- How to Create Dynamic Fields in a Meta Box?
- Set front page option using custom fields?
- Add post meta fields, when creating a post using WordPress’ REST API
- Custom Field Values not updating unless I click “Update” twice
- Can I create a template or doctype for my blog site?
- Custom field, add class to anchor tag
- Custom Metabox additional item
- How to combine custom fields to make one order-able value
- Updating Other User’s Metadata
- get_posts in meta box dropdown not showing latest posts
- Trying to reorder posts by custom field
- Delete custom fields when deleting posts
- Split the_title
- How to Wrote Simple Calculations by Using Custom Fields in Loop?
- Custom Query based on custom field of a single post
- comment meta_query for keys that aren’t yet set
- Link the retrieved custom field values to its respective posts
- Sortable custom field values from all posts on a page template
- How can I use custom properties to set different background on different pages?
- Values entered in a meta box aren’t saved
- change order of images attached to post
- How to Make Post Custom Column Editable
- how can I show name and value of Custom Fields together?
- Adding simple (one button) Audio player using Custom Fields?
- Loop through incrementing custom fields
- tax query between operator like
- Single page WordPress website – custom fields or meta boxes or something else?
- Collect Data from NEXT item while in loop
- Order custom fields alphabetically
- How to query for posts with either one or another custom field
- How show post only from after custom date
- Is it possible to compare the current time with a custom “start” and “end date
- Display metabox title for custom fields with values
- Filter or order based on custom field
- Gutenberg add a custom metabox to default blocks
- How to use ACF with javascript to update custom field values?
- Custom Fields Not Showing (ACF not installed)
- Show Custom field value instead of title in WP Menu
- How to add code to custom field to every blog post via php?
- How to Find List of Available Custom Fields for Theme?
- Getting user’s data, by custom field lookup (meta)
- get wordpress post loop by meta box date
- Sort posts by custom fields with empty values
- Counting number of images from loop
- Automatically set the_post_thumbnail to Custom Field Value
- Redirecting to an external URL
- Why is wp_list_pages altering $post->ID of the page?
- Adding custom fields to images
- How to save dynamically generated value in post type?
- how to show this part only in the single post page?
- Checking if field is set before comparing with meta_query in query_posts?
- Calling a custom profile field only it it exists
- Insert wp gallery shortcode into custom textarea
- Display posts where date field matches current month?
- Only show content slideshow if “slideshow” custom field exists
- If post custom meta data is not set, show normal state
- Sort posts after filtering them through multiple taxonomies
- Add values of post meta fields?
- How to include custom field in shortcode (do_shortcode) in theme file
- Query posts by Custom Meta (checkbox) & Genesis Grid Loop
- custom field with links
- Custom fields: Split data from single custom field’s sub-array to separate custom fields when saving post
- How can I copy value from dropdown once I select it to text area as text?
- Create taxonomy terms from custom field values
- Save Custom Meta Value on Media Upload
- Is there a way to read JSON data inside Custom Fields without editing PHP? [closed]
- How to add new Metadata options (Date, Author, etc.) for Posts?
- Saving multiple custom meta box fields
- Modal pop-up HTML code works on other sites or HTML viewers but not in the custom HTML block within a wordpress page?