Auto draft posts when scheduled date is reached
Auto draft posts when scheduled date is reached
Auto draft posts when scheduled date is reached
I was able to solve my problem by calling set_post_format in my save_post callback and making sure to check if its set and not equal to the “no change” option. Not sure if this is the best way to go, but it works. require( plugin_admin_dir . ‘plugin-sync.php’ ); add_action( ‘save_post’, ‘savethepost’, 2000); function savethepost($post_id) { … Read more
Can I override the permalink/slug on creation
Set a post to draft once depending on a post meta value (passed certain date)?
Update button is not always active. If the WordPress is auto-saving current post content, the update button will be disabled. This is normally done once every 60 seconds (default autosave interval). Auto-saving is done using AJAX, and if your website is slow to respond, autosave process can take a lot of time to finish. Depending … Read more
i found the answer i just add global $wpdb; then update the database $wpdb->query( “UPDATE `$wpdb->posts` SET `post_content` = ‘”.current_time(“Y-m-d H:i:s”).”‘ WHERE `ID` = ‘”.$_POST[‘content’].”‘” );
There are something wrong in your code, Here I edited what you tried, function rohs_update_title($post_ID){ $post_type = get_post_type($post_ID); // If this isn’t a ‘rohs_menu’ post, don’t update it. if ( “rohs_menu” != $post_type ) return; $postAuthorId = get_post_field( ‘post_author’, $post_ID ); // get the post author ID $userToGetData=”user_”.$postAuthorId; $restaurantName = get_field( ‘nom_restaurant’, $userToGetData ); $date … Read more
The issue was my theme; a recent update to it (Hestia Free v1.1.51) caused Page Builder by SiteOrigins to break page updates by copying the updated page content to whatever page was set to the Static Front Page. That version of Hestia also generated numerous page updates to the static front page, often many per … Read more
$wpdb->update query incrementing value on it’s own!
Well in your for loop, I think you’re missing the $postcount variable… also there’s a typo at $idss[$i] …. should be $ids[i] based on what you’ve shown. for ($i = 0; $i < $postcount; $i++) { wp_update_post(array(‘ID’ => $ids[$i], ‘post_status’ => ‘draft’)); } That being said I’d just go with a foreach loop. The mistake … Read more