Validation fixes. Props ocean90, peaceablewhale. see #17364
git-svn-id: http://svn.automattic.com/wordpress/trunk@18010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9aeffe1487
commit
8192d0dae8
|
@ -508,7 +508,7 @@ case 'add-link-category' : // On the Fly
|
|||
$x->send();
|
||||
break;
|
||||
case 'add-tag' :
|
||||
check_ajax_referer( 'add-tag' );
|
||||
check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
|
||||
$post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
$tax = get_taxonomy($taxonomy);
|
||||
|
|
|
@ -237,7 +237,6 @@ if ( get_background_image() ) {
|
|||
<input type="hidden" name="action" value="save" />
|
||||
<?php wp_nonce_field('custom-background-upload', '_wpnonce-custom-background-upload') ?>
|
||||
<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
|
||||
</p>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -270,10 +269,10 @@ if ( get_background_image() ) {
|
|||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Repeat' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend>
|
||||
<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('No Repeat'); ?></option></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile'); ?></option></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile Horizontally'); ?></option></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile Vertically'); ?></option></label>
|
||||
<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('No Repeat'); ?></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile'); ?></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Horizontally'); ?></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Vertically'); ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
|
||||
|
|
|
@ -388,7 +388,8 @@ class Custom_Image_Header {
|
|||
<?php if ( 'blank' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) || '' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) || ! $this->header_text() ) { ?>
|
||||
toggle_text();
|
||||
<?php } ?>
|
||||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ switch ( $wp_list_table->current_action() ) {
|
|||
|
||||
case 'add-tag':
|
||||
|
||||
check_admin_referer( 'add-tag' );
|
||||
check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
|
||||
|
||||
if ( !current_user_can( $tax->cap->edit_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
@ -328,7 +328,7 @@ if ( current_user_can($tax->cap->edit_terms) ) {
|
|||
<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
|
||||
<?php wp_nonce_field('add-tag'); ?>
|
||||
<?php wp_nonce_field('add-tag', '_wpnonce_add-tag'); ?>
|
||||
|
||||
<div class="form-field form-required">
|
||||
<label for="tag-name"><?php _ex('Name', 'Taxonomy Name'); ?></label>
|
||||
|
|
|
@ -109,7 +109,7 @@ function export_date_options() {
|
|||
continue;
|
||||
|
||||
$month = zeroise( $date->month, 2 );
|
||||
echo '<option value="' . $date->year . '-' . $month . '" />' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';
|
||||
echo '<option value="' . $date->year . '-' . $month . '">' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -281,7 +281,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
|||
|
||||
$post_status = !empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';
|
||||
if ( post_type_supports( $post_type, 'comments' ) && !in_array( $post_status, array( 'pending', 'draft', 'future' ) ) )
|
||||
$posts_columns['comments'] = '<div class="vers"><img alt="' . esc_attr__( 'Comments' ) . '" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
|
||||
$posts_columns['comments'] = '<span class="vers"><img alt="' . esc_attr__( 'Comments' ) . '" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></span>';
|
||||
|
||||
$posts_columns['date'] = __( 'Date' );
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
$pad = str_repeat( '— ', max( 0, $this->level ) );
|
||||
$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
|
||||
$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
|
||||
$edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $post_type );
|
||||
$edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $post_type ) );
|
||||
|
||||
$out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />';
|
||||
|
||||
|
@ -269,7 +269,7 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
|
||||
$out .= '<div class="name">' . $qe_data->name . '</div>';
|
||||
$out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>';
|
||||
$out .= '<div class="parent">' . $qe_data->parent . '</div></div></td>';
|
||||
$out .= '<div class="parent">' . $qe_data->parent . '</div></div>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
|
||||
$args['post_type'] = $post_type;
|
||||
|
||||
return "<a href='" . add_query_arg( $args, 'edit.php' ) . "'>$count</a>";
|
||||
return "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
|
||||
}
|
||||
|
||||
function column_links( $tag ) {
|
||||
|
|
|
@ -112,7 +112,7 @@ class WP_Users_List_Table extends WP_List_Table {
|
|||
$name = translate_user_role( $name );
|
||||
/* translators: User role name with count */
|
||||
$name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, $avail_roles[$this_role] );
|
||||
$role_links[$this_role] = "<a href='" . add_query_arg( 'role', $this_role, $url ) . "'$class>$name</a>";
|
||||
$role_links[$this_role] = "<a href='" . esc_html( add_query_arg( 'role', $this_role, $url ) ) . "'$class>$name</a>";
|
||||
}
|
||||
|
||||
return $role_links;
|
||||
|
|
|
@ -552,7 +552,7 @@ function wp_dashboard_quick_press() {
|
|||
<input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" />
|
||||
<span id="publishing-action">
|
||||
<input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" />
|
||||
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
|
||||
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
|
||||
</span>
|
||||
<br class="clear" />
|
||||
</p>
|
||||
|
|
|
@ -182,7 +182,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
|
|||
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
|
||||
),
|
||||
'delete-menu_item_' . $item_id
|
||||
); ?>"><?php _e('Remove'); ?></a> <span class="meta-sep"> | </span> <a class="item-cancel submitcancel" id="cancel-<?php echo $item_id; ?>" href="<?php echo add_query_arg( array('edit-menu-item' => $item_id, 'cancel' => time()), remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) ) );
|
||||
); ?>"><?php _e('Remove'); ?></a> <span class="meta-sep"> | </span> <a class="item-cancel submitcancel" id="cancel-<?php echo $item_id; ?>" href="<?php echo esc_url( add_query_arg( array('edit-menu-item' => $item_id, 'cancel' => time()), remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) ) ) );
|
||||
?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e('Cancel'); ?></a>
|
||||
</div>
|
||||
|
||||
|
@ -690,7 +690,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
|
|||
<p class="quick-search-wrap">
|
||||
<input type="text" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
|
||||
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
|
||||
<?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false ); ?>
|
||||
<?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
|
||||
</p>
|
||||
|
||||
<ul id="<?php echo $post_type_name; ?>-search-checklist" class="list:<?php echo $post_type_name?> categorychecklist form-no-clear">
|
||||
|
@ -924,7 +924,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
|
|||
<p class="quick-search-wrap">
|
||||
<input type="text" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
|
||||
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
|
||||
<?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false ); ?>
|
||||
<?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
|
||||
</p>
|
||||
|
||||
<ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear">
|
||||
|
|
|
@ -207,8 +207,8 @@ function wp_widget_control( $sidebar_args ) {
|
|||
<a class="widget-control-close" href="#close"><?php _e('Close'); ?></a>
|
||||
</div>
|
||||
<div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
|
||||
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback " title="" alt="" />
|
||||
<?php submit_button( __( 'Save' ), 'button-primary widget-control-save', 'savewidget', false ); ?>
|
||||
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback" title="" alt="" />
|
||||
<?php submit_button( __( 'Save' ), 'button-primary widget-control-save', 'savewidget', false, array( 'id' => 'widget-' . esc_attr( $id_format ) . '-savewidget' ) ); ?>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
|
|
@ -556,7 +556,7 @@ require_once( './admin-header.php' );
|
|||
<?php endif; ?>
|
||||
<br class="clear" />
|
||||
<div class="publishing-action">
|
||||
<?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false ); ?>
|
||||
<?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>
|
||||
</div><!-- END .publishing-action -->
|
||||
|
||||
<?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
|
||||
|
@ -595,7 +595,7 @@ require_once( './admin-header.php' );
|
|||
<div class="publishing-action">
|
||||
<?php
|
||||
if ( ! empty( $nav_menu_selected_id ) )
|
||||
submit_button( __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false );
|
||||
submit_button( __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_footer' ) );
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -264,7 +264,7 @@ endif; ?>
|
|||
</tr>
|
||||
</table>
|
||||
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
|
||||
<?php submit_button( __('Add User'), 'primary', 'add-user' ); ?>
|
||||
<?php submit_button( __('Add User'), 'primary', 'add-user', false, array( 'id' => 'submit-add-existing-user' ) ); ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
|
@ -300,7 +300,7 @@ endif; ?>
|
|||
</tr>
|
||||
</table>
|
||||
<?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?>
|
||||
<?php submit_button( __('Add New User'), 'primary', 'add-user' ); ?>
|
||||
<?php submit_button( __('Add New User'), 'primary', 'add-user', false, array( 'id' => 'submit-add-user' ) ); ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
@ -69,7 +69,7 @@ if ( current_theme_supports( 'post-formats' ) ) :
|
|||
<?php foreach ( $post_formats[0] as $format ): ?>
|
||||
<option<?php selected( get_option('default_post_format'), $format ); ?> value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select></label>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; endif; ?>
|
||||
|
|
|
@ -149,7 +149,7 @@ if ( ! current_user_can( 'switch_themes' ) ) {
|
|||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="theme-search-input"><?php _e('Search Installed Themes'); ?>:</label>
|
||||
<input type="text" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<?php submit_button( __( 'Search Installed Themes' ), 'button', 'submit', false ); ?>
|
||||
<?php submit_button( __( 'Search Installed Themes' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
||||
<a id="filter-click" href="?filter=1"><?php _e( 'Feature Filter' ); ?></a>
|
||||
</p>
|
||||
|
||||
|
@ -184,7 +184,7 @@ if ( ! current_user_can( 'switch_themes' ) ) {
|
|||
<?php endforeach; ?>
|
||||
|
||||
<div class="feature-container">
|
||||
<?php submit_button( __( 'Apply Filters' ), 'button-secondary submitter', 'submit', false, array( 'style' => 'margin-left: 120px' ) ); ?>
|
||||
<?php submit_button( __( 'Apply Filters' ), 'button-secondary submitter', false, false, array( 'style' => 'margin-left: 120px', 'id' => 'filter-submit' ) ); ?>
|
||||
|
||||
<small><a id="mini-filter-click" href="<?php echo esc_url( remove_query_arg( array('filter', 'features', 'submit') ) ); ?>"><?php _e( 'Close filters' )?></a></small>
|
||||
</div>
|
||||
|
|
|
@ -195,7 +195,7 @@ function theme_options_render_page() {
|
|||
<label class="description">
|
||||
<input type="radio" name="twentyeleven_theme_options[color_scheme]" value="<?php echo esc_attr( $color['value'] ); ?>" <?php checked( $options['color_scheme'], $color['value'] ); ?> />
|
||||
<span>
|
||||
<img src="<?php echo esc_url( $color['thumbnail'] ); ?>"/>
|
||||
<img src="<?php echo esc_url( $color['thumbnail'] ); ?>" alt=""/>
|
||||
<?php echo $color['label']; ?>
|
||||
</span>
|
||||
</label>
|
||||
|
@ -212,7 +212,7 @@ function theme_options_render_page() {
|
|||
<fieldset><legend class="screen-reader-text"><span><?php _e( 'Link Color', 'twentyeleven' ); ?></span></legend>
|
||||
<input type="text" name="twentyeleven_theme_options[link_color]" id="link-color" value="<?php echo esc_attr( $options['link_color'] ); ?>" />
|
||||
<a href="#" class="pickcolor hide-if-no-js" id="link-color-example"></a>
|
||||
<input type="button" class="pickcolor button hide-if-no-js" value="<?php esc_attr_e( 'Select a Color', 'twentyeleven' ); ?>">
|
||||
<input type="button" class="pickcolor button hide-if-no-js" value="<?php esc_attr_e( 'Select a Color', 'twentyeleven' ); ?>" />
|
||||
<div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
|
||||
<br />
|
||||
<small class="description"><?php printf( __( 'Default color: %s', 'twentyeleven' ), $default_options['link_color'] ); ?></small>
|
||||
|
@ -230,7 +230,7 @@ function theme_options_render_page() {
|
|||
<label class="description">
|
||||
<input type="radio" name="twentyeleven_theme_options[theme_layout]" value="<?php echo esc_attr( $layout['value'] ); ?>" <?php checked( $options['theme_layout'], $layout['value'] ); ?> />
|
||||
<span>
|
||||
<img src="<?php echo esc_url( $layout['thumbnail'] ); ?>"/>
|
||||
<img src="<?php echo esc_url( $layout['thumbnail'] ); ?>" alt=""/>
|
||||
<?php echo $layout['label']; ?>
|
||||
</span>
|
||||
</label>
|
||||
|
|
Loading…
Reference in New Issue