Skip to content
Snippets Groups Projects
Commit 42673468 authored by Erick Hitter's avatar Erick Hitter
Browse files

Don't register hooks immediately when plugin is instantiated, otherwise no one...

Don't register hooks immediately when plugin is instantiated, otherwise no one else can hook in reliably.
parent af390c8c
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,16 @@ class WP_Revisions_Control { ...@@ -58,6 +58,16 @@ class WP_Revisions_Control {
return self::$__instance; return self::$__instance;
} }
/**
* Register actions and filters at init so others can interact, if desired.
*
* @uses add_action
* @return null
*/
private function setup() {
add_action( 'init', array( $this, 'action_init' ) );
}
/** /**
* Register actions and filters * Register actions and filters
* *
...@@ -65,7 +75,7 @@ class WP_Revisions_Control { ...@@ -65,7 +75,7 @@ class WP_Revisions_Control {
* @uses add_filter * @uses add_filter
* @return null * @return null
*/ */
private function setup() { public function action_init() {
add_action( 'admin_init', array( $this, 'action_admin_init' ) ); add_action( 'admin_init', array( $this, 'action_admin_init' ) );
add_filter( 'wp_revisions_to_keep', array( $this, 'filter_wp_revisions_to_keep' ), 50, 2 ); add_filter( 'wp_revisions_to_keep', array( $this, 'filter_wp_revisions_to_keep' ), 50, 2 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment