wordpress - Adding postmeta default values after adding post -


i using wordpress xmlrpc add posts blog.

however, after running this.

$data = array(             'title'   => $title,             'description' => $content,             'post_type'  => 'post',             'categories'  => array($category),             'post_status' => 'publish'         );              $addedpostreturn = $this->_client->query('metaweblog.newpost',                                           array(0,$username,$password,$data,1)); 

this adds post fine doesn't add postmeta information.

if open post, click update, default postmeta gets updated. however, add default postmeta information php script instead of manually (or else kinda defeats purpose).

is there anyway, either xmlrpc or regular wordpress functions create postmeta custom fields using default values? if not, there way have list of custom fields need manually add using custom fields section of metaweblog.newpost function? (i don't want add not others. rather complete job)

thanks in advance... appreciated! :)

edit:

$postupdatecontent = array(); $postupdatecontent['id'] = $newpostid; $postupdatecontent['post_content'] = $samecontent; wp_update_post( $postupdatecontent ); 

didn't seem trick...


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -