mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
Introduce class argument to wp_dropdown_pages().
This new argument allows devs to specify the 'class' attribute of the select element. Props ramiy, voldemortensen. Fixes #30082. git-svn-id: https://develop.svn.wordpress.org/trunk@32727 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -198,6 +198,39 @@ NO;
|
||||
$this->assertContains( 'value="' . $p . '"', $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 30082
|
||||
*/
|
||||
public function test_wp_dropdown_pages_should_not_contain_class_attribute_when_no_class_is_passed() {
|
||||
$p = $this->factory->post->create( array(
|
||||
'post_type' => 'page',
|
||||
'post_name' => 'foo',
|
||||
) );
|
||||
|
||||
$found = wp_dropdown_pages( array(
|
||||
'echo' => 0,
|
||||
) );
|
||||
|
||||
$this->assertNotRegExp( '/<select[^>]+class=\'/', $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 30082
|
||||
*/
|
||||
public function test_wp_dropdown_pages_should_obey_class_parameter() {
|
||||
$p = $this->factory->post->create( array(
|
||||
'post_type' => 'page',
|
||||
'post_name' => 'foo',
|
||||
) );
|
||||
|
||||
$found = wp_dropdown_pages( array(
|
||||
'echo' => 0,
|
||||
'class' => 'bar',
|
||||
) );
|
||||
|
||||
$this->assertRegExp( '/<select[^>]+class=\'bar\'/', $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 31389
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user