AnsPress_Notification_Hook::init()

Description #

Initialize the class.

Source #

File: addons/free/notification.php

	public static function init() {
		ap_add_default_options([
			'user_page_title_notifications'  => __( 'Notifications', 'anspress-question-answer' ),
			'user_page_slug_notifications'   => 'notifications',
		]);

		// Activate AnsPress notifications only if buddypress not active.
		if ( ! ap_is_addon_active( 'free/buddypress.php' ) ) {
			ap_register_page( 'notifications', __( 'Notifications', 'anspress-question-answer' ), '', true, true );
			//anspress()->add_filter( 'ap_menu_link', __CLASS__, 'menu_link', 10, 2 );
			anspress()->add_filter( 'ap_menu_object', __CLASS__, 'ap_menu_object' );
			anspress()->add_filter( 'ap_form_addon-free_notification', __CLASS__, 'load_options' );
			anspress()->add_action( 'ap_notification_verbs', __CLASS__, 'register_verbs' );
			anspress()->add_action( 'ap_user_pages', __CLASS__, 'ap_user_pages' );
			anspress()->add_action( 'ap_after_new_answer', __CLASS__, 'new_answer', 10, 2 );
			anspress()->add_action( 'ap_trash_question', __CLASS__, 'trash_question', 10, 2 );
			anspress()->add_action( 'ap_before_delete_question', __CLASS__, 'trash_question', 10, 2 );
			anspress()->add_action( 'ap_trash_answer', __CLASS__, 'trash_answer', 10, 2 );
			anspress()->add_action( 'ap_before_delete_answer', __CLASS__, 'trash_answer', 10, 2 );
			anspress()->add_action( 'ap_untrash_answer', __CLASS__, 'new_answer', 10, 2 );
			anspress()->add_action( 'ap_select_answer', __CLASS__, 'select_answer' );
			anspress()->add_action( 'ap_unselect_answer', __CLASS__, 'unselect_answer' );
			anspress()->add_action( 'ap_publish_comment', __CLASS__, 'new_comment' );
			anspress()->add_action( 'ap_unpublish_comment', __CLASS__, 'delete_comment' );
			anspress()->add_action( 'ap_vote_up', __CLASS__, 'vote_up' );
			anspress()->add_action( 'ap_vote_down', __CLASS__, 'vote_down' );
			anspress()->add_action( 'ap_undo_vote_up', __CLASS__, 'undo_vote_up' );
			anspress()->add_action( 'ap_undo_vote_down', __CLASS__, 'undo_vote_down' );
			anspress()->add_action( 'ap_insert_reputation', __CLASS__, 'insert_reputation', 10, 4 );
			anspress()->add_action( 'ap_delete_reputation', __CLASS__, 'delete_reputation', 10, 3 );
			anspress()->add_action( 'ap_ajax_mark_notifications_seen', __CLASS__, 'mark_notifications_seen' );
			anspress()->add_action( 'ap_ajax_load_more_notifications', __CLASS__, 'load_more_notifications' );
			anspress()->add_action( 'ap_ajax_get_notifications', __CLASS__, 'get_notifications' );
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment