mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues. This change includes three notable additions: - Multiline function calls must now put each parameter on a new line. - Auto-formatting files is now part of the `grunt precommit` script. - Auto-fixable coding standards issues will now cause Travis failures. Fixes #44600. git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -295,71 +295,71 @@ if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
|
||||
|
||||
<form action="widgets.php" method="post">
|
||||
<div class="widget-inside">
|
||||
<?php
|
||||
if ( is_callable( $control_callback ) ) {
|
||||
call_user_func_array( $control_callback, $control['params'] );
|
||||
} else {
|
||||
echo '<p>' . __( 'There are no options for this widget.' ) . "</p>\n";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ( is_callable( $control_callback ) ) {
|
||||
call_user_func_array( $control_callback, $control['params'] );
|
||||
} else {
|
||||
echo '<p>' . __( 'There are no options for this widget.' ) . "</p>\n";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<p class="describe"><?php _e( 'Select both the sidebar for this widget and the position of the widget in that sidebar.' ); ?></p>
|
||||
<div class="widget-position">
|
||||
<table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody>
|
||||
<?php
|
||||
foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
|
||||
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
|
||||
if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
|
||||
echo ' ';
|
||||
} else {
|
||||
if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
|
||||
$j = 1;
|
||||
$sidebars_widgets[ $sbname ] = array();
|
||||
<?php
|
||||
foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
|
||||
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
|
||||
if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
|
||||
echo ' ';
|
||||
} else {
|
||||
$j = count( $sidebars_widgets[ $sbname ] );
|
||||
if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
|
||||
$j++;
|
||||
if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
|
||||
$j = 1;
|
||||
$sidebars_widgets[ $sbname ] = array();
|
||||
} else {
|
||||
$j = count( $sidebars_widgets[ $sbname ] );
|
||||
if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$selected = '';
|
||||
echo "\t\t<select name='{$sbname}_position'>\n";
|
||||
echo "\t\t<option value=''>" . __( '— Select —' ) . "</option>\n";
|
||||
for ( $i = 1; $i <= $j; $i++ ) {
|
||||
if ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
|
||||
$selected = selected( $i, $key + 1, false );
|
||||
$selected = '';
|
||||
echo "\t\t<select name='{$sbname}_position'>\n";
|
||||
echo "\t\t<option value=''>" . __( '— Select —' ) . "</option>\n";
|
||||
for ( $i = 1; $i <= $j; $i++ ) {
|
||||
if ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
|
||||
$selected = selected( $i, $key + 1, false );
|
||||
}
|
||||
echo "\t\t<option value='$i'$selected> $i </option>\n";
|
||||
}
|
||||
echo "\t\t<option value='$i'$selected> $i </option>\n";
|
||||
echo "\t\t</select>\n";
|
||||
}
|
||||
echo "\t\t</select>\n";
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
</tbody></table>
|
||||
</div>
|
||||
|
||||
<div class="widget-control-actions">
|
||||
<?php
|
||||
if ( isset( $_GET['addnew'] ) ) {
|
||||
?>
|
||||
<?php
|
||||
if ( isset( $_GET['addnew'] ) ) {
|
||||
?>
|
||||
<a href="widgets.php" class="button alignleft"><?php _e( 'Cancel' ); ?></a>
|
||||
<?php
|
||||
} else {
|
||||
submit_button( __( 'Delete' ), 'alignleft', 'removewidget', false );
|
||||
}
|
||||
<?php
|
||||
} else {
|
||||
submit_button( __( 'Delete' ), 'alignleft', 'removewidget', false );
|
||||
}
|
||||
submit_button( __( 'Save Widget' ), 'primary alignright', 'savewidget', false );
|
||||
?>
|
||||
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr( $widget_id ); ?>" />
|
||||
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $id_base ); ?>" />
|
||||
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr( $multi_number ); ?>" />
|
||||
<?php wp_nonce_field( "save-delete-widget-$widget_id" ); ?>
|
||||
<?php wp_nonce_field( "save-delete-widget-$widget_id" ); ?>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
require_once( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user