/** * Initialize the class * @param object $ap Parent class object. * @since 2.0.1 */ public function __construct($ap) { $this->ap = $ap; $this->ap->add_action('ap_processed_new_question', $this, 'after_new_question', 1, 2); $this->ap->add_action('ap_processed_new_answer', $this, 'after_new_answer', 1, 2); $this->ap->add_action('ap_processed_update_question', $this, 'ap_after_update_question', 1, 2); $this->ap->add_action('ap_processed_update_answer', $this, 'ap_after_update_answer', 1, 2); $this->ap->add_action('before_delete_post', $this, 'before_delete'); $this->ap->add_action('wp_trash_post', $this, 'trash_post_action'); $this->ap->add_action('untrash_post', $this, 'untrash_ans_on_question_untrash'); $this->ap->add_action('comment_post', $this, 'new_comment_approve', 10, 2); $this->ap->add_action('comment_unapproved_to_approved', $this, 'comment_approve'); $this->ap->add_action('comment_approved_to_unapproved', $this, 'comment_unapproved'); $this->ap->add_action('trashed_comment', $this, 'comment_trash'); $this->ap->add_action('delete_comment ', $this, 'comment_trash'); $this->ap->add_action('ap_publish_comment', $this, 'publish_comment'); $this->ap->add_action('ap_unpublish_comment', $this, 'unpublish_comment'); $this->ap->add_filter('wp_get_nav_menu_items', $this, 'update_menu_url'); $this->ap->add_filter('nav_menu_css_class', $this, 'fix_nav_current_class', 10, 2); $this->ap->add_filter('walker_nav_menu_start_el', $this, 'walker_nav_menu_start_el', 10, 4); $this->ap->add_action('wp_loaded', $this, 'flush_rules'); $this->ap->add_filter('mce_buttons', $this, 'editor_buttons', 10, 2); $this->ap->add_filter('wp_insert_post_data', $this, 'wp_insert_post_data', 10, 2); $this->ap->add_filter('ap_form_contents_filter', $this, 'sanitize_description'); $this->ap->add_action('safe_style_css', $this, 'safe_style_css', 11); $this->ap->add_action('save_post', $this, 'base_page_update', 10, 2); $this->ap->add_action('ap_added_follower', $this, 'ap_added_follower', 10, 2); $this->ap->add_action('ap_removed_follower', $this, 'ap_added_follower', 10, 2); $this->ap->add_action('ap_vote_casted', $this, 'update_user_vote_casted_count', 10, 4); $this->ap->add_action('ap_vote_removed', $this, 'update_user_vote_casted_count', 10, 4); $this->ap->add_action('ap_added_follower', $this, 'notify_user_about_follower', 10, 2); $this->ap->add_action('ap_vote_casted', $this, 'notify_upvote', 10, 4); $this->ap->add_action('the_post', $this, 'ap_append_vote_count'); }
/** * Initialize the class * @param object $ap parent class. */ public function __construct($ap) { $this->ap = $ap; $this->ap->add_action('init', $this, 'init_actions'); $this->ap->add_filter('post_class', $this, 'question_answer_post_class'); $this->ap->add_filter('body_class', $this, 'body_class'); $this->ap->add_filter('comments_template', $this, 'comment_template'); $this->ap->add_action('after_setup_theme', $this, 'includes'); $this->ap->add_filter('wp_title', $this, 'ap_title', 10, 2); $this->ap->add_filter('wpseo_title', $this, 'wpseo_title', 10, 2); $this->ap->add_filter('the_title', $this, 'the_title', 10, 2); $this->ap->add_filter('wp_head', $this, 'feed_link', 9); $this->ap->add_filter('wpseo_canonical', $this, 'wpseo_canonical'); $this->ap->add_action('ap_before', $this, 'ap_before_html_body'); $this->ap->add_action('wp', $this, 'remove_head_items', 10); $this->ap->add_action('wp_head', $this, 'wp_head', 11); }