Exemplo n.º 1
0
 public function init()
 {
     // return if reputation is disabled
     if (ap_opt('disable_reputation')) {
         return;
     }
     ap_register_user_page('reputation', __('Reputation', 'ap'), array($this, 'reputation_page'));
     add_filter('ap_user_menu', array($this, 'sort_reputation_page'));
     add_action('ap_after_new_question', array($this, 'new_question'));
     add_action('ap_untrash_question', array($this, 'new_question'));
     add_action('ap_trash_question', array($this, 'trash_question'), 10, 2);
     add_action('ap_after_new_answer', array($this, 'new_answer'));
     add_action('ap_untrash_answer', array($this, 'new_answer'));
     add_action('ap_trash_answer', array($this, 'delete_answer'), 10, 2);
     add_action('ap_select_answer', array($this, 'select_answer'), 10, 3);
     add_action('ap_unselect_answer', array($this, 'unselect_answer'), 10, 3);
     add_action('ap_vote_up', array($this, 'vote_up'), 10, 2);
     add_action('ap_vote_down', array($this, 'vote_down'), 10, 2);
     add_action('ap_undo_vote_up', array($this, 'undo_vote_up'), 10, 2);
     add_action('ap_undo_vote_down', array($this, 'undo_vote_down'), 10, 2);
     add_action('ap_publish_comment', array($this, 'new_comment'));
     add_action('ap_unpublish_comment', array($this, 'delete_comment'));
     add_filter('ap_user_display_meta_array', array($this, 'display_meta'), 10, 2);
     add_filter('user_register', array($this, 'user_register'));
 }
Exemplo n.º 2
0
 /**
  * Actions to do in init
  */
 public function init_actions()
 {
     // Register AnsPress pages.
     ap_register_page(ap_opt('users_page_slug'), __('Users', 'anspress-question-answer'), array($this, 'users_page'));
     ap_register_page(ap_opt('user_page_slug'), __('User', 'anspress-question-answer'), array($this, 'user_page'), false);
     ap_register_user_page('about', __('About', 'anspress-question-answer'), array($this, 'about_page'));
     ap_register_user_page('activity-feed', __('Activity Feed', 'anspress-question-answer'), array($this, 'feed_page'), true);
     ap_register_user_page('notification', __('Notification', 'anspress-question-answer'), array($this, 'notification_page'), true, false);
     ap_register_user_page('profile', __('Profile', 'anspress-question-answer'), array($this, 'profile_page'), true, false);
     ap_register_user_page('questions', __('Questions', 'anspress-question-answer'), array($this, 'questions_page'));
     ap_register_user_page('answers', __('Answers', 'anspress-question-answer'), array($this, 'answers_page'));
     ap_register_user_page('followers', __('Followers', 'anspress-question-answer'), array($this, 'followers_page'));
     ap_register_user_page('following', __('Following', 'anspress-question-answer'), array($this, 'following_page'));
     add_filter('ap_page_title', array($this, 'ap_page_title'));
 }
Exemplo n.º 3
0
 public function init_actions()
 {
     // Register AnsPress pages
     ap_register_page(ap_opt('users_page_slug'), __('Users', 'ap'), array($this, 'users_page'));
     ap_register_page(ap_opt('user_page_slug'), __('User', 'ap'), array($this, 'user_page'), false);
     // Register user pages
     ap_register_user_page('about', __('About', 'ap'), array($this, 'about_page'));
     ap_register_user_page('notification', __('Notification', 'ap'), array($this, 'notification_page'), true, false);
     ap_register_user_page('profile', __('Profile', 'ap'), array($this, 'profile_page'), true, false);
     ap_register_user_page('questions', __('Questions', 'ap'), array($this, 'questions_page'));
     ap_register_user_page('answers', __('Answers', 'ap'), array($this, 'answers_page'));
     ap_register_user_page('followers', __('Followers', 'ap'), array($this, 'followers_page'));
     ap_register_user_page('following', __('Following', 'ap'), array($this, 'following_page'));
     ap_register_user_page('subscription', __('Subscription', 'ap'), array($this, 'subscription_page'), true, false);
     add_filter('ap_page_title', array($this, 'ap_page_title'));
 }