add wp-future
This commit is contained in:
24
wp-future.php
Normal file
24
wp-future.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
//require '/thosts/vij/wp/vendor/autoload.php';
|
||||
require '/vhosts/beta/vendor/autoload.php';
|
||||
|
||||
dbl_config('vetandlife', 'mysql:host=mysql;dbname=vetandlife', 'vetandlife', 'g-34hJk-3-er2');
|
||||
|
||||
|
||||
$future_news = db_get("SELECT ID FROM `wp_posts` WHERE `post_status` = 'future' AND `post_date` <= current_date() ");
|
||||
|
||||
|
||||
if (count($future_news) == 0 ){
|
||||
echo 'no count';
|
||||
exit;
|
||||
}
|
||||
|
||||
foreach ($future_news as $news) {
|
||||
|
||||
$upd_sql = "UPDATE `wp_posts` SET `post_status` = 'publish' WHERE `ID` = '${news['ID']}';";
|
||||
$result = db_get($upd_sql);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user