AnsPress_Admin::init()
Description #
Initialize the plugin by loading admin scripts & styles and adding a settings page and menu.
Source #
File: admin/anspress-admin.php
public static function init() { self::includes(); $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . 'anspress-question-answer.php' ); anspress()->add_filter( 'plugin_action_links_' . $plugin_basename, __CLASS__, 'add_action_links' ); anspress()->add_action( 'save_post', __CLASS__, 'ans_parent_post', 10, 2 ); anspress()->add_action( 'trashed_post', __CLASS__, 'trashed_post', 10, 2 ); anspress()->add_action( 'admin_enqueue_scripts', __CLASS__, 'enqueue_admin_styles' ); anspress()->add_action( 'admin_enqueue_scripts', __CLASS__, 'enqueue_admin_scripts' ); anspress()->add_action( 'admin_menu', __CLASS__, 'add_plugin_admin_menu' ); anspress()->add_action( 'parent_file', __CLASS__, 'fix_active_admin_menu', 1000 ); anspress()->add_action( 'admin_init', __CLASS__, 'init_actions' ); anspress()->add_action( 'parent_file', __CLASS__, 'tax_menu_correction' ); anspress()->add_action( 'load-post.php', __CLASS__, 'question_meta_box_class' ); anspress()->add_action( 'load-post-new.php', __CLASS__, 'question_meta_box_class' ); anspress()->add_action( 'admin_menu', __CLASS__, 'change_post_menu_label' ); anspress()->add_filter( 'wp_insert_post_data', __CLASS__, 'post_data_check', 99 ); anspress()->add_action( 'admin_head-nav-menus.php', __CLASS__, 'ap_menu_metaboxes' ); anspress()->add_filter( 'posts_clauses', __CLASS__, 'join_by_author_name', 10, 2 ); anspress()->add_action( 'get_pages', __CLASS__, 'get_pages', 10, 2 ); anspress()->add_action( 'wp_insert_post_data', __CLASS__, 'modify_answer_title', 10, 2 ); anspress()->add_action( 'admin_footer-edit.php', __CLASS__, 'append_post_status_list_edit' ); anspress()->add_action( 'admin_footer-post.php', __CLASS__, 'append_post_status_list' ); anspress()->add_action( 'admin_footer-post-new.php', __CLASS__, 'append_post_status_list' ); anspress()->add_action( 'admin_post_anspress_update_db', __CLASS__, 'update_db' ); anspress()->add_action( 'admin_post_anspress_create_base_page', __CLASS__, 'anspress_create_base_page' ); anspress()->add_action( 'admin_notices', __CLASS__, 'anspress_notice' ); anspress()->add_action( 'ap_register_options', __CLASS__, 'register_options' ); anspress()->add_action( 'ap_after_field_markup', __CLASS__, 'page_select_field_opt' ); anspress()->add_action( 'admin_action_ap_addon_options', __CLASS__, 'ap_addon_options' ); anspress()->add_action( 'admin_action_ap_save_addon_options', __CLASS__, 'save_addon_options' ); anspress()->add_action( 'admin_footer', __CLASS__, 'admin_footer' ); }
Expand full source code Collapse full source code View on GitHub: admin/anspress-admin.php:49
Add your comment