<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[11816] trunk/wp-admin/includes/meta-boxes.php: Add the new file too.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/11816">11816</a></dd>
<dt>Author</dt> <dd>westi</dd>
<dt>Date</dt> <dd>2009-08-14 18:58:22 +0000 (Fri, 14 Aug 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add the new file too.</pre>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmetaboxesphp">trunk/wp-admin/includes/meta-boxes.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmetaboxesphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/includes/meta-boxes.php (0 => 11816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php                                (rev 0)
+++ trunk/wp-admin/includes/meta-boxes.php        2009-08-14 18:58:22 UTC (rev 11816)
</span><span class="lines">@@ -0,0 +1,805 @@
</span><ins>+&lt;?php
+
+// -- Post related Meta Boxes
+
+/**
+ * Display post submit form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function post_submit_meta_box($post) {
+        global $action;
+
+        $post_type = $post-&gt;post_type;
+        $can_publish = current_user_can(&quot;publish_${post_type}s&quot;);
+?&gt;
+&lt;div class=&quot;submitbox&quot; id=&quot;submitpost&quot;&gt;
+
+&lt;div id=&quot;minor-publishing&quot;&gt;
+
+&lt;?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?&gt;
+&lt;div style=&quot;display:none;&quot;&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php esc_attr_e('Save'); ?&gt;&quot; /&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;minor-publishing-actions&quot;&gt;
+&lt;div id=&quot;save-action&quot;&gt;
+&lt;?php if ( 'publish' != $post-&gt;post_status &amp;&amp; 'future' != $post-&gt;post_status &amp;&amp; 'pending' != $post-&gt;post_status )  { ?&gt;
+&lt;input &lt;?php if ( 'private' == $post-&gt;post_status ) { ?&gt;style=&quot;display:none&quot;&lt;?php } ?&gt; type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; value=&quot;&lt;?php esc_attr_e('Save Draft'); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
+&lt;?php } elseif ( 'pending' == $post-&gt;post_status &amp;&amp; $can_publish ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; value=&quot;&lt;?php esc_attr_e('Save as Pending'); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;preview-action&quot;&gt;
+&lt;?php
+if ( 'publish' == $post-&gt;post_status ) {
+        $preview_link = esc_url(get_permalink($post-&gt;ID));
+        $preview_button = __('Preview Changes');
+} else {
+        $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post-&gt;ID))));
+        $preview_button = __('Preview');
+}
+?&gt;
+&lt;a class=&quot;preview button&quot; href=&quot;&lt;?php echo $preview_link; ?&gt;&quot; target=&quot;wp-preview&quot; id=&quot;post-preview&quot; tabindex=&quot;4&quot;&gt;&lt;?php echo $preview_button; ?&gt;&lt;/a&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;wp-preview&quot; id=&quot;wp-preview&quot; value=&quot;&quot; /&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;&lt;?php // /minor-publishing-actions ?&gt;
+
+&lt;div id=&quot;misc-publishing-actions&quot;&gt;
+
+&lt;div class=&quot;misc-pub-section&lt;?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?&gt;&quot;&gt;&lt;label for=&quot;post_status&quot;&gt;&lt;?php _e('Status:') ?&gt;&lt;/label&gt;
+&lt;span id=&quot;post-status-display&quot;&gt;
+&lt;?php
+switch ( $post-&gt;post_status ) {
+        case 'private':
+                _e('Privately Published');
+                break;
+        case 'publish':
+                _e('Published');
+                break;
+        case 'future':
+                _e('Scheduled');
+                break;
+        case 'pending':
+                _e('Pending Review');
+                break;
+        case 'draft':
+                _e('Draft');
+                break;
+}
+?&gt;
+&lt;/span&gt;
+&lt;?php if ( 'publish' == $post-&gt;post_status || 'private' == $post-&gt;post_status || $can_publish ) { ?&gt;
+&lt;a href=&quot;#post_status&quot; &lt;?php if ( 'private' == $post-&gt;post_status ) { ?&gt;style=&quot;display:none;&quot; &lt;?php } ?&gt;class=&quot;edit-post-status hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;
+
+&lt;div id=&quot;post-status-select&quot; class=&quot;hide-if-js&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_status&quot; id=&quot;hidden_post_status&quot; value=&quot;&lt;?php echo esc_attr($post-&gt;post_status); ?&gt;&quot; /&gt;
+&lt;select name='post_status' id='post_status' tabindex='4'&gt;
+&lt;?php if ( 'publish' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'publish' ); ?&gt; value='publish'&gt;&lt;?php _e('Published') ?&gt;&lt;/option&gt;
+&lt;?php elseif ( 'private' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'private' ); ?&gt; value='publish'&gt;&lt;?php _e('Privately Published') ?&gt;&lt;/option&gt;
+&lt;?php elseif ( 'future' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'future' ); ?&gt; value='future'&gt;&lt;?php _e('Scheduled') ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'pending' ); ?&gt; value='pending'&gt;&lt;?php _e('Pending Review') ?&gt;&lt;/option&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'draft' ); ?&gt; value='draft'&gt;&lt;?php _e('Draft') ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+ &lt;a href=&quot;#post_status&quot; class=&quot;save-post-status hide-if-no-js button&quot;&gt;&lt;?php _e('OK'); ?&gt;&lt;/a&gt;
+ &lt;a href=&quot;#post_status&quot; class=&quot;cancel-post-status hide-if-no-js&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+&lt;/div&gt;
+
+&lt;?php } ?&gt;
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
+
+&lt;div class=&quot;misc-pub-section &quot; id=&quot;visibility&quot;&gt;
+&lt;?php _e('Visibility:'); ?&gt; &lt;span id=&quot;post-visibility-display&quot;&gt;&lt;?php
+
+if ( 'private' == $post-&gt;post_status ) {
+        $post-&gt;post_password = '';
+        $visibility = 'private';
+        $visibility_trans = __('Private');
+} elseif ( !empty( $post-&gt;post_password ) ) {
+        $visibility = 'password';
+        $visibility_trans = __('Password protected');
+} elseif ( $post_type == 'post' &amp;&amp; is_sticky( $post-&gt;ID ) ) {
+        $visibility = 'public';
+        $visibility_trans = __('Public, Sticky');
+} else {
+        $visibility = 'public';
+        $visibility_trans = __('Public');
+}
+
+echo esc_html( $visibility_trans ); ?&gt;&lt;/span&gt;
+&lt;?php if ( $can_publish ) { ?&gt;
+&lt;a href=&quot;#visibility&quot; class=&quot;edit-visibility hide-if-no-js&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/a&gt;
+
+&lt;div id=&quot;post-visibility-select&quot; class=&quot;hide-if-js&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_password&quot; id=&quot;hidden-post-password&quot; value=&quot;&lt;?php echo esc_attr($post-&gt;post_password); ?&gt;&quot; /&gt;
+&lt;?php if ($post_type == 'post'): ?&gt;
+&lt;input type=&quot;checkbox&quot; style=&quot;display:none&quot; name=&quot;hidden_post_sticky&quot; id=&quot;hidden-post-sticky&quot; value=&quot;sticky&quot; &lt;?php checked(is_sticky($post-&gt;ID)); ?&gt; /&gt;
+&lt;?php endif; ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_visibility&quot; id=&quot;hidden-post-visibility&quot; value=&quot;&lt;?php echo esc_attr( $visibility ); ?&gt;&quot; /&gt;
+
+
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-public&quot; value=&quot;public&quot; &lt;?php checked( $visibility, 'public' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-public&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Public'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;?php if ($post_type == 'post'): ?&gt;
+&lt;span id=&quot;sticky-span&quot;&gt;&lt;input id=&quot;sticky&quot; name=&quot;sticky&quot; type=&quot;checkbox&quot; value=&quot;sticky&quot; &lt;?php checked(is_sticky($post-&gt;ID)); ?&gt; tabindex=&quot;4&quot; /&gt; &lt;label for=&quot;sticky&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Stick this post to the front page') ?&gt;&lt;/label&gt;&lt;br /&gt;&lt;/span&gt;
+&lt;?php endif; ?&gt;
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-password&quot; value=&quot;password&quot; &lt;?php checked( $visibility, 'password' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-password&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Password protected'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;span id=&quot;password-span&quot;&gt;&lt;label for=&quot;post_password&quot;&gt;&lt;?php _e('Password:'); ?&gt;&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;post_password&quot; id=&quot;post_password&quot; value=&quot;&lt;?php echo esc_attr($post-&gt;post_password); ?&gt;&quot; /&gt;&lt;br /&gt;&lt;/span&gt;
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-private&quot; value=&quot;private&quot; &lt;?php checked( $visibility, 'private' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-private&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Private'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+
+&lt;p&gt;
+ &lt;a href=&quot;#visibility&quot; class=&quot;save-post-visibility hide-if-no-js button&quot;&gt;&lt;?php _e('OK'); ?&gt;&lt;/a&gt;
+ &lt;a href=&quot;#visibility&quot; class=&quot;cancel-post-visibility hide-if-no-js&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+&lt;/p&gt;
+&lt;/div&gt;
+&lt;?php } ?&gt;
+
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
+
+
+&lt;?php
+// translators: Publish box date formt, see http://php.net/date
+$datef = __( 'M j, Y @ G:i' );
+if ( 0 != $post-&gt;ID ) {
+        if ( 'future' == $post-&gt;post_status ) { // scheduled for publishing at a future date
+                $stamp = __('Scheduled for: &lt;b&gt;%1$s&lt;/b&gt;');
+        } else if ( 'publish' == $post-&gt;post_status || 'private' == $post-&gt;post_status ) { // already published
+                $stamp = __('Published on: &lt;b&gt;%1$s&lt;/b&gt;');
+        } else if ( '0000-00-00 00:00:00' == $post-&gt;post_date_gmt ) { // draft, 1 or more saves, no date specified
+                $stamp = __('Publish &lt;b&gt;immediately&lt;/b&gt;');
+        } else if ( time() &lt; strtotime( $post-&gt;post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
+                $stamp = __('Schedule for: &lt;b&gt;%1$s&lt;/b&gt;');
+        } else { // draft, 1 or more saves, date specified
+                $stamp = __('Publish on: &lt;b&gt;%1$s&lt;/b&gt;');
+        }
+        $date = date_i18n( $datef, strtotime( $post-&gt;post_date ) );
+} else { // draft (no saves, and thus no date specified)
+        $stamp = __('Publish &lt;b&gt;immediately&lt;/b&gt;');
+        $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
+}
+
+if ( $can_publish ) : // Contributors don't get to choose the date of publish ?&gt;
+&lt;div class=&quot;misc-pub-section curtime misc-pub-section-last&quot;&gt;
+        &lt;span id=&quot;timestamp&quot;&gt;
+        &lt;?php printf($stamp, $date); ?&gt;&lt;/span&gt;
+        &lt;a href=&quot;#edit_timestamp&quot; class=&quot;edit-timestamp hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;
+        &lt;div id=&quot;timestampdiv&quot; class=&quot;hide-if-js&quot;&gt;&lt;?php touch_time(($action == 'edit'),1,4); ?&gt;&lt;/div&gt;
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
+&lt;?php endif; ?&gt;
+
+&lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;major-publishing-actions&quot;&gt;
+&lt;?php do_action('post_submitbox_start'); ?&gt;
+&lt;div id=&quot;delete-action&quot;&gt;
+&lt;?php
+if ( ( 'edit' == $action ) &amp;&amp; current_user_can(&quot;delete_${post_type}&quot;, $post-&gt;ID) ) { ?&gt;
+&lt;?php $delete_url = add_query_arg( array('action'=&gt;'trash', 'post'=&gt;$post-&gt;ID) ); ?&gt;
+&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url($delete_url, &quot;trash-${post_type}_&quot; . $post-&gt;ID); ?&gt;&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/a&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;publishing-action&quot;&gt;
+&lt;?php
+if ( !in_array( $post-&gt;post_status, array('publish', 'future', 'private') ) || 0 == $post-&gt;ID ) {
+        if ( $can_publish ) :
+                if ( !empty($post-&gt;post_date_gmt) &amp;&amp; time() &lt; strtotime( $post-&gt;post_date_gmt . ' +0000' ) ) : ?&gt;
+                &lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php esc_attr_e('Schedule') ?&gt;&quot; /&gt;
+                &lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php esc_attr_e('Schedule') ?&gt;&quot; /&gt;
+&lt;?php        else : ?&gt;
+                &lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php esc_attr_e('Publish') ?&gt;&quot; /&gt;
+                &lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php esc_attr_e('Publish') ?&gt;&quot; /&gt;
+&lt;?php        endif;
+        else : ?&gt;
+                &lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php esc_attr_e('Submit for Review') ?&gt;&quot; /&gt;
+                &lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php esc_attr_e('Submit for Review') ?&gt;&quot; /&gt;
+&lt;?php
+        endif;
+} else { ?&gt;
+                &lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php esc_attr_e('Update') ?&gt;&quot; /&gt;
+                &lt;input name=&quot;save&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php esc_attr_e('Update') ?&gt;&quot; /&gt;
+&lt;?php
+} ?&gt;
+&lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;?php
+}
+
+
+/**
+ * Display post tags form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_tags_meta_box($post, $box) {
+        $tax_name = esc_attr(substr($box['id'], 8));
+        $taxonomy = get_taxonomy($tax_name);
+        $helps = isset($taxonomy-&gt;helps) ? esc_attr($taxonomy-&gt;helps) : __('Separate tags with commas.');
+?&gt;
+&lt;div class=&quot;tagsdiv&quot; id=&quot;&lt;?php echo $tax_name; ?&gt;&quot;&gt;
+        &lt;div class=&quot;jaxtag&quot;&gt;
+        &lt;div class=&quot;nojs-tags hide-if-js&quot;&gt;
+        &lt;p&gt;&lt;?php _e('Add or remove tags'); ?&gt;&lt;/p&gt;
+        &lt;textarea name=&quot;&lt;?php echo &quot;tax_input[$tax_name]&quot;; ?&gt;&quot; class=&quot;the-tags&quot; id=&quot;tax-input[&lt;?php echo $tax_name; ?&gt;]&quot;&gt;&lt;?php echo esc_attr(get_terms_to_edit( $post-&gt;ID, $tax_name )); ?&gt;&lt;/textarea&gt;&lt;/div&gt;
+
+        &lt;span class=&quot;ajaxtag hide-if-no-js&quot;&gt;
+                &lt;label class=&quot;screen-reader-text&quot; for=&quot;new-tag-&lt;?php echo $tax_name; ?&gt;&quot;&gt;&lt;?php echo $box['title']; ?&gt;&lt;/label&gt;
+                &lt;input type=&quot;text&quot; id=&quot;new-tag-&lt;?php echo $tax_name; ?&gt;&quot; name=&quot;newtag[&lt;?php echo $tax_name; ?&gt;]&quot; class=&quot;newtag form-input-tip&quot; size=&quot;16&quot; autocomplete=&quot;off&quot; value=&quot;&lt;?php esc_attr_e('Add new tag'); ?&gt;&quot; /&gt;
+                &lt;input type=&quot;button&quot; class=&quot;button tagadd&quot; value=&quot;&lt;?php esc_attr_e('Add'); ?&gt;&quot; tabindex=&quot;3&quot; /&gt;
+        &lt;/span&gt;&lt;/div&gt;
+        &lt;p class=&quot;howto&quot;&gt;&lt;?php echo $helps; ?&gt;&lt;/p&gt;
+        &lt;div class=&quot;tagchecklist&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;p class=&quot;tagcloud-link hide-if-no-js&quot;&gt;&lt;a href=&quot;#titlediv&quot; class=&quot;tagcloud-link&quot; id=&quot;link-&lt;?php echo $tax_name; ?&gt;&quot;&gt;&lt;?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?&gt;&lt;/a&gt;&lt;/p&gt;
+&lt;?php
+}
+
+
+/**
+ * Display post categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_categories_meta_box($post) {
+?&gt;
+&lt;ul id=&quot;category-tabs&quot;&gt;
+        &lt;li class=&quot;tabs&quot;&gt;&lt;a href=&quot;#categories-all&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( 'All Categories' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
+        &lt;li class=&quot;hide-if-no-js&quot;&gt;&lt;a href=&quot;#categories-pop&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( 'Most Used' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
+&lt;/ul&gt;
+
+&lt;div id=&quot;categories-pop&quot; class=&quot;tabs-panel&quot; style=&quot;display: none;&quot;&gt;
+        &lt;ul id=&quot;categorychecklist-pop&quot; class=&quot;categorychecklist form-no-clear&quot; &gt;
+&lt;?php $popular_ids = wp_popular_terms_checklist('category'); ?&gt;
+        &lt;/ul&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;categories-all&quot; class=&quot;tabs-panel&quot;&gt;
+        &lt;ul id=&quot;categorychecklist&quot; class=&quot;list:category categorychecklist form-no-clear&quot;&gt;
+&lt;?php wp_category_checklist($post-&gt;ID, false, false, $popular_ids) ?&gt;
+        &lt;/ul&gt;
+&lt;/div&gt;
+
+&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
+&lt;div id=&quot;category-adder&quot; class=&quot;wp-hidden-children&quot;&gt;
+        &lt;h4&gt;&lt;a id=&quot;category-add-toggle&quot; href=&quot;#category-add&quot; class=&quot;hide-if-no-js&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( '+ Add New Category' ); ?&gt;&lt;/a&gt;&lt;/h4&gt;
+        &lt;p id=&quot;category-add&quot; class=&quot;wp-hidden-child&quot;&gt;
+        &lt;label class=&quot;screen-reader-text&quot; for=&quot;newcat&quot;&gt;&lt;?php _e( 'Add New Category' ); ?&gt;&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;newcat&quot; id=&quot;newcat&quot; class=&quot;form-required form-input-tip&quot; value=&quot;&lt;?php esc_attr_e( 'New category name' ); ?&gt;&quot; tabindex=&quot;3&quot; aria-required=&quot;true&quot;/&gt;
+        &lt;label class=&quot;screen-reader-text&quot; for=&quot;newcat_parent&quot;&gt;&lt;?php _e('Parent category'); ?&gt;:&lt;/label&gt;&lt;?php wp_dropdown_categories( array( 'hide_empty' =&gt; 0, 'name' =&gt; 'newcat_parent', 'orderby' =&gt; 'name', 'hierarchical' =&gt; 1, 'show_option_none' =&gt; __('Parent category'), 'tab_index' =&gt; 3 ) ); ?&gt;
+        &lt;input type=&quot;button&quot; id=&quot;category-add-sumbit&quot; class=&quot;add:categorychecklist:category-add button&quot; value=&quot;&lt;?php esc_attr_e( 'Add' ); ?&gt;&quot; tabindex=&quot;3&quot; /&gt;
+&lt;?php        wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?&gt;
+        &lt;span id=&quot;category-ajax-response&quot;&gt;&lt;/span&gt;&lt;/p&gt;
+&lt;/div&gt;
+&lt;?php
+endif;
+
+}
+
+
+/**
+ * Display post excerpt form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_excerpt_meta_box($post) {
+?&gt;
+&lt;label class=&quot;screen-reader-text&quot; for=&quot;excerpt&quot;&gt;&lt;?php _e('Excerpt') ?&gt;&lt;/label&gt;&lt;textarea rows=&quot;1&quot; cols=&quot;40&quot; name=&quot;excerpt&quot; tabindex=&quot;6&quot; id=&quot;excerpt&quot;&gt;&lt;?php echo $post-&gt;post_excerpt ?&gt;&lt;/textarea&gt;
+&lt;p&gt;&lt;?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. &lt;a href=&quot;http://codex.wordpress.org/Excerpt&quot; target=&quot;_blank&quot;&gt;Learn more about manual excerpts.&lt;/a&gt;'); ?&gt;&lt;/p&gt;
+&lt;?php
+}
+
+
+/**
+ * Display trackback links form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_trackback_meta_box($post) {
+        $form_trackback = '&lt;input type=&quot;text&quot; name=&quot;trackback_url&quot; id=&quot;trackback_url&quot; class=&quot;code&quot; tabindex=&quot;7&quot; value=&quot;'. esc_attr( str_replace(&quot;\n&quot;, ' ', $post-&gt;to_ping) ) .'&quot; /&gt;';
+        if ('' != $post-&gt;pinged) {
+                $pings = '&lt;p&gt;'. __('Already pinged:') . '&lt;/p&gt;&lt;ul&gt;';
+                $already_pinged = explode(&quot;\n&quot;, trim($post-&gt;pinged));
+                foreach ($already_pinged as $pinged_url) {
+                        $pings .= &quot;\n\t&lt;li&gt;&quot; . esc_html($pinged_url) . &quot;&lt;/li&gt;&quot;;
+                }
+                $pings .= '&lt;/ul&gt;';
+        }
+
+?&gt;
+&lt;p&gt;&lt;label for=&quot;trackback_url&quot;&gt;&lt;?php _e('Send trackbacks to:'); ?&gt;&lt;/label&gt; &lt;?php echo $form_trackback; ?&gt;&lt;br /&gt; (&lt;?php _e('Separate multiple URLs with spaces'); ?&gt;)&lt;/p&gt;
+&lt;p&gt;&lt;?php _e('Trackbacks are a way to notify legacy blog systems that you&amp;#8217;ve linked to them. If you link other WordPress blogs they&amp;#8217;ll be notified automatically using &lt;a href=&quot;http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments&quot; target=&quot;_blank&quot;&gt;pingbacks&lt;/a&gt;, no other action necessary.'); ?&gt;&lt;/p&gt;
+&lt;?php
+if ( ! empty($pings) )
+        echo $pings;
+}
+
+
+/**
+ * Display custom fields form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_custom_meta_box($post) {
+?&gt;
+&lt;div id=&quot;postcustomstuff&quot;&gt;
+&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
+&lt;?php
+$metadata = has_meta($post-&gt;ID);
+list_meta($metadata);
+meta_form(); ?&gt;
+&lt;/div&gt;
+&lt;p&gt;&lt;?php _e('Custom fields can be used to add extra metadata to a post that you can &lt;a href=&quot;http://codex.wordpress.org/Using_Custom_Fields&quot; target=&quot;_blank&quot;&gt;use in your theme&lt;/a&gt;.'); ?&gt;&lt;/p&gt;
+&lt;?php
+}
+
+
+/**
+ * Display comments status form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_comment_status_meta_box($post) {
+?&gt;
+&lt;input name=&quot;advanced_view&quot; type=&quot;hidden&quot; value=&quot;1&quot; /&gt;
+&lt;p class=&quot;meta-options&quot;&gt;
+        &lt;label for=&quot;comment_status&quot; class=&quot;selectit&quot;&gt; &lt;input name=&quot;comment_status&quot; type=&quot;checkbox&quot; id=&quot;comment_status&quot; value=&quot;open&quot; &lt;?php checked($post-&gt;comment_status, 'open'); ?&gt; /&gt; &lt;?php _e('Allow Comments') ?&gt;&lt;/label&gt;&lt;br /&gt;
+        &lt;label for=&quot;ping_status&quot; class=&quot;selectit&quot;&gt;&lt;input name=&quot;ping_status&quot; type=&quot;checkbox&quot; id=&quot;ping_status&quot; value=&quot;open&quot; &lt;?php checked($post-&gt;ping_status, 'open'); ?&gt; /&gt; &lt;?php _e('Allow &lt;a href=&quot;http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments&quot; target=&quot;_blank&quot;&gt;trackbacks and pingbacks&lt;/a&gt;') ?&gt;&lt;/label&gt;
+&lt;/p&gt;
+&lt;?php
+}
+
+
+/**
+ * Display comments for post.
+ *
+ * @since 2.8.0
+ *
+ * @param object $post
+ */
+function post_comment_meta_box($post) {
+        global $wpdb, $post_ID;
+
+        $total = $wpdb-&gt;get_var($wpdb-&gt;prepare(&quot;SELECT count(1) FROM $wpdb-&gt;comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')&quot;, $post_ID));
+
+        if ( 1 &gt; $total ) {
+                echo '&lt;p&gt;' . __('No comments yet.') . '&lt;/p&gt;';
+                return;
+        }
+
+        wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
+?&gt;
+
+&lt;table class=&quot;widefat comments-box fixed&quot; cellspacing=&quot;0&quot; style=&quot;display:none;&quot;&gt;
+&lt;thead&gt;&lt;tr&gt;
+    &lt;th scope=&quot;col&quot; class=&quot;column-author&quot;&gt;&lt;?php _e('Author') ?&gt;&lt;/th&gt;
+    &lt;th scope=&quot;col&quot; class=&quot;column-comment&quot;&gt;
+&lt;?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?&gt;&lt;/th&gt;
+&lt;/tr&gt;&lt;/thead&gt;
+&lt;tbody id=&quot;the-comment-list&quot; class=&quot;list:comment&quot;&gt;&lt;/tbody&gt;
+&lt;/table&gt;
+&lt;p class=&quot;hide-if-no-js&quot;&gt;&lt;a href=&quot;#commentstatusdiv&quot; id=&quot;show-comments&quot; onclick=&quot;commentsBox.get(&lt;?php echo $total; ?&gt;);return false;&quot;&gt;&lt;?php _e('Show comments'); ?&gt;&lt;/a&gt; &lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;images/wpspin_light.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
+&lt;?php
+        $hidden = get_hidden_meta_boxes('post');
+        if ( ! in_array('commentsdiv', $hidden) ) { ?&gt;
+                &lt;script type=&quot;text/javascript&quot;&gt;jQuery(document).ready(function(){commentsBox.get(&lt;?php echo $total; ?&gt;, 10);});&lt;/script&gt;
+&lt;?php
+        }
+}
+
+
+/**
+ * Display slug form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_slug_meta_box($post) {
+?&gt;
+&lt;label class=&quot;screen-reader-text&quot; for=&quot;post_name&quot;&gt;&lt;?php _e('Slug') ?&gt;&lt;/label&gt;&lt;input name=&quot;post_name&quot; type=&quot;text&quot; size=&quot;13&quot; id=&quot;post_name&quot; value=&quot;&lt;?php echo esc_attr( $post-&gt;post_name ); ?&gt;&quot; /&gt;
+&lt;?php
+}
+
+
+/**
+ * Display form field with list of authors.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_author_meta_box($post) {
+        global $current_user, $user_ID;
+        $authors = get_editable_user_ids( $current_user-&gt;id, true, $post-&gt;post_type ); // TODO: ROLE SYSTEM
+        if ( $post-&gt;post_author &amp;&amp; !in_array($post-&gt;post_author, $authors) )
+                $authors[] = $post-&gt;post_author;
+?&gt;
+&lt;label class=&quot;screen-reader-text&quot; for=&quot;post_author_override&quot;&gt;&lt;?php _e('Author'); ?&gt;&lt;/label&gt;&lt;?php wp_dropdown_users( array('include' =&gt; $authors, 'name' =&gt; 'post_author_override', 'selected' =&gt; empty($post-&gt;ID) ? $user_ID : $post-&gt;post_author) ); ?&gt;
+&lt;?php
+}
+
+
+/**
+ * Display list of revisions.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_revisions_meta_box($post) {
+        wp_list_post_revisions();
+}
+
+
+// -- Page related Meta Boxes
+
+/**
+ * Display page attributes form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function page_attributes_meta_box($post){
+?&gt;
+&lt;h5&gt;&lt;?php _e('Parent') ?&gt;&lt;/h5&gt;
+&lt;label class=&quot;screen-reader-text&quot; for=&quot;parent_id&quot;&gt;&lt;?php _e('Page Parent') ?&gt;&lt;/label&gt;
+&lt;?php wp_dropdown_pages(array('exclude_tree' =&gt; $post-&gt;ID, 'selected' =&gt; $post-&gt;post_parent, 'name' =&gt; 'parent_id', 'show_option_none' =&gt; __('Main Page (no parent)'), 'sort_column'=&gt; 'menu_order, post_title')); ?&gt;
+&lt;p&gt;&lt;?php _e('You can arrange your pages in hierarchies, for example you could have an &amp;#8220;About&amp;#8221; page that has &amp;#8220;Life Story&amp;#8221; and &amp;#8220;My Dog&amp;#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?&gt;&lt;/p&gt;
+&lt;?php
+        if ( 0 != count( get_page_templates() ) ) { ?&gt;
+&lt;h5&gt;&lt;?php _e('Template') ?&gt;&lt;/h5&gt;
+&lt;label class=&quot;screen-reader-text&quot; for=&quot;page_template&quot;&gt;&lt;?php _e('Page Template') ?&gt;&lt;/label&gt;&lt;select name=&quot;page_template&quot; id=&quot;page_template&quot;&gt;
+&lt;option value='default'&gt;&lt;?php _e('Default Template'); ?&gt;&lt;/option&gt;
+&lt;?php page_template_dropdown($post-&gt;page_template); ?&gt;
+&lt;/select&gt;
+&lt;p&gt;&lt;?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&amp;#8217;ll see them above.'); ?&gt;&lt;/p&gt;
+&lt;?php
+        } ?&gt;
+&lt;h5&gt;&lt;?php _e('Order') ?&gt;&lt;/h5&gt;
+&lt;p&gt;&lt;label class=&quot;screen-reader-text&quot; for=&quot;menu_order&quot;&gt;&lt;?php _e('Page Order') ?&gt;&lt;/label&gt;&lt;input name=&quot;menu_order&quot; type=&quot;text&quot; size=&quot;4&quot; id=&quot;menu_order&quot; value=&quot;&lt;?php echo esc_attr($post-&gt;menu_order) ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;p&gt;&lt;?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&amp;#8217;ll be better in future releases.)'); ?&gt;&lt;/p&gt;
+&lt;?php
+}
+
+
+// -- Link related Meta Boxes
+
+/**
+ * Display link create form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $link
+ */
+function link_submit_meta_box($link) {
+?&gt;
+&lt;div class=&quot;submitbox&quot; id=&quot;submitlink&quot;&gt;
+
+&lt;div id=&quot;minor-publishing&quot;&gt;
+
+&lt;?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?&gt;
+&lt;div style=&quot;display:none;&quot;&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php esc_attr_e('Save'); ?&gt;&quot; /&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;minor-publishing-actions&quot;&gt;
+&lt;div id=&quot;preview-action&quot;&gt;
+&lt;?php if ( !empty($link-&gt;link_id) ) { ?&gt;
+        &lt;a class=&quot;preview button&quot; href=&quot;&lt;?php echo $link-&gt;link_url; ?&gt;&quot; target=&quot;_blank&quot; tabindex=&quot;4&quot;&gt;&lt;?php _e('Visit Link'); ?&gt;&lt;/a&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;misc-publishing-actions&quot;&gt;
+&lt;div class=&quot;misc-pub-section misc-pub-section-last&quot;&gt;
+        &lt;label for=&quot;link_private&quot; class=&quot;selectit&quot;&gt;&lt;input id=&quot;link_private&quot; name=&quot;link_visible&quot; type=&quot;checkbox&quot; value=&quot;N&quot; &lt;?php checked($link-&gt;link_visible, 'N'); ?&gt; /&gt; &lt;?php _e('Keep this link private') ?&gt;&lt;/label&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;/div&gt;
+
+&lt;div id=&quot;major-publishing-actions&quot;&gt;
+&lt;?php do_action('post_submitbox_start'); ?&gt;
+&lt;div id=&quot;delete-action&quot;&gt;
+&lt;?php
+if ( !empty($_GET['action']) &amp;&amp; 'edit' == $_GET['action'] &amp;&amp; current_user_can('manage_links') ) { ?&gt;
+        &lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;link.php?action=delete&amp;amp;link_id=$link-&gt;link_id&quot;, 'delete-bookmark_' . $link-&gt;link_id); ?&gt;&quot; onclick=&quot;if ( confirm('&lt;?php echo esc_js(sprintf(__(&quot;You are about to delete this link '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $link-&gt;link_name )); ?&gt;') ) {return true;}return false;&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/a&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;publishing-action&quot;&gt;
+&lt;?php if ( !empty($link-&gt;link_id) ) { ?&gt;
+        &lt;input name=&quot;save&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;4&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php esc_attr_e('Update Link') ?&gt;&quot; /&gt;
+&lt;?php } else { ?&gt;
+        &lt;input name=&quot;save&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;4&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php esc_attr_e('Add Link') ?&gt;&quot; /&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;?php do_action('submitlink_box'); ?&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;?php
+}
+
+
+/**
+ * Display link categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_categories_meta_box($link) { ?&gt;
+&lt;ul id=&quot;category-tabs&quot;&gt;
+        &lt;li class=&quot;tabs&quot;&gt;&lt;a href=&quot;#categories-all&quot;&gt;&lt;?php _e( 'All Categories' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
+        &lt;li class=&quot;hide-if-no-js&quot;&gt;&lt;a href=&quot;#categories-pop&quot;&gt;&lt;?php _e( 'Most Used' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
+&lt;/ul&gt;
+
+&lt;div id=&quot;categories-all&quot; class=&quot;tabs-panel&quot;&gt;
+        &lt;ul id=&quot;categorychecklist&quot; class=&quot;list:category categorychecklist form-no-clear&quot;&gt;
+                &lt;?php
+                if ( isset($link-&gt;link_id) )
+                        wp_link_category_checklist($link-&gt;link_id);
+                else
+                        wp_link_category_checklist();
+                ?&gt;
+        &lt;/ul&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;categories-pop&quot; class=&quot;tabs-panel&quot; style=&quot;display: none;&quot;&gt;
+        &lt;ul id=&quot;categorychecklist-pop&quot; class=&quot;categorychecklist form-no-clear&quot;&gt;
+                &lt;?php wp_popular_terms_checklist('link_category'); ?&gt;
+        &lt;/ul&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;category-adder&quot; class=&quot;wp-hidden-children&quot;&gt;
+        &lt;h4&gt;&lt;a id=&quot;category-add-toggle&quot; href=&quot;#category-add&quot;&gt;&lt;?php _e( '+ Add New Category' ); ?&gt;&lt;/a&gt;&lt;/h4&gt;
+        &lt;p id=&quot;link-category-add&quot; class=&quot;wp-hidden-child&quot;&gt;
+                &lt;label class=&quot;screen-reader-text&quot; for=&quot;newcat&quot;&gt;&lt;?php _e( '+ Add New Category' ); ?&gt;&lt;/label&gt;
+                &lt;input type=&quot;text&quot; name=&quot;newcat&quot; id=&quot;newcat&quot; class=&quot;form-required form-input-tip&quot; value=&quot;&lt;?php esc_attr_e( 'New category name' ); ?&gt;&quot; aria-required=&quot;true&quot; /&gt;
+                &lt;input type=&quot;button&quot; id=&quot;category-add-submit&quot; class=&quot;add:categorychecklist:linkcategorydiv button&quot; value=&quot;&lt;?php esc_attr_e( 'Add' ); ?&gt;&quot; /&gt;
+                &lt;?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?&gt;
+                &lt;span id=&quot;category-ajax-response&quot;&gt;&lt;/span&gt;
+        &lt;/p&gt;
+&lt;/div&gt;
+&lt;?php
+}
+
+
+/**
+ * Display form fields for changing link target.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_target_meta_box($link) { ?&gt;
+&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt;&lt;?php _e('Target') ?&gt;&lt;/span&gt;&lt;/legend&gt;
+&lt;p&gt;&lt;label for=&quot;link_target_blank&quot; class=&quot;selectit&quot;&gt;
+&lt;input id=&quot;link_target_blank&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;_blank&quot; &lt;?php echo ( isset( $link-&gt;link_target ) &amp;&amp; ($link-&gt;link_target == '_blank') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
+&lt;?php _e('&lt;code&gt;_blank&lt;/code&gt; - new window or tab.'); ?&gt;&lt;/label&gt;&lt;/p&gt;
+&lt;p&gt;&lt;label for=&quot;link_target_top&quot; class=&quot;selectit&quot;&gt;
+&lt;input id=&quot;link_target_top&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;_top&quot; &lt;?php echo ( isset( $link-&gt;link_target ) &amp;&amp; ($link-&gt;link_target == '_top') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
+&lt;?php _e('&lt;code&gt;_top&lt;/code&gt; - current window or tab, with no frames.'); ?&gt;&lt;/label&gt;&lt;/p&gt;
+&lt;p&gt;&lt;label for=&quot;link_target_none&quot; class=&quot;selectit&quot;&gt;
+&lt;input id=&quot;link_target_none&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;&quot; &lt;?php echo ( isset( $link-&gt;link_target ) &amp;&amp; ($link-&gt;link_target == '') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
+&lt;?php _e('&lt;code&gt;_none&lt;/code&gt; - same window or tab.'); ?&gt;&lt;/label&gt;&lt;/p&gt;
+&lt;/fieldset&gt;
+&lt;p&gt;&lt;?php _e('Choose the target frame for your link.'); ?&gt;&lt;/p&gt;
+&lt;?php
+}
+
+
+/**
+ * Display checked checkboxes attribute for xfn microformat options.
+ *
+ * @since 1.0.1
+ *
+ * @param string $class
+ * @param string $value
+ * @param mixed $deprecated Not used.
+ */
+function xfn_check($class, $value = '', $deprecated = '') {
+        global $link;
+
+        $link_rel = isset( $link-&gt;link_rel ) ? $link-&gt;link_rel : ''; // In PHP 5.3: $link_rel = $link-&gt;link_rel ?: '';
+        $rels = preg_split('/\s+/', $link_rel);
+
+        if ('' != $value &amp;&amp; in_array($value, $rels) ) {
+                echo ' checked=&quot;checked&quot;';
+        }
+
+        if ('' == $value) {
+                if ('family' == $class &amp;&amp; strpos($link_rel, 'child') === false &amp;&amp; strpos($link_rel, 'parent') === false &amp;&amp; strpos($link_rel, 'sibling') === false &amp;&amp; strpos($link_rel, 'spouse') === false &amp;&amp; strpos($link_rel, 'kin') === false) echo ' checked=&quot;checked&quot;';
+                if ('friendship' == $class &amp;&amp; strpos($link_rel, 'friend') === false &amp;&amp; strpos($link_rel, 'acquaintance') === false &amp;&amp; strpos($link_rel, 'contact') === false) echo ' checked=&quot;checked&quot;';
+                if ('geographical' == $class &amp;&amp; strpos($link_rel, 'co-resident') === false &amp;&amp; strpos($link_rel, 'neighbor') === false) echo ' checked=&quot;checked&quot;';
+                if ('identity' == $class &amp;&amp; in_array('me', $rels) ) echo ' checked=&quot;checked&quot;';
+        }
+}
+
+
+/**
+ * Display xfn form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_xfn_meta_box($link) {
+?&gt;
+&lt;table class=&quot;editform&quot; style=&quot;width: 100%;&quot; cellspacing=&quot;2&quot; cellpadding=&quot;5&quot;&gt;
+        &lt;tr&gt;
+                &lt;th style=&quot;width: 20%;&quot; scope=&quot;row&quot;&gt;&lt;label for=&quot;link_rel&quot;&gt;&lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?&gt;&lt;/label&gt;&lt;/th&gt;
+                &lt;td style=&quot;width: 80%;&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;link_rel&quot; id=&quot;link_rel&quot; size=&quot;50&quot; value=&quot;&lt;?php echo ( isset( $link-&gt;link_rel ) ? esc_attr($link-&gt;link_rel) : ''); ?&gt;&quot; /&gt;&lt;/td&gt;
+        &lt;/tr&gt;
+        &lt;tr&gt;
+                &lt;td colspan=&quot;2&quot;&gt;
+                        &lt;table cellpadding=&quot;3&quot; cellspacing=&quot;5&quot; class=&quot;form-table&quot;&gt;
+                                &lt;tr&gt;
+                                        &lt;th scope=&quot;row&quot;&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?&gt; &lt;/th&gt;
+                                        &lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?&gt; &lt;/span&gt;&lt;/legend&gt;
+                                                &lt;label for=&quot;me&quot;&gt;
+                                                &lt;input type=&quot;checkbox&quot; name=&quot;identity&quot; value=&quot;me&quot; id=&quot;me&quot; &lt;?php xfn_check('identity', 'me'); ?&gt; /&gt;
+                                                &lt;?php _e('another web address of mine') ?&gt;&lt;/label&gt;
+                                        &lt;/fieldset&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                                &lt;tr&gt;
+                                        &lt;th scope=&quot;row&quot;&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?&gt; &lt;/th&gt;
+                                        &lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?&gt; &lt;/span&gt;&lt;/legend&gt;
+                                                &lt;label for=&quot;contact&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;friendship&quot; value=&quot;contact&quot; id=&quot;contact&quot; &lt;?php xfn_check('friendship', 'contact', 'radio'); ?&gt; /&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;acquaintance&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;friendship&quot; value=&quot;acquaintance&quot; id=&quot;acquaintance&quot; &lt;?php xfn_check('friendship', 'acquaintance', 'radio'); ?&gt; /&gt;  &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;friend&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;friendship&quot; value=&quot;friend&quot; id=&quot;friend&quot; &lt;?php xfn_check('friendship', 'friend', 'radio'); ?&gt; /&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;friendship&quot;&gt;
+                                                &lt;input name=&quot;friendship&quot; type=&quot;radio&quot; class=&quot;valinp&quot; value=&quot;&quot; id=&quot;friendship&quot; &lt;?php xfn_check('friendship', '', 'radio'); ?&gt; /&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?&gt;&lt;/label&gt;
+                                        &lt;/fieldset&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                                &lt;tr&gt;
+                                        &lt;th scope=&quot;row&quot;&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?&gt; &lt;/th&gt;
+                                        &lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?&gt; &lt;/span&gt;&lt;/legend&gt;
+                                                &lt;label for=&quot;met&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;physical&quot; value=&quot;met&quot; id=&quot;met&quot; &lt;?php xfn_check('physical', 'met'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?&gt;&lt;/label&gt;
+                                        &lt;/fieldset&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                                &lt;tr&gt;
+                                        &lt;th scope=&quot;row&quot;&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?&gt; &lt;/th&gt;
+                                        &lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?&gt; &lt;/span&gt;&lt;/legend&gt;
+                                                &lt;label for=&quot;co-worker&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;professional&quot; value=&quot;co-worker&quot; id=&quot;co-worker&quot; &lt;?php xfn_check('professional', 'co-worker'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;colleague&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;professional&quot; value=&quot;colleague&quot; id=&quot;colleague&quot; &lt;?php xfn_check('professional', 'colleague'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?&gt;&lt;/label&gt;
+                                        &lt;/fieldset&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                                &lt;tr&gt;
+                                        &lt;th scope=&quot;row&quot;&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?&gt; &lt;/th&gt;
+                                        &lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?&gt; &lt;/span&gt;&lt;/legend&gt;
+                                                &lt;label for=&quot;co-resident&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;geographical&quot; value=&quot;co-resident&quot; id=&quot;co-resident&quot; &lt;?php xfn_check('geographical', 'co-resident', 'radio'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;neighbor&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;geographical&quot; value=&quot;neighbor&quot; id=&quot;neighbor&quot; &lt;?php xfn_check('geographical', 'neighbor', 'radio'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;geographical&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;geographical&quot; value=&quot;&quot; id=&quot;geographical&quot; &lt;?php xfn_check('geographical', '', 'radio'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?&gt;&lt;/label&gt;
+                                        &lt;/fieldset&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                                &lt;tr&gt;
+                                        &lt;th scope=&quot;row&quot;&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?&gt; &lt;/th&gt;
+                                        &lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?&gt; &lt;/span&gt;&lt;/legend&gt;
+                                                &lt;label for=&quot;child&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;family&quot; value=&quot;child&quot; id=&quot;child&quot; &lt;?php xfn_check('family', 'child', 'radio'); ?&gt;  /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;kin&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;family&quot; value=&quot;kin&quot; id=&quot;kin&quot; &lt;?php xfn_check('family', 'kin', 'radio'); ?&gt;  /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;parent&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;family&quot; value=&quot;parent&quot; id=&quot;parent&quot; &lt;?php xfn_check('family', 'parent', 'radio'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;sibling&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;family&quot; value=&quot;sibling&quot; id=&quot;sibling&quot; &lt;?php xfn_check('family', 'sibling', 'radio'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;spouse&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;family&quot; value=&quot;spouse&quot; id=&quot;spouse&quot; &lt;?php xfn_check('family', 'spouse', 'radio'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;family&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;radio&quot; name=&quot;family&quot; value=&quot;&quot; id=&quot;family&quot; &lt;?php xfn_check('family', '', 'radio'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?&gt;&lt;/label&gt;
+                                        &lt;/fieldset&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                                &lt;tr&gt;
+                                        &lt;th scope=&quot;row&quot;&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?&gt; &lt;/th&gt;
+                                        &lt;td&gt;&lt;fieldset&gt;&lt;legend class=&quot;screen-reader-text&quot;&gt;&lt;span&gt; &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?&gt; &lt;/span&gt;&lt;/legend&gt;
+                                                &lt;label for=&quot;muse&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;romantic&quot; value=&quot;muse&quot; id=&quot;muse&quot; &lt;?php xfn_check('romantic', 'muse'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;crush&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;romantic&quot; value=&quot;crush&quot; id=&quot;crush&quot; &lt;?php xfn_check('romantic', 'crush'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;date&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;romantic&quot; value=&quot;date&quot; id=&quot;date&quot; &lt;?php xfn_check('romantic', 'date'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?&gt;&lt;/label&gt;
+                                                &lt;label for=&quot;romantic&quot;&gt;
+                                                &lt;input class=&quot;valinp&quot; type=&quot;checkbox&quot; name=&quot;romantic&quot; value=&quot;sweetheart&quot; id=&quot;romantic&quot; &lt;?php xfn_check('romantic', 'sweetheart'); ?&gt; /&gt;
+                                                &lt;?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?&gt;&lt;/label&gt;
+                                        &lt;/fieldset&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                        &lt;/table&gt;
+                &lt;/td&gt;
+        &lt;/tr&gt;
+&lt;/table&gt;
+&lt;p&gt;&lt;?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out &lt;a href=&quot;http://gmpg.org/xfn/&quot;&gt;XFN&lt;/a&gt;.'); ?&gt;&lt;/p&gt;
+&lt;?php
+}
+
+
+/**
+ * Display advanced link options form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_advanced_meta_box($link) {
+?&gt;
+&lt;table class=&quot;form-table&quot; style=&quot;width: 100%;&quot; cellspacing=&quot;2&quot; cellpadding=&quot;5&quot;&gt;
+        &lt;tr class=&quot;form-field&quot;&gt;
+                &lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;link_image&quot;&gt;&lt;?php _e('Image Address') ?&gt;&lt;/label&gt;&lt;/th&gt;
+                &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;link_image&quot; class=&quot;code&quot; id=&quot;link_image&quot; size=&quot;50&quot; value=&quot;&lt;?php echo ( isset( $link-&gt;link_image ) ? esc_attr($link-&gt;link_image) : ''); ?&gt;&quot; style=&quot;width: 95%&quot; /&gt;&lt;/td&gt;
+        &lt;/tr&gt;
+        &lt;tr class=&quot;form-field&quot;&gt;
+                &lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;rss_uri&quot;&gt;&lt;?php _e('RSS Address') ?&gt;&lt;/label&gt;&lt;/th&gt;
+                &lt;td&gt;&lt;input name=&quot;link_rss&quot; class=&quot;code&quot; type=&quot;text&quot; id=&quot;rss_uri&quot; value=&quot;&lt;?php echo  ( isset( $link-&gt;link_rss ) ? esc_attr($link-&gt;link_rss) : ''); ?&gt;&quot; size=&quot;50&quot; style=&quot;width: 95%&quot; /&gt;&lt;/td&gt;
+        &lt;/tr&gt;
+        &lt;tr class=&quot;form-field&quot;&gt;
+                &lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;link_notes&quot;&gt;&lt;?php _e('Notes') ?&gt;&lt;/label&gt;&lt;/th&gt;
+                &lt;td&gt;&lt;textarea name=&quot;link_notes&quot; id=&quot;link_notes&quot; cols=&quot;50&quot; rows=&quot;10&quot; style=&quot;width: 95%&quot;&gt;&lt;?php echo  ( isset( $link-&gt;link_notes ) ? $link-&gt;link_notes : ''); ?&gt;&lt;/textarea&gt;&lt;/td&gt;
+        &lt;/tr&gt;
+        &lt;tr class=&quot;form-field&quot;&gt;
+                &lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;link_rating&quot;&gt;&lt;?php _e('Rating') ?&gt;&lt;/label&gt;&lt;/th&gt;
+                &lt;td&gt;&lt;select name=&quot;link_rating&quot; id=&quot;link_rating&quot; size=&quot;1&quot;&gt;
+                &lt;?php
+                        for ($r = 0; $r &lt; 10; $r++) {
+                                echo('            &lt;option value=&quot;'. esc_attr($r) .'&quot; ');
+                                if ( isset($link-&gt;link_rating) &amp;&amp; $link-&gt;link_rating == $r)
+                                        echo 'selected=&quot;selected&quot;';
+                                echo('&gt;'.$r.'&lt;/option&gt;');
+                        }
+                ?&gt;&lt;/select&gt;&amp;nbsp;&lt;?php _e('(Leave at 0 for no rating.)') ?&gt;
+                &lt;/td&gt;
+        &lt;/tr&gt;
+&lt;/table&gt;
+&lt;?php
+}
</ins></span></pre>
</div>
</div>

</body>
</html>