output(); /* ================================================== * KtaiAdmin_Page_Form class ================================================== */ class KtaiAdmin_Page_Form { private $base; private $admin; private $orig_referer; private $message; private $messages; private $notices; public function __construct($base) { $this->base = $base; $this->admin = $base->admin; $this->orig_referer = wp_get_original_referer(); if ( isset($_GET['message']) ) { $this->message = intval( $_GET['message'] ); if ($this->message == 1 && ! $this->orig_referer) { $this->message = 4; } } $this->messages[1] = sprintf(__('Page updated. Continue editing below or go back.', 'ktai_style'), esc_attr($this->orig_referer)); $this->messages[2] = __('Custom field updated.', 'ktai_style'); $this->messages[3] = __('Custom field deleted.', 'ktai_style'); $this->messages[4] = __('Page updated.', 'ktai_style'); $this->messages[5] = __('Page published.', 'ktai_style'); $this->messages[6] = __('Page submitted.', 'ktai_style'); if ( isset($_GET['revision']) ) { $this->messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); } $this->notices[1] = __( 'There is an autosave of this page that is more recent than the version below. View the autosave.' ); global $post_ID, $temp_ID; $post_ID = isset($post_ID) ? intval($post_ID) : 0; $temp_ID = isset($temp_ID) ? intval($temp_ID) : 0; } // ================================================== public function output() { global $action, $post_ID, $temp_ID, $post, $post_referredby; $notice = false; if ( 0 == $post_ID ) { $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() $form_action = 'post'; $nonce_action = 'add-page'; $slug_optional = ' ' . __('(Optional)', 'ktai_style'); $form_extra = ''; } else { $form_action = 'editpost'; $nonce_action = 'update-page_' . $post_ID; $slug_optional = ''; $form_extra = ''; } $can_publish = current_user_can('publish_pages'); include dirname(__FILE__) . '/admin-header.php'; if ( $notice ) : ?>
message)) : ?>messages[$this->message]; ?>