Skip to content

Instantly share code, notes, and snippets.

@s-hiroshi
Created March 15, 2016 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-hiroshi/9378e679fee1376ddc99 to your computer and use it in GitHub Desktop.
Save s-hiroshi/9378e679fee1376ddc99 to your computer and use it in GitHub Desktop.
WordPressで投稿の状態を変更するサンプルです。
<?php
// https://codex.wordpress.org/Post_Status
$my_post = array();
$my_post['ID'] = 123 // 投稿ID;
$my_post['post_status'] = 'draft'; // 下書き
wp_update_post( $my_post );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment