Changeset 11109 for trunk/wp-admin/includes/template.php
- Timestamp:
- 04/28/2009 05:58:45 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/template.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r11073 r11109 119 119 $edit_link = "categories.php?action=edit&cat_ID=$category->term_id"; 120 120 if ( current_user_can( 'manage_categories' ) ) { 121 $edit = "<a class='row-title' href='$edit_link' title='" . attr ibute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>" . attribute_escape( $name ) . '</a><br />';121 $edit = "<a class='row-title' href='$edit_link' title='" . attr(sprintf(__('Edit "%s"'), $category->name)) . "'>" . attr( $name ) . '</a><br />'; 122 122 $actions = array(); 123 123 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 258 258 <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="cancel button-secondary alignleft"><?php _e('Cancel'); ?></a> 259 259 <?php $update_text = ( $is_tag ) ? __( 'Update Tag' ) : __( 'Update Category' ); ?> 260 <a accesskey="s" href="#inline-edit" title="<?php echo attr ibute_escape( $update_text ); ?>" class="save button-primary alignright"><?php echo $update_text; ?></a>260 <a accesskey="s" href="#inline-edit" title="<?php echo attr( $update_text ); ?>" class="save button-primary alignright"><?php echo $update_text; ?></a> 261 261 <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /> 262 262 <span class="error" style="display:none;"></span> … … 290 290 $edit_link = "link-category.php?action=edit&cat_ID=$category->term_id"; 291 291 if ( current_user_can( 'manage_categories' ) ) { 292 $edit = "<a class='row-title' href='$edit_link' title='" . attr ibute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>$name</a><br />";292 $edit = "<a class='row-title' href='$edit_link' title='" . attr(sprintf(__('Edit "%s"'), $category->name)) . "'>$name</a><br />"; 293 293 $actions = array(); 294 294 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 650 650 break; 651 651 case 'name': 652 $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attr ibute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />';652 $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attr(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />'; 653 653 $actions = array(); 654 654 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 1248 1248 $update_text = ( $is_page ) ? __( 'Update Page' ) : __( 'Update Post' ); 1249 1249 ?> 1250 <a accesskey="s" href="#inline-edit" title="<?php _e('Update'); ?>" class="button-primary save alignright"><?php echo attr ibute_escape( $update_text ); ?></a>1250 <a accesskey="s" href="#inline-edit" title="<?php _e('Update'); ?>" class="button-primary save alignright"><?php echo attr( $update_text ); ?></a> 1251 1251 <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /> 1252 1252 <?php } else { 1253 1253 $update_text = ( $is_page ) ? __( 'Update Pages' ) : __( 'Update Posts' ); 1254 1254 ?> 1255 <input accesskey="s" class="button-primary alignright" type="submit" name="bulk_edit" value="<?php echo attr ibute_escape( $update_text ); ?>" />1255 <input accesskey="s" class="button-primary alignright" type="submit" name="bulk_edit" value="<?php echo attr( $update_text ); ?>" /> 1256 1256 <?php } ?> 1257 1257 <input type="hidden" name="post_view" value="<?php echo $m; ?>" /> … … 1279 1279 return; 1280 1280 1281 $title = attr ibute_escape($post->post_title);1281 $title = attr($post->post_title); 1282 1282 1283 1283 echo ' … … 1428 1428 $attributes = 'class="post-title column-title"' . $style; 1429 1429 ?> 1430 <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attr ibute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>1430 <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attr(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong> 1431 1431 <?php 1432 1432 if ( 'excerpt' == $mode ) … … 1435 1435 $actions = array(); 1436 1436 if ( current_user_can('edit_post', $post->ID) ) { 1437 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . attr ibute_escape(__('Edit this post')) . '">' . __('Edit') . '</a>';1438 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . attr ibute_escape(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>';1439 $actions['delete'] = "<a class='submitdelete' title='" . attr ibute_escape(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";1437 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; 1438 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>'; 1439 $actions['delete'] = "<a class='submitdelete' title='" . attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1440 1440 } 1441 1441 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1442 1442 if ( current_user_can('edit_post', $post->ID) ) 1443 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attr ibute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';1443 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attr(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1444 1444 } else { 1445 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attr ibute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';1445 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attr(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 1446 1446 } 1447 1447 $actions = apply_filters('post_row_actions', $actions, $post); … … 1644 1644 $edit_link = get_edit_post_link( $page->ID ); 1645 1645 ?> 1646 <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attr ibute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . wp_specialchars($parent_name) : ''; ?></strong>1646 <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attr(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . wp_specialchars($parent_name) : ''; ?></strong> 1647 1647 <?php 1648 1648 $actions = array(); 1649 1649 if ( current_user_can('edit_page', $page->ID) ) { 1650 $actions['edit'] = '<a href="' . $edit_link . '" title="' . attr ibute_escape(__('Edit this page')) . '">' . __('Edit') . '</a>';1650 $actions['edit'] = '<a href="' . $edit_link . '" title="' . attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; 1651 1651 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1652 $actions['delete'] = "<a class='submitdelete' title='" . attr ibute_escape(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";1652 $actions['delete'] = "<a class='submitdelete' title='" . attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1653 1653 } 1654 1654 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1655 1655 if ( current_user_can('edit_page', $page->ID) ) 1656 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attr ibute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';1656 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attr(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1657 1657 } else { 1658 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attr ibute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';1658 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attr(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 1659 1659 } 1660 1660 $actions = apply_filters('page_row_actions', $actions, $page); … … 2115 2115 <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden"> 2116 2116 <textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea> 2117 <div class="author-email"><?php if ( $user_can ) echo attr ibute_escape( $comment->comment_author_email ); ?></div>2118 <div class="author"><?php if ( $user_can ) echo attr ibute_escape( $comment->comment_author ); ?></div>2119 <div class="author-url"><?php echo attr ibute_escape( $comment->comment_author_url ); ?></div>2117 <div class="author-email"><?php if ( $user_can ) echo attr( $comment->comment_author_email ); ?></div> 2118 <div class="author"><?php if ( $user_can ) echo attr( $comment->comment_author ); ?></div> 2119 <div class="author-url"><?php echo attr( $comment->comment_author_url ); ?></div> 2120 2120 <div class="comment_status"><?php echo $comment->comment_approved; ?></div> 2121 2121 </div> … … 2418 2418 } 2419 2419 2420 $entry['meta_key'] = attr ibute_escape($entry['meta_key']);2420 $entry['meta_key'] = attr($entry['meta_key']); 2421 2421 $entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a <textarea /> 2422 2422 $entry['meta_id'] = (int) $entry['meta_id']; … … 2428 2428 2429 2429 $r .= "\n\t\t<div class='submit'><input name='deletemeta[{$entry['meta_id']}]' type='submit' "; 2430 $r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='".attr ibute_escape(__( 'Delete' ))."' />";2431 $r .= "\n\t\t<input name='updatemeta' type='submit' tabindex='6' value='".attr ibute_escape(__( 'Update' ))."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /></div>";2430 $r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='".attr(__( 'Delete' ))."' />"; 2431 $r .= "\n\t\t<input name='updatemeta' type='submit' tabindex='6' value='".attr(__( 'Update' ))."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /></div>"; 2432 2432 $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false ); 2433 2433 $r .= "</td>"; … … 2473 2473 2474 2474 foreach ( $keys as $key ) { 2475 $key = attr ibute_escape( $key );2475 $key = attr( $key ); 2476 2476 echo "\n<option value='$key'>$key</option>"; 2477 2477 } … … 2783 2783 else : 2784 2784 ?> 2785 <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo attr ibute_escape($action) ?>">2785 <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo attr($action) ?>"> 2786 2786 <p> 2787 2787 <?php wp_nonce_field('import-upload'); ?> … … 2806 2806 function wp_remember_old_slug() { 2807 2807 global $post; 2808 $name = attr ibute_escape($post->post_name); // just in case2808 $name = attr($post->post_name); // just in case 2809 2809 if ( strlen($name) ) 2810 2810 echo '<input type="hidden" id="wp-old-slug" name="wp-old-slug" value="' . $name . '" />'; … … 3172 3172 * Display the post password. 3173 3173 * 3174 * The password is passed through {@link attr ibute_escape()} to ensure that it3174 * The password is passed through {@link attr()} to ensure that it 3175 3175 * is safe for placing in an html attribute. 3176 3176 * 3177 * @uses attr ibute_escape3177 * @uses attr 3178 3178 * @since 2.7.0 3179 3179 */ 3180 3180 function the_post_password() { 3181 3181 global $post; 3182 if ( isset( $post->post_password ) ) echo attr ibute_escape( $post->post_password );3182 if ( isset( $post->post_password ) ) echo attr( $post->post_password ); 3183 3183 } 3184 3184 … … 3298 3298 * should only be used when {@link the_search_query()} cannot. 3299 3299 * 3300 * @uses attr ibute_escape3300 * @uses attr 3301 3301 * @since 2.7.0 3302 3302 * 3303 3303 */ 3304 3304 function _admin_search_query() { 3305 echo isset($_GET['s']) ? attr ibute_escape( stripslashes( $_GET['s'] ) ) : '';3305 echo isset($_GET['s']) ? attr( stripslashes( $_GET['s'] ) ) : ''; 3306 3306 } 3307 3307
Note: See TracChangeset
for help on using the changeset viewer.