Exemple #1
0
 /**
  * Register hooks.
  */
 protected function initialize()
 {
     parent::initialize();
     add_filter('comment_form_fields', array($this, 'comment_form_fields'));
     add_action('pre_comment_on_post', array($this, 'preprocess_comment_submit'));
     add_filter('pre_comment_approved', array($this, 'preprocess_comment'), 10, 2);
     add_action('comment_post', array($this, 'comment_posted'));
 }
Exemple #2
0
 /**
  * Constructor
  */
 protected function initialize()
 {
     parent::initialize();
     add_action('init', array($this, 'create_post_type'));
     add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     add_filter('query_vars', array($this, 'query_vars'));
     add_filter('rewrite_rules_array', array($this, 'rewrite_rules_array'));
     add_action('pre_get_posts', array($this, 'pre_get_posts'));
     add_action('transition_post_status', array($this, 'transition_post_status'), 10, 3);
     add_action('template_redirect', array($this, 'template_redirect'));
 }