From 99f969df3c4b2ffd799d42eff1b7142a44526c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Thu, 28 Nov 2013 05:10:09 +0000 Subject: [PATCH] Add remove_option(), remove_options(), and get_options() methods to WP_Screen, along with unit tests. props ocean90, DrewAPicture. fixes #25799. Built from https://develop.svn.wordpress.org/trunk@26456 git-svn-id: http://core.svn.wordpress.org/trunk@26354 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/screen.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index 2ab5161bff..33f91fea63 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -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. *