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_remove-all-... 117 <div id="post-status-select">
mp-wp_genesis 118 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
mp-wp_genesis 119 <select name='post_status' id='post_status' tabindex='4'>
mp-wp_genesis 120 <?php if ( 'publish' == $post->post_status ) : ?>
mp-wp_genesis 121 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
mp-wp_genesis 122 <?php elseif ( 'private' == $post->post_status ) : ?>
mp-wp_genesis 123 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
mp-wp_genesis 124 <?php elseif ( 'future' == $post->post_status ) : ?>
mp-wp_genesis 125 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
mp-wp_genesis 126 <?php endif; ?>
mp-wp_genesis 127 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
mp-wp_genesis 128 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
mp-wp_genesis 129 </select>
mp-wp_genesis 130 </div>
mp-wp_genesis 131
mp-wp_genesis 132 <?php } ?>
mp-wp_genesis 133 </div><?php // /misc-pub-section ?>
mp-wp_genesis 134
mp-wp_genesis 135 <div class="misc-pub-section " id="visibility">
mp-wp_genesis 136 <?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
mp-wp_genesis 137
mp-wp_genesis 138 if ( 'private' == $post->post_status ) {
mp-wp_genesis 139 $post->post_password = '';
mp-wp_genesis 140 $visibility = 'private';
mp-wp_genesis 141 $visibility_trans = __('Private');
mp-wp_genesis 142 } elseif ( !empty( $post->post_password ) ) {
mp-wp_genesis 143 $visibility = 'password';
mp-wp_genesis 144 $visibility_trans = __('Password protected');
mp-wp_genesis 145 } else {
mp-wp_genesis 146 $visibility = 'public';
mp-wp_genesis 147 $visibility_trans = __('Public');
mp-wp_genesis 148 }
mp-wp_genesis 149
mp-wp_remove-all-... 150 ?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?>
mp-wp_remove-all-... 151 <div id="post-visibility-select">
mp-wp_genesis 152 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
mp-wp_genesis 153 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
mp-wp_genesis 154
mp-wp_genesis 155
mp-wp_genesis 156 <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 157 <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 158 <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 159 <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 160 </div>
mp-wp_genesis 161 <?php } ?>
mp-wp_genesis 162
mp-wp_genesis 163 </div><?php // /misc-pub-section ?>
mp-wp_genesis 164
mp-wp_genesis 165 <?php
mp-wp_genesis 166 $datef = _c( 'M j, Y @ G:i|Publish box date format');
mp-wp_genesis 167 if ( 0 != $post->ID ) {
mp-wp_genesis 168 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
mp-wp_genesis 169 $stamp = __('Scheduled for: <b>%1$s</b>');
mp-wp_genesis 170 } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
mp-wp_genesis 171 $stamp = __('Published on: <b>%1$s</b>');
mp-wp_genesis 172 } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
mp-wp_genesis 173 $stamp = __('Publish <b>immediately</b>');
mp-wp_genesis 174 } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
mp-wp_genesis 175 $stamp = __('Schedule for: <b>%1$s</b>');
mp-wp_genesis 176 } else { // draft, 1 or more saves, date specified
mp-wp_genesis 177 $stamp = __('Publish on: <b>%1$s</b>');
mp-wp_genesis 178 }
mp-wp_genesis 179 $date = date_i18n( $datef, strtotime( $post->post_date ) );
mp-wp_genesis 180 } else { // draft (no saves, and thus no date specified)
mp-wp_genesis 181 $stamp = __('Publish <b>immediately</b>');
mp-wp_genesis 182 $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
mp-wp_genesis 183 }
mp-wp_genesis 184 ?>
mp-wp_genesis 185 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
mp-wp_genesis 186 <div class="misc-pub-section curtime misc-pub-section-last">
mp-wp_remove-all-... 187 <span id="timestamp"><?php printf($stamp, $date); ?></span>
mp-wp_remove-all-... 188 <div id="timestampdiv"><?php touch_time(($action == 'edit'),1,4); ?></div>
mp-wp_genesis 189 </div><?php // /misc-pub-section ?>
mp-wp_genesis 190 <?php endif; ?>
mp-wp_genesis 191
mp-wp_genesis 192 </div>
mp-wp_genesis 193 <div class="clear"></div>
mp-wp_genesis 194 </div>
mp-wp_genesis 195
mp-wp_genesis 196 <div id="major-publishing-actions">
mp-wp_genesis 197 <?php do_action('post_submitbox_start'); ?>
mp-wp_genesis 198 <div id="delete-action">
mp-wp_genesis 199 <?php
mp-wp_genesis 200 if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
mp-wp_remove-all-... 201 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&amp;post=$post->ID", 'delete-page_' . $post->ID); ?>"><?php _e('Delete'); ?></a>
mp-wp_genesis 202 <?php } ?>
mp-wp_genesis 203 </div>
mp-wp_genesis 204
mp-wp_genesis 205 <div id="publishing-action">
mp-wp_genesis 206 <?php
mp-wp_genesis 207 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
mp-wp_genesis 208 <?php if ( $can_publish ) : ?>
mp-wp_genesis 209 <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
mp-wp_genesis 210 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
mp-wp_genesis 211 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
mp-wp_genesis 212 <?php else : ?>
mp-wp_genesis 213 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
mp-wp_genesis 214 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
mp-wp_genesis 215 <?php endif; ?>
mp-wp_genesis 216 <?php else : ?>
mp-wp_genesis 217 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
mp-wp_genesis 218 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
mp-wp_genesis 219 <?php endif; ?>
mp-wp_genesis 220 <?php } else { ?>
mp-wp_genesis 221 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Page') ?>" />
mp-wp_genesis 222 <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Page') ?>" />
mp-wp_genesis 223 <?php } ?>
mp-wp_genesis 224 </div>
mp-wp_genesis 225 <div class="clear"></div>
mp-wp_genesis 226 </div>
mp-wp_genesis 227 </div>
mp-wp_genesis 228 <?php
mp-wp_genesis 229 }
mp-wp_genesis 230 add_meta_box('pagesubmitdiv', __('Publish'), 'page_submit_meta_box', 'page', 'side', 'core');
mp-wp_genesis 231
mp-wp_genesis 232 /**
mp-wp_genesis 233 * Display page password form fields.
mp-wp_genesis 234 *
mp-wp_genesis 235 * @since 2.6.0
mp-wp_genesis 236 *
mp-wp_genesis 237 * @param object $post
mp-wp_genesis 238 */
mp-wp_genesis 239 function page_password_meta_box($post){
mp-wp_genesis 240 ?>
mp-wp_genesis 241 <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 242 <h4><?php _e( 'Page Password' ); ?></h4>
mp-wp_genesis 243 <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 244 <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 245 <?php
mp-wp_genesis 246 }
mp-wp_genesis 247 // add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
mp-wp_genesis 248
mp-wp_genesis 249 /**
mp-wp_genesis 250 * Display page attributes form fields.
mp-wp_genesis 251 *
mp-wp_genesis 252 * @since 2.7.0
mp-wp_genesis 253 *
mp-wp_genesis 254 * @param object $post
mp-wp_genesis 255 */
mp-wp_genesis 256 function page_attributes_meta_box($post){
mp-wp_genesis 257 ?>
mp-wp_genesis 258 <h5><?php _e('Parent') ?></h5>
mp-wp_genesis 259 <label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
mp-wp_genesis 260 <?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 261 <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 262 <?php
mp-wp_genesis 263 if ( 0 != count( get_page_templates() ) ) {
mp-wp_genesis 264 ?>
mp-wp_genesis 265 <h5><?php _e('Template') ?></h5>
mp-wp_genesis 266 <label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
mp-wp_genesis 267 <option value='default'><?php _e('Default Template'); ?></option>
mp-wp_genesis 268 <?php page_template_dropdown($post->page_template); ?>
mp-wp_genesis 269 </select>
mp-wp_genesis 270 <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 271 <?php
mp-wp_genesis 272 }
mp-wp_genesis 273 ?>
mp-wp_genesis 274 <h5><?php _e('Order') ?></h5>
mp-wp_genesis 275 <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 276 <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 277 <?php
mp-wp_genesis 278 }
mp-wp_genesis 279 add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
mp-wp_genesis 280
mp-wp_genesis 281 /**
mp-wp_genesis 282 * Display custom field for page form fields.
mp-wp_genesis 283 *
mp-wp_genesis 284 * @since 2.6.0
mp-wp_genesis 285 *
mp-wp_genesis 286 * @param object $post
mp-wp_genesis 287 */
mp-wp_genesis 288 function page_custom_meta_box($post){
mp-wp_genesis 289 ?>
mp-wp_genesis 290 <div id="postcustomstuff">
mp-wp_genesis 291 <?php
mp-wp_genesis 292 $metadata = has_meta($post->ID);
mp-wp_genesis 293 list_meta($metadata);
mp-wp_genesis 294 meta_form();
mp-wp_genesis 295 ?>
mp-wp_genesis 296 </div>
mp-wp_genesis 297 <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 298 <?php
mp-wp_genesis 299 }
mp-wp_genesis 300 add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 301
mp-wp_genesis 302 /**
mp-wp_genesis 303 * Display comments status form fields.
mp-wp_genesis 304 *
mp-wp_genesis 305 * @since 2.6.0
mp-wp_genesis 306 *
mp-wp_genesis 307 * @param object $post
mp-wp_genesis 308 */
mp-wp_genesis 309 function page_comments_status_meta_box($post){
mp-wp_genesis 310 ?>
mp-wp_genesis 311 <input name="advanced_view" type="hidden" value="1" />
mp-wp_genesis 312 <p><label for="comment_status" class="selectit">
mp-wp_genesis 313 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
mp-wp_genesis 314 <?php _e('Allow Comments') ?></label></p>
mp-wp_genesis 315 <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 316 <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 317 <?php
mp-wp_genesis 318 }
mp-wp_genesis 319 add_meta_box('pagecommentstatusdiv', __('Discussion'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 320
mp-wp_genesis 321 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
mp-wp_genesis 322 if ( $post->post_author && !in_array($post->post_author, $authors) )
mp-wp_genesis 323 $authors[] = $post->post_author;
mp-wp_genesis 324 if ( $authors && count( $authors ) > 1 ) {
mp-wp_genesis 325 /**
mp-wp_genesis 326 * Display page author form fields, when more than one author exists.
mp-wp_genesis 327 *
mp-wp_genesis 328 * @since 2.6.0
mp-wp_genesis 329 *
mp-wp_genesis 330 * @param object $post
mp-wp_genesis 331 */
mp-wp_genesis 332 function page_author_meta_box($post){
mp-wp_genesis 333 global $current_user, $user_ID;
mp-wp_genesis 334 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
mp-wp_genesis 335 if ( $post->post_author && !in_array($post->post_author, $authors) )
mp-wp_genesis 336 $authors[] = $post->post_author;
mp-wp_genesis 337 ?>
mp-wp_genesis 338 <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 339 <?php
mp-wp_genesis 340 }
mp-wp_genesis 341 add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 342 }
mp-wp_genesis 343
mp-wp_genesis 344 if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
mp-wp_genesis 345 /**
mp-wp_genesis 346 * Display list of page revisions.
mp-wp_genesis 347 *
mp-wp_genesis 348 * @since 2.6.0
mp-wp_genesis 349 *
mp-wp_genesis 350 * @param object $post
mp-wp_genesis 351 */
mp-wp_genesis 352 function page_revisions_meta_box($post) {
mp-wp_genesis 353 wp_list_post_revisions();
mp-wp_genesis 354 }
mp-wp_genesis 355 add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core');
mp-wp_genesis 356 endif;
mp-wp_genesis 357
mp-wp_genesis 358 do_action('do_meta_boxes', 'page', 'normal', $post);
mp-wp_genesis 359 do_action('do_meta_boxes', 'page', 'advanced', $post);
mp-wp_genesis 360 do_action('do_meta_boxes', 'page', 'side', $post);
mp-wp_genesis 361
mp-wp_genesis 362 require_once('admin-header.php');
mp-wp_genesis 363 ?>
mp-wp_genesis 364
mp-wp_genesis 365 <div class="wrap">
mp-wp_genesis 366 <?php screen_icon(); ?>
mp-wp_genesis 367 <h2><?php echo wp_specialchars( $title ); ?></h2>
mp-wp_genesis 368
mp-wp_genesis 369 <form name="post" action="page.php" method="post" id="post">
mp-wp_genesis 370 <?php if ( $notice ) : ?>
mp-wp_genesis 371 <div id="notice" class="error"><p><?php echo $notice ?></p></div>
mp-wp_genesis 372 <?php endif; ?>
mp-wp_genesis 373 <?php if (isset($_GET['message'])) : ?>
mp-wp_genesis 374 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
mp-wp_genesis 375 <?php endif; ?>
mp-wp_genesis 376
mp-wp_genesis 377 <?php
mp-wp_genesis 378 wp_nonce_field($nonce_action);
mp-wp_genesis 379
mp-wp_genesis 380 if (isset($mode) && 'bookmarklet' == $mode)
mp-wp_genesis 381 echo '<input type="hidden" name="mode" value="bookmarklet" />';
mp-wp_genesis 382 ?>
mp-wp_genesis 383 <input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
mp-wp_genesis 384 <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
mp-wp_genesis 385 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
mp-wp_genesis 386 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
mp-wp_genesis 387 <?php echo $form_extra ?>
mp-wp_genesis 388 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
mp-wp_genesis 389 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
mp-wp_genesis 390 <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
mp-wp_genesis 391 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
mp-wp_genesis 392
mp-wp_genesis 393 <div id="poststuff" class="metabox-holder">
mp-wp_genesis 394
mp-wp_genesis 395 <div id="side-info-column" class="inner-sidebar">
mp-wp_genesis 396
mp-wp_genesis 397 <?php
mp-wp_genesis 398
mp-wp_genesis 399 do_action('submitpage_box');
mp-wp_genesis 400 $side_meta_boxes = do_meta_boxes('page', 'side', $post);
mp-wp_genesis 401
mp-wp_genesis 402 ?>
mp-wp_genesis 403 </div>
mp-wp_genesis 404
mp-wp_genesis 405 <div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
mp-wp_genesis 406 <div id="post-body-content" class="has-sidebar-content">
mp-wp_genesis 407
mp-wp_genesis 408 <div id="titlediv">
mp-wp_genesis 409 <div id="titlewrap">
mp-wp_genesis 410 <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 411 </div>
mp-wp_genesis 412 <div class="inside">
mp-wp_genesis 413 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
mp-wp_genesis 414 <div id="edit-slug-box">
mp-wp_genesis 415 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
mp-wp_genesis 416 echo $sample_permalink_html;
mp-wp_genesis 417 endif; ?>
mp-wp_genesis 418 </div>
mp-wp_genesis 419 </div>
mp-wp_genesis 420 </div>
mp-wp_genesis 421
mp-wp_remove-tiny... 422 <div id="postdiv" class="postarea">
mp-wp_genesis 423
mp-wp_genesis 424 <?php the_editor($post->post_content); ?>
mp-wp_genesis 425 <div id="post-status-info">
mp-wp_genesis 426 <span id="wp-word-count" class="alignleft"></span>
mp-wp_genesis 427 <span class="alignright">
mp-wp_genesis 428 <span id="autosave">&nbsp;</span>
mp-wp_genesis 429
mp-wp_genesis 430 <?php
mp-wp_genesis 431 if ($post_ID) {
mp-wp_genesis 432 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
mp-wp_genesis 433 $last_user = get_userdata($last_id);
mp-wp_genesis 434 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 435 } else {
mp-wp_genesis 436 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 437 }
mp-wp_genesis 438 }
mp-wp_genesis 439 ?>
mp-wp_genesis 440 </span>
mp-wp_genesis 441 <br class="clear" />
mp-wp_genesis 442 </div>
mp-wp_genesis 443
mp-wp_genesis 444 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
mp-wp_genesis 445 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
mp-wp_genesis 446 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
mp-wp_genesis 447 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
mp-wp_genesis 448 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
mp-wp_genesis 449 </div>
mp-wp_genesis 450
mp-wp_genesis 451 <?php
mp-wp_genesis 452
mp-wp_genesis 453 do_meta_boxes('page', 'normal', $post);
mp-wp_genesis 454 do_action('edit_page_form');
mp-wp_genesis 455 do_meta_boxes('page', 'advanced', $post);
mp-wp_genesis 456
mp-wp_genesis 457 ?>
mp-wp_genesis 458
mp-wp_genesis 459 </div>
mp-wp_genesis 460 </div>
mp-wp_genesis 461 </div>
mp-wp_genesis 462
mp-wp_genesis 463 </form>
mp-wp_genesis 464 </div>