Changeset 15278 for trunk/wp-admin/includes/template.php
- Timestamp:
- 06/19/2010 05:32:01 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r15253 r15278 103 103 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 104 104 if ( $default_cat_id != $category->term_id ) 105 $actions['delete'] = "<a class='delete:the-list:link-cat-$category->term_id submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "'>" . __('Delete') . "</a>";105 $actions['delete'] = "<a class='delete:the-list:link-cat-$category->term_id submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "'>" . __('Delete') . '</a>'; 106 106 $actions = apply_filters('link_cat_row_actions', $actions, $category); 107 107 $action_count = count($actions); … … 156 156 break; 157 157 case 'slug': 158 $output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";158 $output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . '</td>'; 159 159 break; 160 160 case 'links': … … 234 234 'walker' => $walker, 235 235 'checked_ontop' => $checked_ontop 236 236 )); 237 237 } 238 238 … … 289 289 $keys = array_keys( $categories ); 290 290 291 foreach ( $keys as $k ) {291 foreach ( $keys as $k ) { 292 292 if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) { 293 293 $checked_categories[] = $categories[$k]; … … 341 341 <li id="<?php echo $id; ?>" class="popular-category"> 342 342 <label class="selectit"> 343 <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php echo $disabled ?>/>343 <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php echo $disabled; ?>/> 344 344 <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?> 345 345 </label> … … 450 450 } 451 451 if ( current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term ) 452 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>";452 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . '</a>'; 453 453 454 454 $actions = apply_filters('tag_row_actions', $actions, $tag); … … 473 473 break; 474 474 case 'slug': 475 $out .= "<td $attributes>" . apply_filters('editable_slug', $tag->slug) . "</td>";475 $out .= "<td $attributes>" . apply_filters('editable_slug', $tag->slug) . '</td>'; 476 476 break; 477 477 case 'posts': … … 531 531 } else { 532 532 $terms = get_terms( $taxonomy, $args ); 533 foreach ( $terms as $term )533 foreach ( $terms as $term ) 534 534 $out .= _tag_row( $term, 0, $taxonomy ); 535 535 $count = $pagesize; // Only displaying a single page. … … 570 570 $num_parents = count($my_parents); 571 571 while ( $my_parent = array_pop($my_parents) ) { 572 $output .= 572 $output .= "\t" . _tag_row( $my_parent, $level - $num_parents, $taxonomy ); 573 573 $num_parents--; 574 574 } … … 804 804 805 805 /** 806 * Register column headers for a particular screen. 806 * Register column headers for a particular screen. The header names will be listed in the Screen Options. 807 807 * 808 808 * @since 2.7.0 809 809 * 810 * @param string $screen The handle for the screen to add help to. 810 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. 811 811 * @param array $columns An array of columns with column IDs as the keys and translated column names as the values 812 812 * @see get_column_headers(), print_column_headers(), get_hidden_columns() … … 941 941 942 942 endif; // authors 943 ?> 944 945 <?php if ( !$bulk ) echo $authors_dropdown; 946 endif; // post_type_supports author 943 if ( !$bulk ) // On bulk views, this is used further down 944 echo $authors_dropdown; 945 endif; // post_type_supports author 947 946 948 947 if ( !$bulk ) : … … 977 976 <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?> 978 977 979 <span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->labels->name) ?>978 <span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->labels->name); ?> 980 979 <span class="catshow"><?php _e('[more]'); ?></span> 981 980 <span class="cathide" style="display:none;"><?php _e('[less]'); ?></span> … … 983 982 <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr($taxonomy->name) . '][]'; ?>" value="0" /> 984 983 <ul class="cat-checklist <?php echo esc_attr($taxonomy->name)?>-checklist"> 985 <?php wp_terms_checklist(null, array('taxonomy' => $taxonomy->name)) ?>984 <?php wp_terms_checklist(null, array('taxonomy' => $taxonomy->name)); ?> 986 985 </ul> 987 986 … … 1006 1005 $dropdown_args = array('post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __('Main Page (no parent)'), 'option_none_value' => 0, 'sort_column'=> 'menu_order, post_title'); 1007 1006 if ( $bulk ) 1008 $dropdown_args['show_option_no_change'] = 1007 $dropdown_args['show_option_no_change'] = __('— No Change —'); 1009 1008 $dropdown_args = apply_filters('quick_edit_dropdown_pages_args', $dropdown_args); 1010 1009 wp_dropdown_pages($dropdown_args); … … 1017 1016 <label> 1018 1017 <span class="title"><?php _e( 'Order' ); ?></span> 1019 <span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order ?>" /></span>1018 <span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order; ?>" /></span> 1020 1019 </label> 1021 1020 … … 1029 1028 <?php endif; // $bulk ?> 1030 1029 <option value="default"><?php _e( 'Default Template' ); ?></option> 1031 <?php page_template_dropdown() ?>1030 <?php page_template_dropdown(); ?> 1032 1031 </select> 1033 1032 </label> … … 1042 1041 1043 1042 <label class="inline-edit-tags"> 1044 <span class="title"><?php echo esc_html($taxonomy->labels->name) ?></span>1045 <textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr($taxonomy->name) ?>]" class="tax_input_<?php echo esc_attr($taxonomy->name)?>"></textarea>1043 <span class="title"><?php echo esc_html($taxonomy->labels->name); ?></span> 1044 <textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr($taxonomy->name); ?>]" class="tax_input_<?php echo esc_attr($taxonomy->name); ?>"></textarea> 1046 1045 </label> 1047 1046 1048 1047 <?php endforeach; //$flat_taxonomies as $taxonomy ?> 1049 1048 1050 <?php endif; // count($flat_taxonomies) && !$bulk 1049 <?php endif; // count($flat_taxonomies) && !$bulk ?> 1051 1050 1052 1051 <?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) : … … 1105 1104 <option value="future"><?php _e( 'Scheduled' ); ?></option> 1106 1105 <?php if ( $bulk ) : ?> 1107 <option value="private"><?php _e('Private') ?></option>1106 <option value="private"><?php _e('Private'); ?></option> 1108 1107 <?php endif; // $bulk ?> 1109 1108 <?php endif; ?> … … 1343 1342 $attributes = 'class="post-title column-title"' . $style; 1344 1343 ?> 1345 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title?></a><?php } else { echo $title; }; _post_states($post); ?></strong>1344 <td <?php echo $attributesl ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $titlel ?></a><?php } else { echo $title; }; _post_states($post); ?></strong> 1346 1345 <?php 1347 1346 if ( 'excerpt' == $mode ) … … 1355 1354 if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) { 1356 1355 if ( 'trash' == $post->post_status ) 1357 $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url( admin_url( sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __('Restore') . "</a>";1356 $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url( admin_url( sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __('Restore') . '</a>'; 1358 1357 elseif ( EMPTY_TRASH_DAYS ) 1359 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";1358 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . '</a>'; 1360 1359 if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) 1361 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>";1360 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . '</a>'; 1362 1361 } 1363 1362 if ( in_array($post->post_status, array('pending', 'draft')) ) { … … 1386 1385 case 'categories': 1387 1386 ?> 1388 <td <?php echo $attributes ?>><?php1387 <td <?php echo $attributes; ?>><?php 1389 1388 $categories = get_the_category(); 1390 1389 if ( !empty( $categories ) ) { 1391 1390 $out = array(); 1392 1391 foreach ( $categories as $c ) 1393 $out[] = "<a href='edit.php?category_name=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";1392 $out[] = "<a href='edit.php?category_name=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . '</a>'; 1394 1393 echo join( ', ', $out ); 1395 1394 } else { … … 1402 1401 case 'tags': 1403 1402 ?> 1404 <td <?php echo $attributes ?>><?php1403 <td <?php echo $attributes; ?>><?php 1405 1404 $tags = get_the_tags($post->ID); 1406 1405 if ( !empty( $tags ) ) { 1407 1406 $out = array(); 1408 1407 foreach ( $tags as $c ) 1409 $out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";1408 $out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . '</a>'; 1410 1409 echo join( ', ', $out ); 1411 1410 } else { … … 1418 1417 case 'comments': 1419 1418 ?> 1420 <td <?php echo $attributes ?>><div class="post-com-count-wrapper">1419 <td <?php echo $attributes; ?>><div class="post-com-count-wrapper"> 1421 1420 <?php 1422 1421 $pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) ); … … 1433 1432 case 'author': 1434 1433 ?> 1435 <td <?php echo $attributes ?>><a href="edit.php?post_type=<?php echo $post->post_type; ?>&author=<?php the_author_meta('ID'); ?>"><?php the_author()?></a></td>1434 <td <?php echo $attributes; ?>><a href="edit.php?post_type=<?php echo $post->post_type; ?>&author=<?php the_author_meta('ID'); ?>"><?php the_author(); ?></a></td> 1436 1435 <?php 1437 1436 break; … … 1445 1444 case 'control_edit': 1446 1445 ?> 1447 <td><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td>1446 <td><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . '</a>'; } ?></td> 1448 1447 <?php 1449 1448 break; … … 1451 1450 case 'control_delete': 1452 1451 ?> 1453 <td><?php if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td>1452 <td><?php if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . '</a>'; } ?></td> 1454 1453 <?php 1455 1454 break; … … 1457 1456 default: 1458 1457 ?> 1459 <td <?php echo $attributes ?>><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></td>1458 <td <?php echo $attributes; ?>><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></td> 1460 1459 <?php 1461 1460 break; … … 1509 1508 $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; 1510 1509 $posts_columns = get_column_headers( $current_screen ); 1511 $hidden = get_hidden_columns( 1510 $hidden = get_hidden_columns( $current_screen ); 1512 1511 $title = _draft_or_post_title(); 1513 1512 $post_type = $page->post_type; … … 1568 1567 $edit_link = get_edit_post_link( $page->ID ); 1569 1568 ?> 1570 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name) : ''; ?></strong>1569 <td <?php echo $attributes; ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title; ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name) : ''; ?></strong> 1571 1570 <?php 1572 1571 $actions = array(); … … 1577 1576 if ( current_user_can($post_type_object->cap->delete_post, $page->ID) ) { 1578 1577 if ( $post->post_status == 'trash' ) 1579 $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=untrash&post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID) . "'>" . __('Restore') . "</a>";1578 $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=untrash&post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID) . "'>" . __('Restore') . '</a>'; 1580 1579 elseif ( EMPTY_TRASH_DAYS ) 1581 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";1580 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . '</a>'; 1582 1581 if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS ) 1583 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=delete&post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";1582 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=delete&post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . '</a>'; 1584 1583 } 1585 1584 if ( in_array($post->post_status, array('pending', 'draft')) ) { … … 1607 1606 case 'comments': 1608 1607 ?> 1609 <td <?php echo $attributes ?>><div class="post-com-count-wrapper">1608 <td <?php echo $attributes; ?>><div class="post-com-count-wrapper"> 1610 1609 <?php 1611 1610 $left = get_pending_comments_num( $page->ID ); … … 1623 1622 case 'author': 1624 1623 ?> 1625 <td <?php echo $attributes ?>><a href="edit.php?post_type=<?php echo $post_type; ?>&author=<?php the_author_meta('ID'); ?>"><?php the_author()?></a></td>1624 <td <?php echo $attributes; ?>><a href="edit.php?post_type=<?php echo $post_type; ?>&author=<?php the_author_meta('ID'); ?>"><?php the_author(); ?></a></td> 1626 1625 <?php 1627 1626 break; … … 1629 1628 default: 1630 1629 ?> 1631 <td <?php echo $attributes ?>><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td>1630 <td <?php echo $attributes; ?>><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td> 1632 1631 <?php 1633 1632 break; … … 1714 1713 1715 1714 // if it is the last pagenum and there are orphaned pages, display them with paging as well 1716 if ( isset($children_pages) && $count < $end ) {1717 foreach ( $children_pages as $orphans ){1715 if ( isset($children_pages) && $count < $end ) { 1716 foreach ( $children_pages as $orphans ) { 1718 1717 foreach ( $orphans as $op ) { 1719 1718 if ( $count >= $end ) … … 1765 1764 } 1766 1765 $num_parents = count($my_parents); 1767 while ( $my_parent = array_pop($my_parents) ) {1766 while ( $my_parent = array_pop($my_parents) ) { 1768 1767 echo "\t" . display_page_row( $my_parent, $level - $num_parents ); 1769 1768 $num_parents--; … … 1788 1787 * 1789 1788 * @param object $user_object 1790 * @param string $style Optional. Attributes added to the TR element. 1789 * @param string $style Optional. Attributes added to the TR element. Must be sanitized. 1791 1790 * @param string $role Key for the $wp_roles array. 1792 * @param int $numposts Optional. Post count to display for this user. 1791 * @param int $numposts Optional. Post count to display for this user. Defaults to zero, as in, a new user has made zero posts. 1793 1792 * @return string 1794 1793 */ … … 1824 1823 $actions = array(); 1825 1824 1826 if ( current_user_can('edit_user', 1825 if ( current_user_can('edit_user', $user_object->ID) ) { 1827 1826 $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />"; 1828 1827 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 1832 1831 1833 1832 if ( !is_multisite() && $current_user->ID != $user_object->ID && current_user_can('delete_user', $user_object->ID) ) 1834 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&user=$user_object->ID", 'bulk-users') . "'>" . __('Delete') . "</a>";1833 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&user=$user_object->ID", 'bulk-users') . "'>" . __('Delete') . '</a>'; 1835 1834 if ( is_multisite() && $current_user->ID != $user_object->ID && current_user_can('remove_user', $user_object->ID) ) 1836 $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=remove&user=$user_object->ID", 'bulk-users') . "'>" . __('Remove') . "</a>";1835 $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=remove&user=$user_object->ID", 'bulk-users') . "'>" . __('Remove') . '</a>'; 1837 1836 $actions = apply_filters('user_row_actions', $actions, $user_object); 1838 1837 $action_count = count($actions); … … 2251 2250 <div id="edithead" style="display:none;"> 2252 2251 <div class="inside"> 2253 <label for="author"><?php _e('Name') ?></label>2252 <label for="author"><?php _e('Name'); ?></label> 2254 2253 <input type="text" name="newcomment_author" size="50" value="" tabindex="101" id="author" /> 2255 2254 </div> 2256 2255 2257 2256 <div class="inside"> 2258 <label for="author-email"><?php _e('E-mail') ?></label>2257 <label for="author-email"><?php _e('E-mail'); ?></label> 2259 2258 <input type="text" name="newcomment_author_email" size="50" value="" tabindex="102" id="author-email" /> 2260 2259 </div> 2261 2260 2262 2261 <div class="inside"> 2263 <label for="author-url"><?php _e('URL') ?></label>2262 <label for="author-url"><?php _e('URL'); ?></label> 2264 2263 <input type="text" id="author-url" name="newcomment_author_url" size="103" value="" tabindex="103" /> 2265 2264 </div> … … 2343 2342 <thead> 2344 2343 <tr> 2345 <th class="left"><?php _e( 'Name' ) ?></th>2346 <th><?php _e( 'Value' ) ?></th>2344 <th class="left"><?php _e( 'Name' ); ?></th> 2345 <th><?php _e( 'Value' ); ?></th> 2347 2346 </tr> 2348 2347 </thead> … … 2428 2427 natcasesort($keys); 2429 2428 ?> 2430 <p><strong><?php _e( 'Add New Custom Field:' ) ?></strong></p>2429 <p><strong><?php _e( 'Add New Custom Field:' ); ?></strong></p> 2431 2430 <table id="newmeta"> 2432 2431 <thead> 2433 2432 <tr> 2434 2433 <th class="left"><label for="metakeyselect"><?php _e( 'Name' ) ?></label></th> 2435 <th><label for="metavalue"><?php _e( 'Value' ) ?></label></th>2434 <th><label for="metavalue"><?php _e( 'Value' ); ?></label></th> 2436 2435 </tr> 2437 2436 </thead> … … 2446 2445 2447 2446 foreach ( $keys as $key ) { 2448 echo "\n<option value='" . esc_attr($key) . "'>" . esc_html($key) . "</option>";2447 echo "\n<option value='" . esc_attr($key) . "'>" . esc_html($key) . '</option>'; 2449 2448 } 2450 2449 ?> … … 2462 2461 2463 2462 <tr><td colspan="2" class="submit"> 2464 <input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php esc_attr_e( 'Add Custom Field' ) ?>" />2463 <input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php esc_attr_e( 'Add Custom Field' ); ?>" /> 2465 2464 <?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?> 2466 2465 </td></tr> … … 2592 2591 $current = ''; 2593 2592 2594 echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>";2593 echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . '</option>'; 2595 2594 parent_dropdown( $default, $item->ID, $level +1 ); 2596 2595 } … … 2624 2623 <col class="widefat" /> 2625 2624 <tr> 2626 <th scope="row"><?php _e( 'URL' ) ?></th>2625 <th scope="row"><?php _e( 'URL' ); ?></th> 2627 2626 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo wp_get_attachment_url(); ?></textarea></td> 2628 2627 </tr> … … 2630 2629 <tr> 2631 2630 <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to file' ) : _e( 'Image linked to file' ); ?></th> 2632 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $icon ?></a></textarea></td>2631 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $icon; ?></a></textarea></td> 2633 2632 </tr> 2634 2633 <tr> 2635 2634 <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to page' ); ?></th> 2636 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon?></a></textarea></td>2635 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ); ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon; ?></a></textarea></td> 2637 2636 </tr> 2638 2637 <?php else : ?> 2639 2638 <tr> 2640 <th scope="row"><?php _e( 'Link to file' ) ?></th>2639 <th scope="row"><?php _e( 'Link to file' ); ?></th> 2641 2640 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() ); ?></a></textarea></td> 2642 2641 </tr> 2643 2642 <tr> 2644 <th scope="row"><?php _e( 'Link to page' ) ?></th>2645 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID?>"><?php the_title(); ?></a></textarea></td>2643 <th scope="row"><?php _e( 'Link to page' ); ?></th> 2644 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ); ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php the_title(); ?></a></textarea></td> 2646 2645 </tr> 2647 2646 <?php endif; ?> … … 2782 2781 2783 2782 foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) { 2784 foreach ( array('high', 'core', 'default', 'low') as $a_priority ) { 2785 if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) ) 2786 continue; 2787 2788 // If a core box was previously added or removed by a plugin, don't add. 2789 if ( 'core' == $priority ) { 2790 // If core box previously deleted, don't add 2791 if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] ) 2783 foreach ( array('high', 'core', 'default', 'low') as $a_priority ) { 2784 if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) ) 2785 continue; 2786 2787 // If a core box was previously added or removed by a plugin, don't add. 2788 if ( 'core' == $priority ) { 2789 // If core box previously deleted, don't add 2790 if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] ) 2791 return; 2792 // If box was added with default priority, give it core priority to maintain sort order 2793 if ( 'default' == $a_priority ) { 2794 $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id]; 2795 unset($wp_meta_boxes[$page][$a_context]['default'][$id]); 2796 } 2792 2797 return; 2793 // If box was added with default priority, give it core priority to maintain sort order2794 if ( 'default' == $a_priority ) {2795 $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];2796 unset($wp_meta_boxes[$page][$a_context]['default'][$id]);2797 2798 } 2798 return; 2799 // If no priority given and id already present, use existing priority 2800 if ( empty($priority) ) { 2801 $priority = $a_priority; 2802 // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority. 2803 } elseif ( 'sorted' == $priority ) { 2804 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; 2805 $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback']; 2806 $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args']; 2807 } 2808 // An id can be in only one priority and one context 2809 if ( $priority != $a_priority || $context != $a_context ) 2810 unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]); 2799 2811 } 2800 // If no priority given and id already present, use existing priority2801 if ( empty($priority) ) {2802 $priority = $a_priority;2803 // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.2804 } elseif ( 'sorted' == $priority ) {2805 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];2806 $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];2807 $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];2808 }2809 // An id can be in only one priority and one context2810 if ( $priority != $a_priority || $context != $a_context )2811 unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);2812 }2813 2812 } 2814 2813 … … 2874 2873 } while(0); 2875 2874 2876 echo "</div>";2875 echo '</div>'; 2877 2876 2878 2877 return $i; … … 3155 3154 * @return array Array of settings errors 3156 3155 */ 3157 function get_settings_errors( $setting = '', $sanitize = FALSE) {3156 function get_settings_errors( $setting = '', $sanitize = false ) { 3158 3157 global $wp_settings_errors; 3159 3158 … … 3206 3205 * @return <type> 3207 3206 */ 3208 function settings_errors ( $setting = '', $sanitize = FALSE, $hide_on_update = FALSE ) { 3209 3210 if ($hide_on_update AND $_GET['updated']) return; 3207 function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) { 3208 3209 if ( $hide_on_update && !empty($_GET['updated']) ) 3210 return; 3211 3211 3212 3212 $settings_errors = get_settings_errors( $setting, $sanitize ); 3213 3213 3214 if ( !is_array($settings_errors) ) return;3215 3216 $output = ''; 3214 if ( !is_array($settings_errors) ) 3215 return; 3216 3217 3217 foreach ( $settings_errors as $key => $details ) { 3218 3218 $css_id = 'setting-error-' . $details['code']; 3219 3219 $css_class = $details['type'] . ' settings-error'; 3220 $output .= "<div id='$css_id' class='$css_class'> \n"; 3221 $output .= "<p><strong>{$details['message']}</strong></p>"; 3222 $output .= "</div> \n"; 3223 } 3224 echo $output; 3220 echo "<div id='$css_id' class='$css_class'>\n"; 3221 echo "<p><strong>{$details['message']}</strong></p>"; 3222 echo "</div>\n"; 3223 } 3225 3224 } 3226 3225 … … 3274 3273 <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label> 3275 3274 <input type="text" id="find-posts-input" name="ps" value="" /> 3276 <input type="button" on click="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />3275 <input type="button" onClick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br /> 3277 3276 3278 3277 <?php … … 3282 3281 continue; 3283 3282 ?> 3284 <input type="radio" name="find-posts-what" id="find-posts-<?php echo esc_attr($post->name); ?>" value="<?php echo esc_attr($post->name); ?>" <?php checked($post->name, 3283 <input type="radio" name="find-posts-what" id="find-posts-<?php echo esc_attr($post->name); ?>" value="<?php echo esc_attr($post->name); ?>" <?php checked($post->name, 'post'); ?> /> 3285 3284 <label for="find-posts-<?php echo esc_attr($post->name); ?>"><?php echo $post->label; ?></label> 3286 3285 <?php … … 3290 3289 </div> 3291 3290 <div class="find-box-buttons"> 3292 <input type="button" class="button alignleft" on click="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />3291 <input type="button" class="button alignleft" onClick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" /> 3293 3292 <input id="find-posts-submit" type="submit" class="button-primary alignright" value="<?php esc_attr_e('Select'); ?>" /> 3294 3293 </div> … … 3308 3307 function the_post_password() { 3309 3308 global $post; 3310 if ( isset( $post->post_password ) ) echo esc_attr( $post->post_password ); 3309 if ( isset( $post->post_password ) ) 3310 echo esc_attr( $post->post_password ); 3311 3311 } 3312 3312 … … 3401 3401 array_shift($allowed_actions); 3402 3402 3403 foreach ( $allowed_actions as $action => $label ) {3403 foreach ( $allowed_actions as $action => $label ) { 3404 3404 echo "<div class='favorite-action'><a href='$action'>"; 3405 3405 echo $label; … … 3437 3437 */ 3438 3438 function _admin_search_query() { 3439 echo isset($_GET['s']) ? esc_attr( stripslashes( $_GET['s'] ) ) : ''; 3439 if ( isset($_GET['s']) ) 3440 echo esc_attr( stripslashes( $_GET['s'] ) ); 3440 3441 } 3441 3442 … … 3449 3450 */ 3450 3451 function iframe_header( $title = '', $limit_styles = false ) { 3451 global $hook_suffix; 3452 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3452 global $hook_suffix; 3453 ?> 3454 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3453 3455 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> 3454 3456 <head> 3455 3457 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> 3456 <title><?php bloginfo('name') ?> › <?php echo $title?> — <?php _e('WordPress'); ?></title>3458 <title><?php bloginfo('name'); ?> › <?php echo $title; ?> — <?php _e('WordPress'); ?></title> 3457 3459 <?php 3458 wp_enqueue_style( 'global' );3459 if ( ! $limit_styles )3460 wp_enqueue_style( 'wp-admin' );3461 wp_enqueue_style( 'colors' );3460 wp_enqueue_style( 'global' ); 3461 if ( ! $limit_styles ) 3462 wp_enqueue_style( 'wp-admin' ); 3463 wp_enqueue_style( 'colors' ); 3462 3464 ?> 3463 3465 <script type="text/javascript"> … … 3468 3470 </script> 3469 3471 <?php 3470 do_action('admin_print_styles');3471 do_action('admin_print_scripts');3472 do_action('admin_head');3473 3474 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);3472 do_action('admin_print_styles'); 3473 do_action('admin_print_scripts'); 3474 do_action('admin_head'); 3475 3476 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); 3475 3477 ?> 3476 3478 </head> 3477 <body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> 3479 <body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="no-js <?php echo $admin_body_class; ?>"> 3478 3480 <script type="text/javascript"> 3479 3481 //<![CDATA[ … … 3588 3590 break; 3589 3591 } 3590 if ( ! empty( $settings ) )3592 if ( ! empty( $settings ) ) 3591 3593 $show_screen = true; 3592 3594 ?> … … 3596 3598 <form id="adv-settings" action="" method="post"> 3597 3599 <?php if ( isset($wp_meta_boxes[$screen->id]) ) : ?> 3598 <h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>3600 <h5><?php _ex('Show on screen', 'Metaboxes'); ?></h5> 3599 3601 <div class="metabox-prefs"> 3600 3602 <?php meta_box_prefs($screen); ?> … … 3603 3605 <?php endif; 3604 3606 if ( ! empty($column_screens) ) : ?> 3605 <h5><?php echo ( isset( $column_screens['_title'] ) ? $column_screens['_title'] : _x('Show on screen', 'Columns') )?></h5>3607 <h5><?php echo ( isset( $column_screens['_title'] ) ? $column_screens['_title'] : _x('Show on screen', 'Columns') ); ?></h5> 3606 3608 <div class="metabox-prefs"> 3607 3609 <?php manage_columns_prefs($screen); ?> … … 3613 3615 if ( !empty( $screen_options ) ) { 3614 3616 ?> 3615 <h5><?php _ex('Show on screen', 'Screen Options') ?></h5>3617 <h5><?php _ex('Show on screen', 'Screen Options'); ?></h5> 3616 3618 <?php 3617 3619 } … … 3647 3649 <div id="screen-meta-links"> 3648 3650 <div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle"> 3649 <a href="#contextual-help" id="contextual-help-link" class="show-settings"><?php _e('Help') ?></a>3651 <a href="#contextual-help" id="contextual-help-link" class="show-settings"><?php _e('Help'); ?></a> 3650 3652 </div> 3651 3653 <?php if ( $show_screen ) { ?> 3652 3654 <div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle"> 3653 <a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a>3655 <a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options'); ?></a> 3654 3656 </div> 3655 3657 <?php } ?> … … 3664 3666 * @since 2.7.0 3665 3667 * 3666 * @param string $screen The handle for the screen to add help to. 3668 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. 3667 3669 * @param string $help Arbitrary help text 3668 3670 */ … … 3719 3721 3720 3722 if ( ! $screen_layout_columns ) 3721 3723 $screen_layout_columns = 2; 3722 3724 3723 3725 $i = 1; … … 3896 3898 * @param string $id Screen id, optional. 3897 3899 */ 3898 function set_current_screen( $id = 3900 function set_current_screen( $id = '' ) { 3899 3901 global $current_screen, $hook_suffix, $typenow, $taxnow; 3900 3902
Note: See TracChangeset
for help on using the changeset viewer.