Skip to content

Commit

Permalink
add general purpose actions
Browse files Browse the repository at this point in the history
  • Loading branch information
christianwach committed Dec 19, 2014
1 parent aa75284 commit c25748a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions commentpress-core/class_commentpress.php
Expand Up @@ -138,6 +138,20 @@ public function deactivate() {



/**
* Utility that fires an action when CommentPress has loaded
*
* @return void
*/
public function broadcast() {

// broadcast
do_action( 'commentpress_loaded' );

}



/**
* Loads translation, if present
*
Expand Down Expand Up @@ -2241,6 +2255,9 @@ function _init() {
// init workflow object
$this->editor = new CommentpressCoreEditor( $this );

// broadcast
do_action( 'commentpress_after_includes' );

// ---------------------------------------------------------------------
// Finally, register hooks
// ---------------------------------------------------------------------
Expand All @@ -2262,6 +2279,9 @@ function _register_hooks() {
// access version
global $wp_version;

// broadcast that CommentPress is active
add_action( 'plugins_loaded', array( $this, 'broadcast' ) );

// use translation
add_action( 'plugins_loaded', array( $this, 'translation' ) );

Expand Down Expand Up @@ -2364,6 +2384,9 @@ function _register_hooks() {
// amend the behaviour of Featured Comments plugin
add_action( 'plugins_loaded', array( $this, 'featured_comments_override' ), 1000 );

// broadcast
do_action( 'commentpress_after_hooks' );

}


Expand Down

0 comments on commit c25748a

Please sign in to comment.