Set a post to draft once depending on a post meta value (passed certain date)?
Set a post to draft once depending on a post meta value (passed certain date)?
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
You can use the post type within the action name and you gain the removing of an unnecessary check of the post type. More on this wp_transition_post_status For instance: When publishing a post for the first time, the post status may transition from ‘draft’ – or some other status – to ‘publish’. However, if a … Read more
How is this possible? I can think of one possibility that for some reason ur page is getting auto reloaded. So the flow of execution is like: you access the page, your code gets executed changing status from draft to published, then some other code gets executed and the page is reloaded. This time when … Read more
I think it’s not the wp-config.php or .htaccess file you need to edit. The problem is web server related. search for php.ini file in your web server directory and there are some specific limits you may need to configure. like following keywords: upload_max_size’ , ’64M’ post_max_size’, ’64M’ max_execution_time’, ‘300’ I hope it helps and feel … Read more