Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/wp-includes/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
),
'br' => array(),
'button' => array(
'command' => true,
'commandfor' => true,
'disabled' => true,
'name' => true,
'type' => true,
Expand Down
11 changes: 11 additions & 0 deletions tests/phpunit/tests/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,17 @@ public function test_wp_kses_main_tag_standard_attributes() {
$this->assertEqualHTML( $html, wp_kses_post( $html ) );
}

/**
* Test that Invoker Commands API attributes are preserved on buttons in post content.
*
* @ticket 64576
*/
public function test_wp_kses_button_invoker_command_attributes() {
$html = '<button type="button" commandfor="my-popover" command="toggle-popover">Toggle</button><div id="my-popover" popover>Content</div>';

$this->assertEqualHTML( $html, wp_kses_post( $html ) );
}

/**
* Test that object tags are allowed under limited circumstances.
*
Expand Down
Loading