Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.

See #47632.


Built from https://develop.svn.wordpress.org/trunk@45590


git-svn-id: http://core.svn.wordpress.org/trunk@45401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast
2019-07-02 23:42:58 +00:00
parent 55b2d94cca
commit 4803fc405e
76 changed files with 1038 additions and 588 deletions

View File

@@ -206,7 +206,8 @@ class WP_Widget {
* @return string Name attribute for $field_name
*/
public function get_field_name( $field_name ) {
if ( false === $pos = strpos( $field_name, '[' ) ) {
$pos = strpos( $field_name, '[' );
if ( false === $pos ) {
return 'widget-' . $this->id_base . '[' . $this->number . '][' . $field_name . ']';
} else {
return 'widget-' . $this->id_base . '[' . $this->number . '][' . substr_replace( $field_name, '][', $pos, strlen( '[' ) );