test_interface('header'); // set in wphone.php plugin if( !isset($this->context) || ( ($this->context != 'post') && ($this->context != 'page') ) ) { $this->context = 'post'; } $this->check_user_permissions('edit_' . $this->context . 's'); if ( file_exists( ABSPATH . 'wp-admin/includes/admin.php' ) ) require_once( ABSPATH . 'wp-admin/includes/admin.php' ); else require_once( ABSPATH . 'wp-admin/admin-functions.php' ); $fancy_text = __( ucfirst($this->context), 'wphone' ); global $post, $user_ID, $wp_version; $subcontext = 'add'; $post_ID_field = ''; $post_categories = array(); $post_tags = ''; $post_ID = (int) $_GET['post']; $tags_compat = ( ($this->context == 'post') && ( function_exists('get_tags_to_edit') ) ) ? TRUE : FALSE; // Generate form details if ( 0 == $post_ID ) { $form_action = 'post'; $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() $form_extra = ""; } else { $post_ID = (int) $post_ID; $form_action = 'editpost'; $form_extra = ""; } // Generate nonce ID and stuff if ( 'page' == $this->context ) { if ( 0 == $post_ID ) $nonce_action = 'add-page'; else $nonce_action = 'update-page_' . $post_ID; $fancy_type = __('Page', 'wphone'); $redirect = 'edit-pages.php'; } else { if ( 0 == $post_ID ) { $nonce_action = 'add-post'; $fancy_type = __('Draft', 'wphone'); } else { $nonce_action = 'update-post_' . $post_ID; $fancy_type = __('Post', 'wphone'); } $redirect = 'edit.php'; } if ( !empty($post_ID) ) { $this->check_user_permissions('edit_post', $post_ID); if ( $post = get_post($post_ID) ) { $subcontext = 'edit'; $post_categories = wp_get_post_categories($post_ID); if ($tags_compat) $post_tags = get_tags_to_edit( $post_ID ); } } $form_id = $this->context . '-' . $nonce_action; if ( ! $this->iscompat ) { // note we need this one conditional because the same form is used in multiple contexts echo '