raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * Edit page form for inclusion in the administration panels.
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 /**
mp-wp_genesis 10 * Post ID global.
mp-wp_genesis 11 * @name $post_ID
mp-wp_genesis 12 * @var int
mp-wp_genesis 13 */
mp-wp_genesis 14 if ( ! isset( $post_ID ) )
mp-wp_genesis 15 $post_ID = 0;
mp-wp_genesis 16 if ( ! isset( $temp_ID ) )
mp-wp_genesis 17 $temp_ID = 0;
mp-wp_genesis 18
mp-wp_genesis 19 if ( isset($_GET['message']) )
mp-wp_genesis 20 $_GET['message'] = absint( $_GET['message'] );
mp-wp_genesis 21 $messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
mp-wp_genesis 22 $messages[2] = __('Custom field updated.');
mp-wp_genesis 23 $messages[3] = __('Custom field deleted.');
mp-wp_genesis 24 $messages[4] = __('Page updated.');
mp-wp_genesis 25 $messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));
mp-wp_genesis 26 $messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
mp-wp_genesis 27
mp-wp_genesis 28 if ( isset($_GET['revision']) )
mp-wp_genesis 29 $messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
mp-wp_genesis 30
mp-wp_genesis 31 $notice = false;
mp-wp_genesis 32 $notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );
mp-wp_genesis 33
mp-wp_genesis 34 if ( 0 == $post_ID) {
mp-wp_genesis 35 $form_action = 'post';
mp-wp_genesis 36 $nonce_action = 'add-page';
mp-wp_genesis 37 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
mp-wp_genesis 38 $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
mp-wp_genesis 39 } else {
mp-wp_genesis 40 $post_ID = (int) $post_ID;
mp-wp_genesis 41 $form_action = 'editpost';
mp-wp_genesis 42 $nonce_action = 'update-page_' . $post_ID;
mp-wp_genesis 43 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
mp-wp_genesis 44 $autosave = wp_get_post_autosave( $post_ID );
mp-wp_genesis 45 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
mp-wp_genesis 46 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
mp-wp_genesis 47 }
mp-wp_genesis 48
mp-wp_genesis 49 $temp_ID = (int) $temp_ID;
mp-wp_genesis 50 $user_ID = (int) $user_ID;
mp-wp_genesis 51
mp-wp_genesis 52 /**
mp-wp_genesis 53 * Display submit form fields.
mp-wp_genesis 54 *
mp-wp_genesis 55 * @since 2.7.0
mp-wp_genesis 56 *
mp-wp_genesis 57 * @param object $post
mp-wp_genesis 58 */
mp-wp_genesis 59 function page_submit_meta_box($post) {
mp-wp_genesis 60 global $action;
mp-wp_genesis 61
mp-wp_genesis 62 $can_publish = current_user_can('publish_pages');
mp-wp_genesis 63 ?>
mp-wp_genesis 64 <div class="submitbox" id="submitpage">
mp-wp_genesis 65
mp-wp_genesis 66 <div id="minor-publishing">
mp-wp_genesis 67
mp-wp_genesis 68 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
mp-wp_genesis 69 <div style="display:none;">
mp-wp_genesis 70 <input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
mp-wp_genesis 71 </div>
mp-wp_genesis 72
mp-wp_genesis 73 <div id="minor-publishing-actions">
mp-wp_genesis 74 <div id="save-action">
mp-wp_genesis 75 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
mp-wp_genesis 76 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
mp-wp_genesis 77 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
mp-wp_genesis 78 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
mp-wp_genesis 79 <?php } ?>
mp-wp_genesis 80 </div>
mp-wp_genesis 81
mp-wp_genesis 82 <div id="preview-action">
mp-wp_genesis 83 <?php $preview_link = 'publish' == $post->post_status ? clean_url(get_permalink($post->ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>
mp-wp_genesis 84
mp-wp_genesis 85 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php _e('Preview'); ?></a>
mp-wp_genesis 86 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
mp-wp_genesis 87 </div>
mp-wp_genesis 88
mp-wp_genesis 89 <div class="clear"></div>
mp-wp_genesis 90 </div><?php // /minor-publishing-actions ?>
mp-wp_genesis 91
mp-wp_genesis 92 <div id="misc-publishing-actions">
mp-wp_genesis 93
mp-wp_genesis 94 <div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
mp-wp_genesis 95 <b><span id="post-status-display">
mp-wp_genesis 96 <?php
mp-wp_genesis 97 switch ( $post->post_status ) {
mp-wp_genesis 98 case 'private':
mp-wp_genesis 99 _e('Privately Published');
mp-wp_genesis 100 break;
mp-wp_genesis 101 case 'publish':
mp-wp_genesis 102 _e('Published');
mp-wp_genesis 103 break;
mp-wp_genesis 104 case 'future':
mp-wp_genesis 105 _e('Scheduled');
mp-wp_genesis 106 break;
mp-wp_genesis 107 case 'pending':
mp-wp_genesis 108 _e('Pending Review');
mp-wp_genesis 109 break;
mp-wp_genesis 110 case 'draft':
mp-wp_genesis 111 _e('Draft');
mp-wp_genesis 112 break;
mp-wp_genesis 113 }
mp-wp_genesis 114 ?>
mp-wp_genesis 115 </span></b>
mp-wp_genesis 116 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
mp-wp_genesis 117 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
mp-wp_genesis 118
mp-wp_genesis 119 <div id="post-status-select" class="hide-if-js">
mp-wp_genesis 120 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
mp-wp_genesis 121 <select name='post_status' id='post_status' tabindex='4'>
mp-wp_genesis 122 <?php if ( 'publish' == $post->post_status ) : ?>
mp-wp_genesis 123 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
mp-wp_genesis 124 <?php elseif ( 'private' == $post->post_status ) : ?>
mp-wp_genesis 125 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
mp-wp_genesis 126 <?php elseif ( 'future' == $post->post_status ) : ?>
mp-wp_genesis 127 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
mp-wp_genesis 128 <?php endif; ?>
mp-wp_genesis 129 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
mp-wp_genesis 130 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
mp-wp_genesis 131 </select>
mp-wp_genesis 132
mp-wp_genesis 133 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
mp-wp_genesis 134 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
mp-wp_genesis 135 </div>
mp-wp_genesis 136
mp-wp_genesis 137 <?php } ?>
mp-wp_genesis 138 </div><?php // /misc-pub-section ?>
mp-wp_genesis 139
mp-wp_genesis 140 <div class="misc-pub-section " id="visibility">
mp-wp_genesis 141 <?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
mp-wp_genesis 142
mp-wp_genesis 143 if ( 'private' == $post->post_status ) {
mp-wp_genesis 144 $post->post_password = '';
mp-wp_genesis 145 $visibility = 'private';
mp-wp_genesis 146 $visibility_trans = __('Private');
mp-wp_genesis 147 } elseif ( !empty( $post->post_password ) ) {
mp-wp_genesis 148 $visibility = 'password';
mp-wp_genesis 149 $visibility_trans = __('Password protected');
mp-wp_genesis 150 } else {
mp-wp_genesis 151 $visibility = 'public';
mp-wp_genesis 152 $visibility_trans = __('Public');
mp-wp_genesis 153 }
mp-wp_genesis 154
mp-wp_genesis 155 ?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
mp-wp_genesis 156
mp-wp_genesis 157 <div id="post-visibility-select" class="hide-if-js">
mp-wp_genesis 158 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
mp-wp_genesis 159 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
mp-wp_genesis 160
mp-wp_genesis 161
mp-wp_genesis 162 <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
mp-wp_genesis 163 <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
mp-wp_genesis 164 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /><br /></span>
mp-wp_genesis 165 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
mp-wp_genesis 166
mp-wp_genesis 167 <p>
mp-wp_genesis 168 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
mp-wp_genesis 169 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
mp-wp_genesis 170 </p>
mp-wp_genesis 171 </div>
mp-wp_genesis 172 <?php } ?>
mp-wp_genesis 173
mp-wp_genesis 174 </div><?php // /misc-pub-section ?>
mp-wp_genesis 175
mp-wp_genesis 176 <?php
mp-wp_genesis 177 $datef = _c( 'M j, Y @ G:i|Publish box date format');
mp-wp_genesis 178 if ( 0 != $post->ID ) {
mp-wp_genesis 179 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
mp-wp_genesis 180 $stamp = __('Scheduled for: <b>%1$s</b>');
mp-wp_genesis 181 } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
mp-wp_genesis 182 $stamp = __('Published on: <b>%1$s</b>');
mp-wp_genesis 183 } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
mp-wp_genesis 184 $stamp = __('Publish <b>immediately</b>');
mp-wp_genesis 185 } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
mp-wp_genesis 186 $stamp = __('Schedule for: <b>%1$s</b>');
mp-wp_genesis 187 } else { // draft, 1 or more saves, date specified
mp-wp_genesis 188 $stamp = __('Publish on: <b>%1$s</b>');
mp-wp_genesis 189 }
mp-wp_genesis 190 $date = date_i18n( $datef, strtotime( $post->post_date ) );
mp-wp_genesis 191 } else { // draft (no saves, and thus no date specified)
mp-wp_genesis 192 $stamp = __('Publish <b>immediately</b>');
mp-wp_genesis 193 $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
mp-wp_genesis 194 }
mp-wp_genesis 195 ?>
mp-wp_genesis 196 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
mp-wp_genesis 197 <div class="misc-pub-section curtime misc-pub-section-last">
mp-wp_genesis 198 <span id="timestamp">
mp-wp_genesis 199 <?php printf($stamp, $date); ?></span>
mp-wp_genesis 200 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
mp-wp_genesis 201 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
mp-wp_genesis 202 </div><?php // /misc-pub-section ?>
mp-wp_genesis 203 <?php endif; ?>
mp-wp_genesis 204
mp-wp_genesis 205 </div>
mp-wp_genesis 206 <div class="clear"></div>
mp-wp_genesis 207 </div>
mp-wp_genesis 208
mp-wp_genesis 209 <div id="major-publishing-actions">
mp-wp_genesis 210 <?php do_action('post_submitbox_start'); ?>
mp-wp_genesis 211 <div id="delete-action">
mp-wp_genesis 212 <?php
mp-wp_genesis 213 if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
mp-wp_genesis 214 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&amp;post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
mp-wp_genesis 215 <?php } ?>
mp-wp_genesis 216 </div>
mp-wp_genesis 217
mp-wp_genesis 218 <div id="publishing-action">
mp-wp_genesis 219 <?php
mp-wp_genesis 220 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
mp-wp_genesis 221 <?php if ( $can_publish ) : ?>
mp-wp_genesis 222 <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
mp-wp_genesis 223 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
mp-wp_genesis 224 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
mp-wp_genesis 225 <?php else : ?>
mp-wp_genesis 226 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
mp-wp_genesis 227 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
mp-wp_genesis 228 <?php endif; ?>
mp-wp_genesis 229 <?php else : ?>
mp-wp_genesis 230 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
mp-wp_genesis 231 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
mp-wp_genesis 232 <?php endif; ?>
mp-wp_genesis 233 <?php } else { ?>
mp-wp_genesis 234 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Page') ?>" />
mp-wp_genesis 235 <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Page') ?>" />
mp-wp_genesis 236 <?php } ?>
mp-wp_genesis 237 </div>
mp-wp_genesis 238 <div class="clear"></div>
mp-wp_genesis 239 </div>
mp-wp_genesis 240 </div>
mp-wp_genesis 241 <?php
mp-wp_genesis 242 }
mp-wp_genesis 243 add_meta_box('pagesubmitdiv', __('Publish'), 'page_submit_meta_box', 'page', 'side', 'core');
mp-wp_genesis 244
mp-wp_genesis 245 /**
mp-wp_genesis 246 * Display page password form fields.
mp-wp_genesis 247 *
mp-wp_genesis 248 * @since 2.6.0
mp-wp_genesis 249 *
mp-wp_genesis 250 * @param object $post
mp-wp_genesis 251 */
mp-wp_genesis 252 function page_password_meta_box($post){
mp-wp_genesis 253 ?>
mp-wp_genesis 254 <p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
mp-wp_genesis 255 <h4><?php _e( 'Page Password' ); ?></h4>
mp-wp_genesis 256 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
mp-wp_genesis 257 <p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
mp-wp_genesis 258 <?php
mp-wp_genesis 259 }
mp-wp_genesis 260 // add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
mp-wp_genesis 261
mp-wp_genesis 262 /**
mp-wp_genesis 263 * Display page attributes form fields.
mp-wp_genesis 264 *
mp-wp_genesis 265 * @since 2.7.0
mp-wp_genesis 266 *
mp-wp_genesis 267 * @param object $post
mp-wp_genesis 268 */
mp-wp_genesis 269 function page_attributes_meta_box($post){
mp-wp_genesis 270 ?>
mp-wp_genesis 271 <h5><?php _e('Parent') ?></h5>
mp-wp_genesis 272 <label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
mp-wp_genesis 273 <?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
mp-wp_genesis 274 <p><?php _e('You can arrange your pages in hierarchies, for example you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
mp-wp_genesis 275 <?php
mp-wp_genesis 276 if ( 0 != count( get_page_templates() ) ) {
mp-wp_genesis 277 ?>
mp-wp_genesis 278 <h5><?php _e('Template') ?></h5>
mp-wp_genesis 279 <label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
mp-wp_genesis 280 <option value='default'><?php _e('Default Template'); ?></option>
mp-wp_genesis 281 <?php page_template_dropdown($post->page_template); ?>
mp-wp_genesis 282 </select>
mp-wp_genesis 283 <p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them above.'); ?></p>
mp-wp_genesis 284 <?php
mp-wp_genesis 285 }
mp-wp_genesis 286 ?>
mp-wp_genesis 287 <h5><?php _e('Order') ?></h5>
mp-wp_genesis 288 <p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
mp-wp_genesis 289 <p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&#8217;ll be better in future releases.)'); ?></p>
mp-wp_genesis 290 <?php
mp-wp_genesis 291 }
mp-wp_genesis 292 add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
mp-wp_genesis 293
mp-wp_genesis 294 /**
mp-wp_genesis 295 * Display custom field for page form fields.
mp-wp_genesis 296 *
mp-wp_genesis 297 * @since 2.6.0
mp-wp_genesis 298 *
mp-wp_genesis 299 * @param object $post
mp-wp_genesis 300 */
mp-wp_genesis 301 function page_custom_meta_box($post){
mp-wp_genesis 302 ?>
mp-wp_genesis 303 <div id="postcustomstuff">
mp-wp_genesis 304 <?php
mp-wp_genesis 305 $metadata = has_meta($post->ID);
mp-wp_genesis 306 list_meta($metadata);
mp-wp_genesis 307 meta_form();
mp-wp_genesis 308 ?>
mp-wp_genesis 309 <div id="ajax-response"></div>
mp-wp_genesis 310 </div>
mp-wp_genesis 311 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
mp-wp_genesis 312 <?php
mp-wp_genesis 313 }
mp-wp_genesis 314 add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 315
mp-wp_genesis 316 /**
mp-wp_genesis 317 * Display comments status form fields.
mp-wp_genesis 318 *
mp-wp_genesis 319 * @since 2.6.0
mp-wp_genesis 320 *
mp-wp_genesis 321 * @param object $post
mp-wp_genesis 322 */
mp-wp_genesis 323 function page_comments_status_meta_box($post){
mp-wp_genesis 324 ?>
mp-wp_genesis 325 <input name="advanced_view" type="hidden" value="1" />
mp-wp_genesis 326 <p><label for="comment_status" class="selectit">
mp-wp_genesis 327 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
mp-wp_genesis 328 <?php _e('Allow Comments') ?></label></p>
mp-wp_genesis 329 <p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
mp-wp_genesis 330 <p><?php _e('These settings apply to this page only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
mp-wp_genesis 331 <?php
mp-wp_genesis 332 }
mp-wp_genesis 333 add_meta_box('pagecommentstatusdiv', __('Discussion'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 334
mp-wp_genesis 335 /**
mp-wp_genesis 336 * Display page slug form fields.
mp-wp_genesis 337 *
mp-wp_genesis 338 * @since 2.6.0
mp-wp_genesis 339 *
mp-wp_genesis 340 * @param object $post
mp-wp_genesis 341 */
mp-wp_genesis 342 function page_slug_meta_box($post){
mp-wp_genesis 343 ?>
mp-wp_genesis 344 <label class="hidden" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
mp-wp_genesis 345 <?php
mp-wp_genesis 346 }
mp-wp_genesis 347 add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 348
mp-wp_genesis 349 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
mp-wp_genesis 350 if ( $post->post_author && !in_array($post->post_author, $authors) )
mp-wp_genesis 351 $authors[] = $post->post_author;
mp-wp_genesis 352 if ( $authors && count( $authors ) > 1 ) {
mp-wp_genesis 353 /**
mp-wp_genesis 354 * Display page author form fields, when more than one author exists.
mp-wp_genesis 355 *
mp-wp_genesis 356 * @since 2.6.0
mp-wp_genesis 357 *
mp-wp_genesis 358 * @param object $post
mp-wp_genesis 359 */
mp-wp_genesis 360 function page_author_meta_box($post){
mp-wp_genesis 361 global $current_user, $user_ID;
mp-wp_genesis 362 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
mp-wp_genesis 363 if ( $post->post_author && !in_array($post->post_author, $authors) )
mp-wp_genesis 364 $authors[] = $post->post_author;
mp-wp_genesis 365 ?>
mp-wp_genesis 366 <label class="hidden" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
mp-wp_genesis 367 <?php
mp-wp_genesis 368 }
mp-wp_genesis 369 add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 370 }
mp-wp_genesis 371
mp-wp_genesis 372 if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
mp-wp_genesis 373 /**
mp-wp_genesis 374 * Display list of page revisions.
mp-wp_genesis 375 *
mp-wp_genesis 376 * @since 2.6.0
mp-wp_genesis 377 *
mp-wp_genesis 378 * @param object $post
mp-wp_genesis 379 */
mp-wp_genesis 380 function page_revisions_meta_box($post) {
mp-wp_genesis 381 wp_list_post_revisions();
mp-wp_genesis 382 }
mp-wp_genesis 383 add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 384 endif;
mp-wp_genesis 385
mp-wp_genesis 386 do_action('do_meta_boxes', 'page', 'normal', $post);
mp-wp_genesis 387 do_action('do_meta_boxes', 'page', 'advanced', $post);
mp-wp_genesis 388 do_action('do_meta_boxes', 'page', 'side', $post);
mp-wp_genesis 389
mp-wp_genesis 390 require_once('admin-header.php');
mp-wp_genesis 391 ?>
mp-wp_genesis 392
mp-wp_genesis 393 <div class="wrap">
mp-wp_genesis 394 <?php screen_icon(); ?>
mp-wp_genesis 395 <h2><?php echo wp_specialchars( $title ); ?></h2>
mp-wp_genesis 396
mp-wp_genesis 397 <form name="post" action="page.php" method="post" id="post">
mp-wp_genesis 398 <?php if ( $notice ) : ?>
mp-wp_genesis 399 <div id="notice" class="error"><p><?php echo $notice ?></p></div>
mp-wp_genesis 400 <?php endif; ?>
mp-wp_genesis 401 <?php if (isset($_GET['message'])) : ?>
mp-wp_genesis 402 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
mp-wp_genesis 403 <?php endif; ?>
mp-wp_genesis 404
mp-wp_genesis 405 <?php
mp-wp_genesis 406 wp_nonce_field($nonce_action);
mp-wp_genesis 407
mp-wp_genesis 408 if (isset($mode) && 'bookmarklet' == $mode)
mp-wp_genesis 409 echo '<input type="hidden" name="mode" value="bookmarklet" />';
mp-wp_genesis 410 ?>
mp-wp_genesis 411 <input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
mp-wp_genesis 412 <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
mp-wp_genesis 413 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
mp-wp_genesis 414 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
mp-wp_genesis 415 <?php echo $form_extra ?>
mp-wp_genesis 416 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
mp-wp_genesis 417 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
mp-wp_genesis 418 <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
mp-wp_genesis 419 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
mp-wp_genesis 420
mp-wp_genesis 421 <div id="poststuff" class="metabox-holder">
mp-wp_genesis 422
mp-wp_genesis 423 <div id="side-info-column" class="inner-sidebar">
mp-wp_genesis 424
mp-wp_genesis 425 <?php
mp-wp_genesis 426
mp-wp_genesis 427 do_action('submitpage_box');
mp-wp_genesis 428 $side_meta_boxes = do_meta_boxes('page', 'side', $post);
mp-wp_genesis 429
mp-wp_genesis 430 ?>
mp-wp_genesis 431 </div>
mp-wp_genesis 432
mp-wp_genesis 433 <div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
mp-wp_genesis 434 <div id="post-body-content" class="has-sidebar-content">
mp-wp_genesis 435
mp-wp_genesis 436 <div id="titlediv">
mp-wp_genesis 437 <div id="titlewrap">
mp-wp_genesis 438 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" />
mp-wp_genesis 439 </div>
mp-wp_genesis 440 <div class="inside">
mp-wp_genesis 441 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
mp-wp_genesis 442 <div id="edit-slug-box">
mp-wp_genesis 443 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
mp-wp_genesis 444 echo $sample_permalink_html;
mp-wp_genesis 445 endif; ?>
mp-wp_genesis 446 </div>
mp-wp_genesis 447 </div>
mp-wp_genesis 448 </div>
mp-wp_genesis 449
mp-wp_genesis 450 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
mp-wp_genesis 451
mp-wp_genesis 452 <?php the_editor($post->post_content); ?>
mp-wp_genesis 453 <div id="post-status-info">
mp-wp_genesis 454 <span id="wp-word-count" class="alignleft"></span>
mp-wp_genesis 455 <span class="alignright">
mp-wp_genesis 456 <span id="autosave">&nbsp;</span>
mp-wp_genesis 457
mp-wp_genesis 458 <?php
mp-wp_genesis 459 if ($post_ID) {
mp-wp_genesis 460 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
mp-wp_genesis 461 $last_user = get_userdata($last_id);
mp-wp_genesis 462 printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
mp-wp_genesis 463 } else {
mp-wp_genesis 464 printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
mp-wp_genesis 465 }
mp-wp_genesis 466 }
mp-wp_genesis 467 ?>
mp-wp_genesis 468 </span>
mp-wp_genesis 469 <br class="clear" />
mp-wp_genesis 470 </div>
mp-wp_genesis 471
mp-wp_genesis 472 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
mp-wp_genesis 473 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
mp-wp_genesis 474 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
mp-wp_genesis 475 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
mp-wp_genesis 476 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
mp-wp_genesis 477 </div>
mp-wp_genesis 478
mp-wp_genesis 479 <?php
mp-wp_genesis 480
mp-wp_genesis 481 do_meta_boxes('page', 'normal', $post);
mp-wp_genesis 482 do_action('edit_page_form');
mp-wp_genesis 483 do_meta_boxes('page', 'advanced', $post);
mp-wp_genesis 484
mp-wp_genesis 485 ?>
mp-wp_genesis 486
mp-wp_genesis 487 </div>
mp-wp_genesis 488 </div>
mp-wp_genesis 489 </div>
mp-wp_genesis 490
mp-wp_genesis 491 </form>
mp-wp_genesis 492 </div>
mp-wp_genesis 493
mp-wp_genesis 494 <script type="text/javascript">
mp-wp_genesis 495 try{document.post.title.focus();}catch(e){}
mp-wp_genesis 496 </script>