templates_path = um_path . 'includes/admin/templates/'; add_action( 'admin_init', array( &$this, 'admin_init' ), 0 ); add_action( 'admin_notices', array( $this, 'check_wrong_install_folder' ), 3 ); } /** * Check if current page load UM post type * * * @return bool */ function is_plugin_post_type() { if ( isset( $_REQUEST['post_type'] ) ) { $post_type = $_REQUEST['post_type']; if ( in_array( $post_type, array( 'um_form','um_directory' ) ) ) { return true; } } elseif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'edit' ) { $post_type = get_post_type(); if ( in_array( $post_type, array( 'um_form', 'um_directory' ) ) ) { return true; } } return false; } /** * Check if plugin is installed with correct folder */ function check_wrong_install_folder() { $invalid_folder = false; $slug_array = explode( '/', um_plugin ); if ( $slug_array[0] != 'ultimate-member' ) $invalid_folder = true; if ( $invalid_folder ) { ?>

%s with wrong folder name. Correct folder name is "ultimate-member".', 'ultimate-member' ), ultimatemember_plugin_name ) ?>

*/ do_action( "um_admin_do_action__", $_REQUEST['um_adm_action'] ); /** * UM hook * * @type action * @title um_admin_do_action__{$action} * @description Make some action on custom admin $action * @input_vars * [{"var":"$action","type":"string","desc":"Admin Action"}] * @change_log * ["Since: 2.0"] * @usage add_action( 'um_admin_do_action__{$action}', 'function_name', 10, 1 ); * @example * */ do_action( "um_admin_do_action__{$_REQUEST['um_adm_action']}", $_REQUEST['um_adm_action'] ); } } } }