I write Function to store post in the database of wordpress
In the array of $post variable ‘post_status’ =>’publish’.. But I don’t know Why when running the function save post ‘future’ no ‘publish’ Where problem?
function ghoolo_mango(){
$oiobz1 = writeMsg(1, 'center', '', 1);
$bndate = bn_parsidate::getInstance();
$bndate = $bndate->persian_date($input,$datetime,$lang);
$postdater = parsidate('j / F / Y',$datetime='now',$lang='pre');
$postdate = date('Y-m-d H:i:s');
$ta = parsidate('j / F / Y',$datetime='now',$lang='pre');
$postdate_gmt = date('Y-m-d H:i:s');
$titles='ÙÛست ÙÛÙ
ت اÙ
رÙز Ø·Ùا' .$postdater;
$posts = array(
'post_content' => $oiobz1,
'post_name' => $titles,
'post_title' => $titles,
'post_type' => 'post',
'post_status' => 'publish',
'post_author' => '1',
'ping_status' => 'open',
'post_date_gmt' => $postdate_gmt,
'post_date' => $postdate_gmt,
'post_category' => array(40),
'tags_input' => "ÙÛÙ
ت,ÙÛÙ
ت رÙز,ÙÛÙ
ت اÙ
رÙز,ÙÛÙ
ت رÙزاÙÙ,ÙÛÙ
ت ÙØظ٠اÛ,ÙÛÙ
ت Ø¢ÙÙاÛÙ,ÙÛÙ
ت Ù
اÙاÙÙ,ÙÛÙ
ت ÙÙتگÛ,ÙÛÙ
ت Ø·Ùا $ta,ÙÛÙ
ت اÙ
رÙز Ø·Ùا$ta,ÙÛÙ
ت Ø·Ùا در تارÛØ®$ta,ÙÛÙ
ت رÙزاÙÙ Ø·Ùا,ÙÛÙ
ت Ø·Ùا اÙ
رÙز $ta,ÙÛÙ
ت ÙØØ¸Ù Ø§Û Ø·Ùا$ta,ÙÛÙ
ت Ù
Ø«Ùا٠طÙا$ta,ÙÛÙ
ت اÙ
رÙز Ù
Ø«Ùا٠طÙا$ta,ÙÛÙ
ت اÙ
رÙز Ø·Ùا 24 عÛار$ta,ÙÛÙ
ت Ø·ÙØ§Û 24 عÛار $ta,ÙÛÙ
ت اÙ
رÙز Ø·Ùا 18 عÛار $ta,ÙÛÙ
ت Ø·Ùا 18 عÛار $ta , ÙÛÙ
ت اÙ
رÙز اÙس ÙÙر٠$ta,ÙÛÙ
ت اÙس Ù¾ÙاتÛÙ $ta,ÙÛÙ
ت اÙس پاÙادÛÙ
$ta,ÙÛÙ
ت ÙÙت سبک ÙÙت $ta",
);
$post_id = wp_insert_post($posts);
add_post_meta( $post_id, ' wp_insert_post', 0, true );
}