Commit 5edfa78c authored by Erick Hitter's avatar Erick Hitter
Browse files

Convert get_settings() method to use a static variable store

parent 72c36f97
......@@ -32,6 +32,7 @@ class WP_Revisions_Control {
* Class variables
*/
private static $post_types = array();
private static $settings = array();
private $settings_page = 'writing';
private $settings_section = 'wp_revisions_control';
......@@ -172,6 +173,7 @@ class WP_Revisions_Control {
* @return array
*/
private function get_settings() {
if ( empty( self::$settings ) ) {
$post_types = $this->get_post_types();
$settings = get_option( $this->settings_section, array() );
......@@ -185,7 +187,10 @@ class WP_Revisions_Control {
$merged_settings[ $post_type ] = -1;
}
return $merged_settings;
self::$settings = $merged_settings;
}
return self::$settings;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment