Add remove_option(), remove_options(), and get_options() methods to WP_Screen, along with unit tests. props ocean90, DrewAPicture. fixes #25799.

git-svn-id: https://develop.svn.wordpress.org/trunk@26456 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2013-11-28 05:09:06 +00:00
parent 1b5c962326
commit eaa7c65263
2 changed files with 57 additions and 0 deletions
+31
View File
@@ -618,6 +618,37 @@ final class WP_Screen {
$this->_options[ $option ] = $args;
}
/**
* Remove an option from the screen.
*
* @since 3.8.0
*
* @param string $option Option ID.
*/
public function remove_option( $option ) {
unset( $this->_options[ $option ] );
}
/**
* Remove all options from the screen.
*
* @since 3.8.0
*/
public function remove_options() {
$this->_options = array();
}
/**
* Get the options registered for the screen.
*
* @since 3.8.0
*
* @return array Options with arguments.
*/
public function get_options() {
return $this->_options;
}
/**
* Gets the arguments for an option for the screen.
*