11 */ |
11 */ |
12 function post_submit_meta_box($post) { |
12 function post_submit_meta_box($post) { |
13 global $action; |
13 global $action; |
14 |
14 |
15 $post_type = $post->post_type; |
15 $post_type = $post->post_type; |
16 $can_publish = current_user_can("publish_${post_type}s"); |
16 $post_type_object = get_post_type_object($post_type); |
|
17 $can_publish = current_user_can($post_type_object->cap->publish_posts); |
17 ?> |
18 ?> |
18 <div class="submitbox" id="submitpost"> |
19 <div class="submitbox" id="submitpost"> |
19 |
20 |
20 <div id="minor-publishing"> |
21 <div id="minor-publishing"> |
21 |
22 |
22 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> |
23 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> |
23 <div style="display:none;"> |
24 <div style="display:none;"> |
24 <input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" /> |
25 <?php submit_button( __( 'Save' ), 'button', 'save' ); ?> |
25 </div> |
26 </div> |
26 |
27 |
27 <div id="minor-publishing-actions"> |
28 <div id="minor-publishing-actions"> |
28 <div id="save-action"> |
29 <div id="save-action"> |
29 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> |
30 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> |
30 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" /> |
31 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" /> |
31 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> |
32 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> |
32 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" /> |
33 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" /> |
33 <?php } ?> |
34 <?php } ?> |
34 </div> |
35 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="draft-ajax-loading" alt="" /> |
35 |
36 </div> |
|
37 <?php if ( $post_type_object->public ) : ?> |
36 <div id="preview-action"> |
38 <div id="preview-action"> |
37 <?php |
39 <?php |
38 if ( 'publish' == $post->post_status ) { |
40 if ( 'publish' == $post->post_status ) { |
39 $preview_link = esc_url(get_permalink($post->ID)); |
41 $preview_link = esc_url( get_permalink( $post->ID ) ); |
40 $preview_button = __('Preview Changes'); |
42 $preview_button = __( 'Preview Changes' ); |
41 } else { |
43 } else { |
42 $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); |
44 $preview_link = get_permalink( $post->ID ); |
43 $preview_button = __('Preview'); |
45 if ( is_ssl() ) |
|
46 $preview_link = str_replace( 'http://', 'https://', $preview_link ); |
|
47 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); |
|
48 $preview_button = __( 'Preview' ); |
44 } |
49 } |
45 ?> |
50 ?> |
46 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a> |
51 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a> |
47 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> |
52 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> |
48 </div> |
53 </div> |
49 |
54 <?php endif; // public post type ?> |
50 <div class="clear"></div> |
55 <div class="clear"></div> |
51 </div><?php // /minor-publishing-actions ?> |
56 </div><?php // /minor-publishing-actions ?> |
52 |
57 |
53 <div id="misc-publishing-actions"> |
58 <div id="misc-publishing-actions"> |
54 |
59 |
55 <div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label> |
60 <div class="misc-pub-section"><label for="post_status"><?php _e('Status:') ?></label> |
56 <span id="post-status-display"> |
61 <span id="post-status-display"> |
57 <?php |
62 <?php |
58 switch ( $post->post_status ) { |
63 switch ( $post->post_status ) { |
59 case 'private': |
64 case 'private': |
60 _e('Privately Published'); |
65 _e('Privately Published'); |
67 break; |
72 break; |
68 case 'pending': |
73 case 'pending': |
69 _e('Pending Review'); |
74 _e('Pending Review'); |
70 break; |
75 break; |
71 case 'draft': |
76 case 'draft': |
|
77 case 'auto-draft': |
72 _e('Draft'); |
78 _e('Draft'); |
73 break; |
79 break; |
74 } |
80 } |
75 ?> |
81 ?> |
76 </span> |
82 </span> |
77 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> |
83 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> |
78 <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> |
84 <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> |
79 |
85 |
80 <div id="post-status-select" class="hide-if-js"> |
86 <div id="post-status-select" class="hide-if-js"> |
81 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" /> |
87 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" /> |
82 <select name='post_status' id='post_status' tabindex='4'> |
88 <select name='post_status' id='post_status' tabindex='4'> |
83 <?php if ( 'publish' == $post->post_status ) : ?> |
89 <?php if ( 'publish' == $post->post_status ) : ?> |
84 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> |
90 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> |
85 <?php elseif ( 'private' == $post->post_status ) : ?> |
91 <?php elseif ( 'private' == $post->post_status ) : ?> |
86 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> |
92 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> |
87 <?php elseif ( 'future' == $post->post_status ) : ?> |
93 <?php elseif ( 'future' == $post->post_status ) : ?> |
88 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> |
94 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> |
89 <?php endif; ?> |
95 <?php endif; ?> |
90 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> |
96 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> |
|
97 <?php if ( 'auto-draft' == $post->post_status ) : ?> |
|
98 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option> |
|
99 <?php else : ?> |
91 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option> |
100 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option> |
|
101 <?php endif; ?> |
92 </select> |
102 </select> |
93 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> |
103 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> |
94 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a> |
104 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a> |
95 </div> |
105 </div> |
96 |
106 |
97 <?php } ?> |
107 <?php } ?> |
98 </div><?php // /misc-pub-section ?> |
108 </div><?php // /misc-pub-section ?> |
99 |
109 |
100 <div class="misc-pub-section " id="visibility"> |
110 <div class="misc-pub-section" id="visibility"> |
101 <?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php |
111 <?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php |
102 |
112 |
103 if ( 'private' == $post->post_status ) { |
113 if ( 'private' == $post->post_status ) { |
104 $post->post_password = ''; |
114 $post->post_password = ''; |
105 $visibility = 'private'; |
115 $visibility = 'private'; |
182 |
189 |
183 <div id="major-publishing-actions"> |
190 <div id="major-publishing-actions"> |
184 <?php do_action('post_submitbox_start'); ?> |
191 <?php do_action('post_submitbox_start'); ?> |
185 <div id="delete-action"> |
192 <div id="delete-action"> |
186 <?php |
193 <?php |
187 if ( current_user_can( "delete_${post_type}", $post->ID ) ) { |
194 if ( current_user_can( "delete_post", $post->ID ) ) { |
188 if ( !EMPTY_TRASH_DAYS ) { |
195 if ( !EMPTY_TRASH_DAYS ) |
189 $delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" ); |
|
190 $delete_text = __('Delete Permanently'); |
196 $delete_text = __('Delete Permanently'); |
191 } else { |
197 else |
192 $delete_url = wp_nonce_url( add_query_arg( array('action' => 'trash', 'post' => $post->ID) ), "trash-${post_type}_{$post->ID}" ); |
|
193 $delete_text = __('Move to Trash'); |
198 $delete_text = __('Move to Trash'); |
194 } ?> |
199 ?> |
195 <a class="submitdelete deletion<?php if ( 'edit' != $action ) { echo " hidden"; } ?>" href="<?php echo $delete_url; ?>"><?php echo $delete_text; ?></a><?php |
200 <a class="submitdelete deletion" href="<?php echo get_delete_post_link($post->ID); ?>"><?php echo $delete_text; ?></a><?php |
196 } ?> |
201 } ?> |
197 </div> |
202 </div> |
198 |
203 |
199 <div id="publishing-action"> |
204 <div id="publishing-action"> |
200 <img src="images/wpspin_light.gif" id="ajax-loading" style="visibility:hidden;" alt="" /> |
205 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" /> |
201 <?php |
206 <?php |
202 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { |
207 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { |
203 if ( $can_publish ) : |
208 if ( $can_publish ) : |
204 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> |
209 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> |
205 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> |
210 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> |
206 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" /> |
211 <?php submit_button( __( 'Schedule' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?> |
207 <?php else : ?> |
212 <?php else : ?> |
208 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" /> |
213 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" /> |
209 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" /> |
214 <?php submit_button( __( 'Publish' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?> |
210 <?php endif; |
215 <?php endif; |
211 else : ?> |
216 else : ?> |
212 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> |
217 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> |
213 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" /> |
218 <?php submit_button( __( 'Submit for Review' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?> |
214 <?php |
219 <?php |
215 endif; |
220 endif; |
216 } else { ?> |
221 } else { ?> |
217 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
222 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
218 <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update') ?>" /> |
223 <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update') ?>" /> |
224 </div> |
229 </div> |
225 |
230 |
226 <?php |
231 <?php |
227 } |
232 } |
228 |
233 |
|
234 /** |
|
235 * Display post format form elements. |
|
236 * |
|
237 * @since 3.1.0 |
|
238 * |
|
239 * @param object $post |
|
240 */ |
|
241 function post_format_meta_box( $post, $box ) { |
|
242 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) : |
|
243 $post_formats = get_theme_support( 'post-formats' ); |
|
244 |
|
245 if ( is_array( $post_formats[0] ) ) : |
|
246 $post_format = get_post_format( $post->ID ); |
|
247 if ( !$post_format ) |
|
248 $post_format = '0'; |
|
249 // Add in the current one if it isn't there yet, in case the current theme doesn't support it |
|
250 if ( $post_format && !in_array( $post_format, $post_formats[0] ) ) |
|
251 $post_formats[0][] = $post_format; |
|
252 ?> |
|
253 <div id="post-formats-select"> |
|
254 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label> |
|
255 <?php foreach ( $post_formats[0] as $format ) : ?> |
|
256 <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> |
|
257 <?php endforeach; ?><br /> |
|
258 </div> |
|
259 <?php endif; endif; |
|
260 } |
229 |
261 |
230 /** |
262 /** |
231 * Display post tags form fields. |
263 * Display post tags form fields. |
232 * |
264 * |
233 * @since 2.6.0 |
265 * @since 2.6.0 |
234 * |
266 * |
235 * @param object $post |
267 * @param object $post |
236 */ |
268 */ |
237 function post_tags_meta_box($post, $box) { |
269 function post_tags_meta_box($post, $box) { |
238 $tax_name = esc_attr(substr($box['id'], 8)); |
270 $defaults = array('taxonomy' => 'post_tag'); |
239 $taxonomy = get_taxonomy($tax_name); |
271 if ( !isset($box['args']) || !is_array($box['args']) ) |
240 $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.'); |
272 $args = array(); |
|
273 else |
|
274 $args = $box['args']; |
|
275 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); |
|
276 $tax_name = esc_attr($taxonomy); |
|
277 $taxonomy = get_taxonomy($taxonomy); |
|
278 $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : ''; |
|
279 $comma = _x( ',', 'tag delimiter' ); |
241 ?> |
280 ?> |
242 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> |
281 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> |
243 <div class="jaxtag"> |
282 <div class="jaxtag"> |
244 <div class="nojs-tags hide-if-js"> |
283 <div class="nojs-tags hide-if-js"> |
245 <p><?php _e('Add or remove tags'); ?></p> |
284 <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> |
246 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div> |
285 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div> |
247 |
286 <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?> |
248 <div class="ajaxtag hide-if-no-js"> |
287 <div class="ajaxtag hide-if-no-js"> |
249 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label> |
288 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label> |
250 <div class="taghint"><?php _e('Add new tag'); ?></div> |
289 <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div> |
251 <input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
290 <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
252 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /> |
291 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p> |
253 </div></div> |
292 </div> |
254 <p class="howto"><?php echo $helps; ?></p> |
293 <p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p> |
|
294 <?php endif; ?> |
|
295 </div> |
255 <div class="tagchecklist"></div> |
296 <div class="tagchecklist"></div> |
256 </div> |
297 </div> |
257 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p> |
298 <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?> |
258 <?php |
299 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p> |
259 } |
300 <?php endif; ?> |
260 |
301 <?php |
|
302 } |
261 |
303 |
262 /** |
304 /** |
263 * Display post categories form fields. |
305 * Display post categories form fields. |
264 * |
306 * |
265 * @since 2.6.0 |
307 * @since 2.6.0 |
266 * |
308 * |
267 * @param object $post |
309 * @param object $post |
268 */ |
310 */ |
269 function post_categories_meta_box($post) { |
311 function post_categories_meta_box( $post, $box ) { |
270 ?> |
312 $defaults = array('taxonomy' => 'category'); |
271 <ul id="category-tabs"> |
313 if ( !isset($box['args']) || !is_array($box['args']) ) |
272 <li class="tabs"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li> |
314 $args = array(); |
273 <li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> |
315 else |
274 </ul> |
316 $args = $box['args']; |
275 |
317 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); |
276 <div id="categories-pop" class="tabs-panel" style="display: none;"> |
318 $tax = get_taxonomy($taxonomy); |
277 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" > |
319 |
278 <?php $popular_ids = wp_popular_terms_checklist('category'); ?> |
320 ?> |
279 </ul> |
321 <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv"> |
280 </div> |
322 <ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs"> |
281 |
323 <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php echo $tax->labels->all_items; ?></a></li> |
282 <div id="categories-all" class="tabs-panel"> |
324 <li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> |
283 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> |
325 </ul> |
284 <?php wp_category_checklist($post->ID, false, false, $popular_ids) ?> |
326 |
285 </ul> |
327 <div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;"> |
286 </div> |
328 <ul id="<?php echo $taxonomy; ?>checklist-pop" class="categorychecklist form-no-clear" > |
287 |
329 <?php $popular_ids = wp_popular_terms_checklist($taxonomy); ?> |
288 <?php if ( current_user_can('manage_categories') ) : ?> |
330 </ul> |
289 <div id="category-adder" class="wp-hidden-children"> |
331 </div> |
290 <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4> |
332 |
291 <p id="category-add" class="wp-hidden-child"> |
333 <div id="<?php echo $taxonomy; ?>-all" class="tabs-panel"> |
292 <label class="screen-reader-text" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" tabindex="3" aria-required="true"/> |
334 <?php |
293 <label class="screen-reader-text" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); ?> |
335 $name = ( $taxonomy == 'category' ) ? 'post_category' : 'tax_input[' . $taxonomy . ']'; |
294 <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" /> |
336 echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
295 <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?> |
337 ?> |
296 <span id="category-ajax-response"></span></p> |
338 <ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy?> categorychecklist form-no-clear"> |
297 </div> |
339 <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?> |
298 <?php |
340 </ul> |
299 endif; |
341 </div> |
300 |
342 <?php if ( current_user_can($tax->cap->edit_terms) ) : ?> |
301 } |
343 <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children"> |
302 |
344 <h4> |
|
345 <a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"> |
|
346 <?php |
|
347 /* translators: %s: add new taxonomy label */ |
|
348 printf( __( '+ %s' ), $tax->labels->add_new_item ); |
|
349 ?> |
|
350 </a> |
|
351 </h4> |
|
352 <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child"> |
|
353 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php echo $tax->labels->add_new_item; ?></label> |
|
354 <input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" tabindex="3" aria-required="true"/> |
|
355 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent"> |
|
356 <?php echo $tax->labels->parent_item_colon; ?> |
|
357 </label> |
|
358 <?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?> |
|
359 <input type="button" id="<?php echo $taxonomy; ?>-add-submit" class="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" tabindex="3" /> |
|
360 <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?> |
|
361 <span id="<?php echo $taxonomy; ?>-ajax-response"></span> |
|
362 </p> |
|
363 </div> |
|
364 <?php endif; ?> |
|
365 </div> |
|
366 <?php |
|
367 } |
303 |
368 |
304 /** |
369 /** |
305 * Display post excerpt form fields. |
370 * Display post excerpt form fields. |
306 * |
371 * |
307 * @since 2.6.0 |
372 * @since 2.6.0 |
308 * |
373 * |
309 * @param object $post |
374 * @param object $post |
310 */ |
375 */ |
311 function post_excerpt_meta_box($post) { |
376 function post_excerpt_meta_box($post) { |
312 ?> |
377 ?> |
313 <label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea> |
378 <label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea> |
314 <p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p> |
379 <p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p> |
315 <?php |
380 <?php |
316 } |
381 } |
317 |
|
318 |
382 |
319 /** |
383 /** |
320 * Display trackback links form fields. |
384 * Display trackback links form fields. |
321 * |
385 * |
322 * @since 2.6.0 |
386 * @since 2.6.0 |
390 * @param object $post |
469 * @param object $post |
391 */ |
470 */ |
392 function post_comment_meta_box($post) { |
471 function post_comment_meta_box($post) { |
393 global $wpdb, $post_ID; |
472 global $wpdb, $post_ID; |
394 |
473 |
|
474 wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); |
|
475 ?> |
|
476 <p class="hide-if-no-js" id="add-new-comment"><a href="#commentstatusdiv" onclick="commentReply.addcomment(<?php echo $post_ID; ?>);return false;"><?php _e('Add comment'); ?></a></p> |
|
477 <?php |
|
478 |
395 $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID)); |
479 $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID)); |
|
480 $wp_list_table = _get_list_table('WP_Post_Comments_List_Table'); |
|
481 $wp_list_table->display( true ); |
396 |
482 |
397 if ( 1 > $total ) { |
483 if ( 1 > $total ) { |
398 echo '<p>' . __('No comments yet.') . '</p>'; |
484 echo '<p id="no-comments">' . __('No comments yet.') . '</p>'; |
399 return; |
485 } else { |
|
486 $hidden = get_hidden_meta_boxes( get_current_screen() ); |
|
487 if ( ! in_array('commentsdiv', $hidden) ) { |
|
488 ?> |
|
489 <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script> |
|
490 <?php |
|
491 } |
|
492 |
|
493 ?> |
|
494 <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p> |
|
495 <?php |
400 } |
496 } |
401 |
497 |
402 wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); |
|
403 ?> |
|
404 |
|
405 <table class="widefat comments-box fixed" cellspacing="0" style="display:none;"> |
|
406 <thead><tr> |
|
407 <th scope="col" class="column-author"><?php _e('Author') ?></th> |
|
408 <th scope="col" class="column-comment"> |
|
409 <?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th> |
|
410 </tr></thead> |
|
411 <tbody id="the-comment-list" class="list:comment"></tbody> |
|
412 </table> |
|
413 <p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" /></p> |
|
414 <?php |
|
415 $hidden = get_hidden_meta_boxes('post'); |
|
416 if ( ! in_array('commentsdiv', $hidden) ) { ?> |
|
417 <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script> |
|
418 <?php |
|
419 } |
|
420 wp_comment_trashnotice(); |
498 wp_comment_trashnotice(); |
421 } |
499 } |
422 |
500 |
423 |
|
424 /** |
501 /** |
425 * Display slug form fields. |
502 * Display slug form fields. |
426 * |
503 * |
427 * @since 2.6.0 |
504 * @since 2.6.0 |
428 * |
505 * |
429 * @param object $post |
506 * @param object $post |
430 */ |
507 */ |
431 function post_slug_meta_box($post) { |
508 function post_slug_meta_box($post) { |
432 ?> |
509 ?> |
433 <label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $post->post_name ); ?>" /> |
510 <label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( apply_filters('editable_slug', $post->post_name) ); ?>" /> |
434 <?php |
511 <?php |
435 } |
512 } |
436 |
|
437 |
513 |
438 /** |
514 /** |
439 * Display form field with list of authors. |
515 * Display form field with list of authors. |
440 * |
516 * |
441 * @since 2.6.0 |
517 * @since 2.6.0 |
442 * |
518 * |
443 * @param object $post |
519 * @param object $post |
444 */ |
520 */ |
445 function post_author_meta_box($post) { |
521 function post_author_meta_box($post) { |
446 global $current_user, $user_ID; |
522 global $user_ID; |
447 $authors = get_editable_user_ids( $current_user->id, true, $post->post_type ); // TODO: ROLE SYSTEM |
523 ?> |
448 if ( $post->post_author && !in_array($post->post_author, $authors) ) |
524 <label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label> |
449 $authors[] = $post->post_author; |
525 <?php |
450 ?> |
526 wp_dropdown_users( array( |
451 <label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> |
527 'who' => 'authors', |
452 <?php |
528 'name' => 'post_author_override', |
453 } |
529 'selected' => empty($post->ID) ? $user_ID : $post->post_author, |
454 |
530 'include_selected' => true |
|
531 ) ); |
|
532 } |
455 |
533 |
456 /** |
534 /** |
457 * Display list of revisions. |
535 * Display list of revisions. |
458 * |
536 * |
459 * @since 2.6.0 |
537 * @since 2.6.0 |
462 */ |
540 */ |
463 function post_revisions_meta_box($post) { |
541 function post_revisions_meta_box($post) { |
464 wp_list_post_revisions(); |
542 wp_list_post_revisions(); |
465 } |
543 } |
466 |
544 |
467 |
|
468 // -- Page related Meta Boxes |
545 // -- Page related Meta Boxes |
469 |
546 |
470 /** |
547 /** |
471 * Display page attributes form fields. |
548 * Display page attributes form fields. |
472 * |
549 * |
473 * @since 2.7.0 |
550 * @since 2.7.0 |
474 * |
551 * |
475 * @param object $post |
552 * @param object $post |
476 */ |
553 */ |
477 function page_attributes_meta_box($post){ |
554 function page_attributes_meta_box($post) { |
478 ?> |
555 $post_type_object = get_post_type_object($post->post_type); |
479 <h5><?php _e('Parent') ?></h5> |
556 if ( $post_type_object->hierarchical ) { |
480 <label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label> |
557 $dropdown_args = array( |
481 <?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')); ?> |
558 'post_type' => $post->post_type, |
482 <p><?php _e('You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p> |
559 'exclude_tree' => $post->ID, |
483 <?php |
560 'selected' => $post->post_parent, |
484 if ( 0 != count( get_page_templates() ) ) { ?> |
561 'name' => 'parent_id', |
485 <h5><?php _e('Template') ?></h5> |
562 'show_option_none' => __('(no parent)'), |
|
563 'sort_column' => 'menu_order, post_title', |
|
564 'echo' => 0, |
|
565 ); |
|
566 |
|
567 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); |
|
568 $pages = wp_dropdown_pages( $dropdown_args ); |
|
569 if ( ! empty($pages) ) { |
|
570 ?> |
|
571 <p><strong><?php _e('Parent') ?></strong></p> |
|
572 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label> |
|
573 <?php echo $pages; ?> |
|
574 <?php |
|
575 } // end empty pages check |
|
576 } // end hierarchical check. |
|
577 if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) { |
|
578 $template = !empty($post->page_template) ? $post->page_template : false; |
|
579 ?> |
|
580 <p><strong><?php _e('Template') ?></strong></p> |
486 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template"> |
581 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template"> |
487 <option value='default'><?php _e('Default Template'); ?></option> |
582 <option value='default'><?php _e('Default Template'); ?></option> |
488 <?php page_template_dropdown($post->page_template); ?> |
583 <?php page_template_dropdown($template); ?> |
489 </select> |
584 </select> |
490 <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’ll see them above.'); ?></p> |
|
491 <?php |
585 <?php |
492 } ?> |
586 } ?> |
493 <h5><?php _e('Order') ?></h5> |
587 <p><strong><?php _e('Order') ?></strong></p> |
494 <p><label class="screen-reader-text" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p> |
588 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p> |
495 <p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in.'); ?></p> |
589 <p><?php if ( 'page' == $post->post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p> |
496 <?php |
590 <?php |
497 } |
591 } |
498 |
|
499 |
592 |
500 // -- Link related Meta Boxes |
593 // -- Link related Meta Boxes |
501 |
594 |
502 /** |
595 /** |
503 * Display link create form fields. |
596 * Display link create form fields. |
556 <div class="clear"></div> |
649 <div class="clear"></div> |
557 </div> |
650 </div> |
558 <?php |
651 <?php |
559 } |
652 } |
560 |
653 |
561 |
|
562 /** |
654 /** |
563 * Display link categories form fields. |
655 * Display link categories form fields. |
564 * |
656 * |
565 * @since 2.6.0 |
657 * @since 2.6.0 |
566 * |
658 * |
567 * @param object $link |
659 * @param object $link |
568 */ |
660 */ |
569 function link_categories_meta_box($link) { ?> |
661 function link_categories_meta_box($link) { |
570 <ul id="category-tabs"> |
662 ?> |
571 <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li> |
663 <div id="taxonomy-linkcategory" class="categorydiv"> |
572 <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li> |
664 <ul id="category-tabs" class="category-tabs"> |
573 </ul> |
665 <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li> |
574 |
666 <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li> |
575 <div id="categories-all" class="tabs-panel"> |
|
576 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> |
|
577 <?php |
|
578 if ( isset($link->link_id) ) |
|
579 wp_link_category_checklist($link->link_id); |
|
580 else |
|
581 wp_link_category_checklist(); |
|
582 ?> |
|
583 </ul> |
667 </ul> |
584 </div> |
668 |
585 |
669 <div id="categories-all" class="tabs-panel"> |
586 <div id="categories-pop" class="tabs-panel" style="display: none;"> |
670 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> |
587 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear"> |
671 <?php |
588 <?php wp_popular_terms_checklist('link_category'); ?> |
672 if ( isset($link->link_id) ) |
589 </ul> |
673 wp_link_category_checklist($link->link_id); |
590 </div> |
674 else |
591 |
675 wp_link_category_checklist(); |
592 <div id="category-adder" class="wp-hidden-children"> |
676 ?> |
593 <h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4> |
677 </ul> |
594 <p id="link-category-add" class="wp-hidden-child"> |
678 </div> |
595 <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label> |
679 |
596 <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" /> |
680 <div id="categories-pop" class="tabs-panel" style="display: none;"> |
597 <input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" /> |
681 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear"> |
598 <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?> |
682 <?php wp_popular_terms_checklist('link_category'); ?> |
599 <span id="category-ajax-response"></span> |
683 </ul> |
600 </p> |
684 </div> |
601 </div> |
685 |
602 <?php |
686 <div id="category-adder" class="wp-hidden-children"> |
603 } |
687 <h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4> |
604 |
688 <p id="link-category-add" class="wp-hidden-child"> |
|
689 <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label> |
|
690 <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" /> |
|
691 <input type="button" id="link-category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" /> |
|
692 <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?> |
|
693 <span id="category-ajax-response"></span> |
|
694 </p> |
|
695 </div> |
|
696 </div> |
|
697 <?php |
|
698 } |
605 |
699 |
606 /** |
700 /** |
607 * Display form fields for changing link target. |
701 * Display form fields for changing link target. |
608 * |
702 * |
609 * @since 2.6.0 |
703 * @since 2.6.0 |
612 */ |
706 */ |
613 function link_target_meta_box($link) { ?> |
707 function link_target_meta_box($link) { ?> |
614 <fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend> |
708 <fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend> |
615 <p><label for="link_target_blank" class="selectit"> |
709 <p><label for="link_target_blank" class="selectit"> |
616 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> /> |
710 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> /> |
617 <?php _e('<code>_blank</code> - new window or tab.'); ?></label></p> |
711 <?php _e('<code>_blank</code> — new window or tab.'); ?></label></p> |
618 <p><label for="link_target_top" class="selectit"> |
712 <p><label for="link_target_top" class="selectit"> |
619 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> /> |
713 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> /> |
620 <?php _e('<code>_top</code> - current window or tab, with no frames.'); ?></label></p> |
714 <?php _e('<code>_top</code> — current window or tab, with no frames.'); ?></label></p> |
621 <p><label for="link_target_none" class="selectit"> |
715 <p><label for="link_target_none" class="selectit"> |
622 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> /> |
716 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> /> |
623 <?php _e('<code>_none</code> - same window or tab.'); ?></label></p> |
717 <?php _e('<code>_none</code> — same window or tab.'); ?></label></p> |
624 </fieldset> |
718 </fieldset> |
625 <p><?php _e('Choose the target frame for your link.'); ?></p> |
719 <p><?php _e('Choose the target frame for your link.'); ?></p> |
626 <?php |
720 <?php |
627 } |
721 } |
628 |
722 |
629 |
|
630 /** |
723 /** |
631 * Display checked checkboxes attribute for xfn microformat options. |
724 * Display checked checkboxes attribute for xfn microformat options. |
632 * |
725 * |
633 * @since 1.0.1 |
726 * @since 1.0.1 |
634 * |
727 * |
635 * @param string $class |
728 * @param string $class |
636 * @param string $value |
729 * @param string $value |
637 * @param mixed $deprecated Not used. |
730 * @param mixed $deprecated Never used. |
638 */ |
731 */ |
639 function xfn_check($class, $value = '', $deprecated = '') { |
732 function xfn_check( $class, $value = '', $deprecated = '' ) { |
640 global $link; |
733 global $link; |
|
734 |
|
735 if ( !empty( $deprecated ) ) |
|
736 _deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented |
641 |
737 |
642 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; |
738 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; |
643 $rels = preg_split('/\s+/', $link_rel); |
739 $rels = preg_split('/\s+/', $link_rel); |
644 |
740 |
645 if ('' != $value && in_array($value, $rels) ) { |
741 if ('' != $value && in_array($value, $rels) ) { |
652 if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"'; |
748 if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"'; |
653 if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"'; |
749 if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"'; |
654 } |
750 } |
655 } |
751 } |
656 |
752 |
657 |
|
658 /** |
753 /** |
659 * Display xfn form fields. |
754 * Display xfn form fields. |
660 * |
755 * |
661 * @since 2.6.0 |
756 * @since 2.6.0 |
662 * |
757 * |
663 * @param object $link |
758 * @param object $link |
664 */ |
759 */ |
665 function link_xfn_meta_box($link) { |
760 function link_xfn_meta_box($link) { |
666 ?> |
761 ?> |
667 <table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5"> |
762 <table class="links-table" cellspacing="0"> |
668 <tr> |
763 <tr> |
669 <th style="width: 20%;" scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th> |
764 <th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th> |
670 <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td> |
765 <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td> |
671 </tr> |
766 </tr> |
672 <tr> |
767 <tr> |
673 <td colspan="2"> |
768 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></th> |
674 <table cellpadding="3" cellspacing="5" class="form-table"> |
769 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></span></legend> |
675 <tr> |
770 <label for="me"> |
676 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </th> |
771 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> /> |
677 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </span></legend> |
772 <?php _e('another web address of mine') ?></label> |
678 <label for="me"> |
773 </fieldset></td> |
679 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> /> |
774 </tr> |
680 <?php _e('another web address of mine') ?></label> |
775 <tr> |
681 </fieldset></td> |
776 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></th> |
682 </tr> |
777 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></span></legend> |
683 <tr> |
778 <label for="contact"> |
684 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th> |
779 <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?> |
685 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend> |
780 </label> |
686 <label for="contact"> |
781 <label for="acquaintance"> |
687 <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label> |
782 <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?> |
688 <label for="acquaintance"> |
783 </label> |
689 <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label> |
784 <label for="friend"> |
690 <label for="friend"> |
785 <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?> |
691 <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label> |
786 </label> |
692 <label for="friendship"> |
787 <label for="friendship"> |
693 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label> |
788 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?> |
694 </fieldset></td> |
789 </label> |
695 </tr> |
790 </fieldset></td> |
696 <tr> |
791 </tr> |
697 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th> |
792 <tr> |
698 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </span></legend> |
793 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th> |
699 <label for="met"> |
794 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?></span></legend> |
700 <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> /> |
795 <label for="met"> |
701 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?></label> |
796 <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?> |
702 </fieldset></td> |
797 </label> |
703 </tr> |
798 </fieldset></td> |
704 <tr> |
799 </tr> |
705 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th> |
800 <tr> |
706 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </span></legend> |
801 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th> |
707 <label for="co-worker"> |
802 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?></span></legend> |
708 <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> /> |
803 <label for="co-worker"> |
709 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?></label> |
804 <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?> |
710 <label for="colleague"> |
805 </label> |
711 <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> /> |
806 <label for="colleague"> |
712 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?></label> |
807 <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?> |
713 </fieldset></td> |
808 </label> |
714 </tr> |
809 </fieldset></td> |
715 <tr> |
810 </tr> |
716 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th> |
811 <tr> |
717 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend> |
812 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?></th> |
718 <label for="co-resident"> |
813 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend> |
719 <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> /> |
814 <label for="co-resident"> |
720 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label> |
815 <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?> |
721 <label for="neighbor"> |
816 </label> |
722 <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> /> |
817 <label for="neighbor"> |
723 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label> |
818 <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?> |
724 <label for="geographical"> |
819 </label> |
725 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> /> |
820 <label for="geographical"> |
726 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label> |
821 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?> |
727 </fieldset></td> |
822 </label> |
728 </tr> |
823 </fieldset></td> |
729 <tr> |
824 </tr> |
730 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th> |
825 <tr> |
731 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend> |
826 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?></th> |
732 <label for="child"> |
827 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend> |
733 <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> /> |
828 <label for="child"> |
734 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label> |
829 <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?> |
735 <label for="kin"> |
830 </label> |
736 <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> /> |
831 <label for="kin"> |
737 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label> |
832 <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?> |
738 <label for="parent"> |
833 </label> |
739 <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> /> |
834 <label for="parent"> |
740 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label> |
835 <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?> |
741 <label for="sibling"> |
836 </label> |
742 <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> /> |
837 <label for="sibling"> |
743 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label> |
838 <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?> |
744 <label for="spouse"> |
839 </label> |
745 <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> /> |
840 <label for="spouse"> |
746 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label> |
841 <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?> |
747 <label for="family"> |
842 </label> |
748 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> /> |
843 <label for="family"> |
749 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label> |
844 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?> |
750 </fieldset></td> |
845 </label> |
751 </tr> |
846 </fieldset></td> |
752 <tr> |
847 </tr> |
753 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </th> |
848 <tr> |
754 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend> |
849 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?></th> |
755 <label for="muse"> |
850 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend> |
756 <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> /> |
851 <label for="muse"> |
757 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?></label> |
852 <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?> |
758 <label for="crush"> |
853 </label> |
759 <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> /> |
854 <label for="crush"> |
760 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?></label> |
855 <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?> |
761 <label for="date"> |
856 </label> |
762 <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> /> |
857 <label for="date"> |
763 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?></label> |
858 <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?> |
764 <label for="romantic"> |
859 </label> |
765 <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> /> |
860 <label for="romantic"> |
766 <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?></label> |
861 <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?> |
767 </fieldset></td> |
862 </label> |
768 </tr> |
863 </fieldset></td> |
769 </table> |
864 </tr> |
770 </td> |
865 |
771 </tr> |
|
772 </table> |
866 </table> |
773 <p><?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 <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p> |
867 <p><?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 <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p> |
774 <?php |
868 <?php |
775 } |
869 } |
776 |
870 |
777 |
|
778 /** |
871 /** |
779 * Display advanced link options form fields. |
872 * Display advanced link options form fields. |
780 * |
873 * |
781 * @since 2.6.0 |
874 * @since 2.6.0 |
782 * |
875 * |
783 * @param object $link |
876 * @param object $link |
784 */ |
877 */ |
785 function link_advanced_meta_box($link) { |
878 function link_advanced_meta_box($link) { |
786 ?> |
879 ?> |
787 <table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5"> |
880 <table class="links-table" cellpadding="0"> |
788 <tr class="form-field"> |
881 <tr> |
789 <th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th> |
882 <th scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th> |
790 <td><input type="text" name="link_image" class="code" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" style="width: 95%" /></td> |
883 <td><input type="text" name="link_image" class="code" id="link_image" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" /></td> |
791 </tr> |
884 </tr> |
792 <tr class="form-field"> |
885 <tr> |
793 <th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th> |
886 <th scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th> |
794 <td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" size="50" style="width: 95%" /></td> |
887 <td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" /></td> |
795 </tr> |
888 </tr> |
796 <tr class="form-field"> |
889 <tr> |
797 <th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th> |
890 <th scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th> |
798 <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td> |
891 <td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td> |
799 </tr> |
892 </tr> |
800 <tr class="form-field"> |
893 <tr> |
801 <th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th> |
894 <th scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th> |
802 <td><select name="link_rating" id="link_rating" size="1"> |
895 <td><select name="link_rating" id="link_rating" size="1"> |
803 <?php |
896 <?php |
804 for ($r = 0; $r <= 10; $r++) { |
897 for ( $r = 0; $r <= 10; $r++ ) { |
805 echo(' <option value="'. esc_attr($r) .'" '); |
898 echo '<option value="' . $r . '"'; |
806 if ( isset($link->link_rating) && $link->link_rating == $r) |
899 if ( isset($link->link_rating) && $link->link_rating == $r ) |
807 echo 'selected="selected"'; |
900 echo ' selected="selected"'; |
808 echo('>'.$r.'</option>'); |
901 echo('>' . $r . '</option>'); |
809 } |
902 } |
810 ?></select> <?php _e('(Leave at 0 for no rating.)') ?> |
903 ?></select> <?php _e('(Leave at 0 for no rating.)') ?> |
811 </td> |
904 </td> |
812 </tr> |
905 </tr> |
813 </table> |
906 </table> |