Code is Poetry.
WordPress' code just... wasn't. This is now dealt with. Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS. Fixes #41057. Built from https://develop.svn.wordpress.org/trunk@42343 git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -35,7 +35,10 @@ class Walker_PageDropdown extends Walker {
|
||||
* @see Walker::$db_fields
|
||||
* @todo Decouple this
|
||||
*/
|
||||
public $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
|
||||
public $db_fields = array(
|
||||
'parent' => 'post_parent',
|
||||
'id' => 'ID',
|
||||
);
|
||||
|
||||
/**
|
||||
* Starts the element output.
|
||||
@@ -54,15 +57,16 @@ class Walker_PageDropdown extends Walker {
|
||||
* @param int $id Optional. ID of the current page. Default 0 (unused).
|
||||
*/
|
||||
public function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
|
||||
$pad = str_repeat(' ', $depth * 3);
|
||||
$pad = str_repeat( ' ', $depth * 3 );
|
||||
|
||||
if ( ! isset( $args['value_field'] ) || ! isset( $page->{$args['value_field']} ) ) {
|
||||
$args['value_field'] = 'ID';
|
||||
}
|
||||
|
||||
$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $page->{$args['value_field']} ) . "\"";
|
||||
if ( $page->ID == $args['selected'] )
|
||||
$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $page->{$args['value_field']} ) . '"';
|
||||
if ( $page->ID == $args['selected'] ) {
|
||||
$output .= ' selected="selected"';
|
||||
}
|
||||
$output .= '>';
|
||||
|
||||
$title = $page->post_title;
|
||||
|
||||
Reference in New Issue
Block a user