コード例 #1
0
ファイル: admin.php プロジェクト: joasssko/schk
 /**
  * Save Subtitle
  *
  * @since  2.0
  * @internal
  *
  * @uses  WPSubtitle::get_supported_post_types()
  *
  * @param  int  $post_id  Post ID or object.
  */
 static function _save_post($post_id)
 {
     // Verify if this is an auto save routine.
     // If it is our form has not been submitted, so we dont want to do anything
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     // Verify nonce
     if (!WPSubtitle_Admin::_verify_posted_nonce('wps_noncename', 'wp-subtitle')) {
         return;
     }
     // Check edit capability
     if (!WPSubtitle_Admin::_verify_post_edit_capability($post_id)) {
         return;
     }
     // Save data
     if (isset($_POST['wps_subtitle'])) {
         update_post_meta($post_id, 'wps_subtitle', wp_kses_post($_POST['wps_subtitle']));
     }
 }