- hook docs;

This commit is contained in:
nikitozzzzzzz
2018-03-05 16:35:51 +02:00
parent 2e619ae995
commit 12891ff743
44 changed files with 3820 additions and 392 deletions
+103 -7
View File
@@ -458,7 +458,10 @@ if ( ! class_exists( 'Admin_Builder' ) ) {
if ( !is_user_logged_in() || !current_user_can('manage_options') ) die( __('Please login as administrator','ultimate-member') );
extract($_POST);
/**
* @var $act_id
*/
extract( $_POST );
switch ( $act_id ) {
@@ -466,8 +469,44 @@ if ( ! class_exists( 'Admin_Builder' ) ) {
ob_start();
do_action('um_admin_ajax_modal_content__hook', $act_id );
do_action("um_admin_ajax_modal_content__hook_{$act_id}");
/**
* UM hook
*
* @type action
* @title um_admin_ajax_modal_content__hook
* @description Integration hook on ajax popup admin builder modal content
* @input_vars
* [{"var":"$act_id","type":"string","desc":"Ajax Action"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_ajax_modal_content__hook', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_admin_ajax_modal_content__hook', 'my_admin_custom_hook', 10, 1 );
* function um_admin_ajax_modal_content__hook( $act_id ) {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_ajax_modal_content__hook', $act_id );
/**
* UM hook
*
* @type action
* @title um_admin_ajax_modal_content__hook_{$act_id}
* @description Integration hook on ajax popup admin builder modal content
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_ajax_modal_content__hook_{$act_id}', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_ajax_modal_content__hook_{$act_id}', 'my_admin_ajax_modal_content', 10 );
* function my_admin_ajax_modal_content() {
* // your code here
* }
* ?>
*/
do_action( "um_admin_ajax_modal_content__hook_{$act_id}" );
$output = ob_get_contents();
ob_end_clean();
@@ -605,7 +644,7 @@ if ( ! class_exists( 'Admin_Builder' ) ) {
<?php if ( isset( $args['mce_content'] ) ) { ?><div class="dynamic-mce-content"><?php echo $metabox->edit_array['content']; ?></div><?php } ?>
<?php do_action('um_admin_field_modal_header'); ?>
<?php $this->modal_header(); ?>
<div class="um-admin-half">
@@ -625,7 +664,7 @@ if ( ! class_exists( 'Admin_Builder' ) ) {
<?php if ( isset( $col_full ) ) {foreach( $col_full as $opt ) $metabox->field_input ( $opt, null, $metabox->edit_array ); } ?>
<?php do_action('um_admin_field_modal_footer', $arg2, $args, $metabox->in_edit, (isset( $metabox->edit_array ) ) ? $metabox->edit_array : '' ); ?>
<?php $this->modal_footer( $arg2, $args, $metabox ); ?>
<?php
@@ -665,7 +704,7 @@ if ( ! class_exists( 'Admin_Builder' ) ) {
<input type="hidden" name="post_id" id="post_id" value="<?php echo $arg2; ?>" />
<?php do_action('um_admin_field_modal_header'); ?>
<?php $this->modal_header(); ?>
<div class="um-admin-half">
@@ -685,7 +724,7 @@ if ( ! class_exists( 'Admin_Builder' ) ) {
<?php if ( isset( $col_full ) ) {foreach( $col_full as $opt ) $metabox->field_input ( $opt ); } ?>
<?php do_action('um_admin_field_modal_footer', $arg2, $args, $metabox->in_edit, (isset( $metabox->edit_array ) ) ? $metabox->edit_array : '' ); ?>
<?php $this->modal_footer( $arg2, $args, $metabox ); ?>
<?php
@@ -732,6 +771,63 @@ if ( ! class_exists( 'Admin_Builder' ) ) {
}
/**
*
*/
function modal_header() {
/**
* UM hook
*
* @type action
* @title um_admin_field_modal_header
* @description Modal Window Header
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_field_modal_header', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_field_modal_header', 'my_admin_field_modal_header', 10 );
* function my_admin_field_modal_header() {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_field_modal_header' );
}
/**
* @param $arg2
* @param $args
* @param $metabox
*/
function modal_footer( $arg2, $args, $metabox ) {
/**
* UM hook
*
* @type action
* @title um_admin_field_modal_footer
* @description Modal Window Footer
* @input_vars
* [{"var":"$arg2","type":"string","desc":"Ajax Action"},
* {"var":"$args","type":"array","desc":"Modal window arguments"},
* {"var":"$in_edit","type":"bool","desc":"Is edit mode?"},
* {"var":"$edit_array","type":"array","desc":"Edit Array"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_field_modal_footer', 'function_name', 10, 4 );
* @example
* <?php
* add_action( 'um_admin_field_modal_footer', 'my_admin_field_modal_footer', 10, 4 );
* function my_admin_field_modal_footer( $arg2, $args, $in_edit, $edit_array ) {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_field_modal_footer', $arg2, $args, $metabox->in_edit, ( isset( $metabox->edit_array ) ) ? $metabox->edit_array : '' );
}
/**
* Retrieves dropdown/multi-select options from a callback function
*/
+17 -1
View File
@@ -114,8 +114,24 @@ if ( ! class_exists( 'Admin_Menu' ) ) {
add_submenu_page( $this->slug, __( 'Member Directories', 'ultimate-member' ), __( 'Member Directories', 'ultimate-member' ), 'manage_options', 'edit.php?post_type=um_directory', '' );
}
/**
* UM hook
*
* @type action
* @title um_extend_admin_menu
* @description Extend UM menu
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_extend_admin_menu', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_extend_admin_menu', 'my_extend_admin_menu', 10 );
* function my_extend_admin_menu() {
* // your code here
* }
* ?>
*/
do_action( 'um_extend_admin_menu' );
}
+120 -3
View File
@@ -125,8 +125,31 @@ if ( ! class_exists( 'Admin_Metabox' ) ) {
function save_metabox_custom( $post_id, $post ) {
// validate nonce
if ( ! isset( $_POST['um_admin_save_metabox_custom_nonce'] ) || ! wp_verify_nonce( $_POST['um_admin_save_metabox_custom_nonce'], basename( __FILE__ ) ) ) return $post_id;
if ( ! isset( $_POST['um_admin_save_metabox_custom_nonce'] ) ||
! wp_verify_nonce( $_POST['um_admin_save_metabox_custom_nonce'], basename( __FILE__ ) ) ) {
return $post_id;
}
/**
* UM hook
*
* @type action
* @title um_admin_custom_restrict_content_metaboxes
* @description Save metabox custom with restrict content
* @input_vars
* [{"var":"$post_id","type":"int","desc":"Post ID"},
* {"var":"$post","type":"array","desc":"Post data"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_custom_restrict_content_metaboxes', 'function_name', 10, 2 );
* @example
* <?php
* add_action( 'um_admin_custom_restrict_content_metaboxes', 'my_admin_custom_restrict_content', 10, 2 );
* function my_admin_custom_restrict_content( $post_id, $post ) {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_custom_restrict_content_metaboxes', $post_id, $post );
}
@@ -134,7 +157,32 @@ if ( ! class_exists( 'Admin_Metabox' ) ) {
function add_metabox_restrict_content() {
global $current_screen;
add_meta_box( 'um-admin-restrict-content', __( 'UM Content Restriction', 'ultimate-member' ), array( &$this, 'restrict_content_cb' ), $current_screen->id, 'normal', 'default' );
add_meta_box(
'um-admin-restrict-content',
__( 'UM Content Restriction', 'ultimate-member' ),
array( &$this, 'restrict_content_cb' ),
$current_screen->id,
'normal',
'default'
);
/**
* UM hook
*
* @type action
* @title um_admin_custom_restrict_content_metaboxes
* @description Add restrict content custom metabox
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_custom_restrict_content_metaboxes', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_custom_restrict_content_metaboxes', 'my_admin_custom_restrict_content', 10 );
* function my_admin_custom_restrict_content() {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_custom_restrict_content_metaboxes' );
}
@@ -799,18 +847,68 @@ if ( ! class_exists( 'Admin_Metabox' ) ) {
add_meta_box('um-admin-form-register_customize', __( 'Customize this form' ), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
/**
* UM hook
*
* @type action
* @title um_admin_custom_register_metaboxes
* @description Add custom metaboxes for register form
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_custom_register_metaboxes', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_custom_register_metaboxes', 'my_admin_custom_register_metaboxes', 10 );
* function my_admin_custom_register_metaboxes() {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_custom_register_metaboxes' );
add_meta_box('um-admin-form-profile_customize', __('Customize this form'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
add_meta_box('um-admin-form-profile_settings', __('User Meta'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
/**
* UM hook
*
* @type action
* @title um_admin_custom_profile_metaboxes
* @description Add custom metaboxes for profile form
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_custom_profile_metaboxes', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_custom_profile_metaboxes', 'my_admin_custom_profile_metaboxes', 10 );
* function my_admin_custom_profile_metaboxes() {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_custom_profile_metaboxes' );
add_meta_box('um-admin-form-login_customize', __('Customize this form'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
add_meta_box('um-admin-form-login_settings', __('Options'), array(&$this, 'load_metabox_form'), 'um_form', 'side', 'default');
/**
* UM hook
*
* @type action
* @title um_admin_custom_login_metaboxes
* @description Add custom metaboxes for login form
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_custom_login_metaboxes', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_custom_login_metaboxes', 'my_admin_custom_login_metaboxes', 10 );
* function my_admin_custom_login_metaboxes() {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_custom_login_metaboxes' );
}
/***
@@ -931,6 +1029,25 @@ if ( ! class_exists( 'Admin_Metabox' ) ) {
default:
/**
* UM hook
*
* @type action
* @title um_admin_field_edit_hook{$attribute}
* @description Integration for 3-d party fields at wp-admin
* @input_vars
* [{"var":"$edit_mode_value","type":"string","desc":"Post ID"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_field_edit_hook{$attribute}', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_admin_field_edit_hook{$attribute}', 'my_admin_field_edit', 10, 1 );
* function my_admin_field_edit( $edit_mode_value ) {
* // your code here
* }
* ?>
*/
do_action( "um_admin_field_edit_hook{$attribute}", $this->edit_mode_value );
break;
+18 -1
View File
@@ -93,7 +93,24 @@ if ( ! class_exists( 'Admin_Notices' ) ) {
}
do_action('um_admin_after_main_notices');
/**
* UM hook
*
* @type action
* @title um_admin_after_main_notices
* @description Insert some content after main admin notices
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_after_main_notices', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_after_main_notices', 'my_admin_after_main_notices', 10 );
* function my_admin_after_main_notices() {
* // your code here
* }
* ?>
*/
do_action( 'um_admin_after_main_notices' );
}
}
+162 -4
View File
@@ -1125,9 +1125,44 @@ if ( ! class_exists( 'Admin_Settings' ) ) {
echo $this->generate_tabs_menu() . $this->generate_subtabs_menu( $current_tab );
/**
* UM hook
*
* @type action
* @title um_settings_page_before_{$current_tab}_{$current_subtab}_content
* @description Show some content before settings page content
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_settings_page_before_{$current_tab}_{$current_subtab}_content', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_settings_page_before_{$current_tab}_{$current_subtab}_content', 'my_settings_page_before', 10 );
* function my_settings_page_before() {
* // your code here
* }
* ?>
*/
do_action( "um_settings_page_before_" . $current_tab . "_" . $current_subtab . "_content" );
if ( 'licenses' == $current_tab || 'install_info' == $current_tab ) {
/**
* UM hook
*
* @type action
* @title um_settings_page_{$current_tab}_{$current_subtab}_before_section
* @description Show some content before section content at settings page
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_settings_page_{$current_tab}_{$current_subtab}_before_section', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_settings_page_{$current_tab}_{$current_subtab}_before_section', 'my_settings_page_before_section', 10 );
* function my_settings_page_before_section() {
* // your code here
* }
* ?>
*/
do_action( "um_settings_page_" . $current_tab . "_" . $current_subtab . "_before_section" );
$section_fields = $this->get_section_fields( $current_tab, $current_subtab );
@@ -1171,7 +1206,25 @@ if ( ! class_exists( 'Admin_Settings' ) ) {
<form method="post" action="" name="um-settings-form" id="um-settings-form">
<input type="hidden" value="save" name="um-settings-action" />
<?php do_action( "um_settings_page_" . $current_tab . "_" . $current_subtab . "_before_section" );
<?php
/**
* UM hook
*
* @type action
* @title um_settings_page_{$current_tab}_{$current_subtab}_before_section
* @description Show some content before section content at settings page
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_settings_page_{$current_tab}_{$current_subtab}_before_section', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_settings_page_{$current_tab}_{$current_subtab}_before_section', 'my_settings_page_before_section', 10 );
* function my_settings_page_before_section() {
* // your code here
* }
* ?>
*/
do_action( "um_settings_page_" . $current_tab . "_" . $current_subtab . "_before_section" );
$section_fields = $this->get_section_fields( $current_tab, $current_subtab );
@@ -1310,6 +1363,23 @@ if ( ! class_exists( 'Admin_Settings' ) ) {
*/
function save_settings_handler() {
if ( isset( $_POST['um-settings-action'] ) && 'save' == $_POST['um-settings-action'] && ! empty( $_POST['um_options'] ) ) {
/**
* UM hook
*
* @type action
* @title um_settings_before_save
* @description Before settings save action
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_settings_before_save', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_settings_before_save', 'my_settings_before_save', 10 );
* function my_settings_before_save() {
* // your code here
* }
* ?>
*/
do_action( "um_settings_before_save" );
/**
@@ -1338,6 +1408,23 @@ if ( ! class_exists( 'Admin_Settings' ) ) {
UM()->options()->update( $key, $value );
}
/**
* UM hook
*
* @type action
* @title um_settings_save
* @description After settings save action
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_settings_save', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_settings_save', 'my_settings_save', 10 );
* function my_settings_save() {
* // your code here
* }
* ?>
*/
do_action( "um_settings_save" );
//redirect after save settings
@@ -1962,7 +2049,25 @@ if ( ! class_exists( 'Admin_Settings' ) ) {
## Please include this information when posting support requests ##
<?php do_action( 'um_install_info_before' ); ?>
<?php
/**
* UM hook
*
* @type action
* @title um_install_info_before
* @description Before install info settings
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_install_info_before', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_install_info_before', 'my_install_info_before', 10 );
* function my_install_info_before() {
* // your code here
* }
* ?>
*/
do_action( 'um_install_info_before' ); ?>
--- Site Info ---
@@ -2047,7 +2152,25 @@ Exclude CSS/JS on Home: <?php if( UM()->options()->get( 'js_css_exlcude_home'
--- UM Pages Configuration ---
<?php do_action("um_install_info_before_page_config") ?>
<?php
/**
* UM hook
*
* @type action
* @title um_install_info_before_page_config
* @description Before page config install info
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_install_info_before_page_config', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_install_info_before_page_config', 'my_install_info_before_page_config', 10 );
* function my_install_info_before_page_config() {
* // your code here
* }
* ?>
*/
do_action( "um_install_info_before_page_config" ); ?>
User: <?php echo get_permalink( UM()->options()->get('core_user') ) . "\n"; ?>
Account: <?php echo get_permalink( UM()->options()->get('core_account') ) . "\n"; ?>
Members: <?php echo get_permalink( UM()->options()->get('core_members') ) . "\n"; ?>
@@ -2055,7 +2178,25 @@ Register: <?php echo get_permalink( UM()->options()->get('core_register') )
Login: <?php echo get_permalink( UM()->options()->get('core_login') ) . "\n"; ?>
Logout: <?php echo get_permalink( UM()->options()->get('core_logout') ) . "\n"; ?>
Password Reset: <?php echo get_permalink( UM()->options()->get('core_password-reset') ) . "\n"; ?>
<?php do_action("um_install_info_after_page_config") ?>
<?php
/**
* UM hook
*
* @type action
* @title um_install_info_after_page_config
* @description After page config install info
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_install_info_after_page_config', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_install_info_after_page_config', 'my_install_info_after_page_config', 10 );
* function my_install_info_after_page_config() {
* // your code here
* }
* ?>
*/
do_action( "um_install_info_after_page_config" ); ?>
--- UM Users Configuration ---
@@ -2247,6 +2388,23 @@ Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ?
}
/**
* UM hook
*
* @type action
* @title um_install_info_after
* @description After install info
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_install_info_after', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_install_info_after', 'my_install_info_after', 10 );
* function my_install_info_after() {
* // your code here
* }
* ?>
*/
do_action( 'um_install_info_after' ); ?>
### End Install Info ###
+1 -1
View File
@@ -14,7 +14,7 @@ if ( ! class_exists( 'Admin_Upgrade' ) ) {
function __construct() {
$this->packages_dir = plugin_dir_path( __FILE__ ).'packages/';
$this->packages_dir = plugin_dir_path( __FILE__ ) . 'packages' . DIRECTORY_SEPARATOR;
$um_last_version_upgrade = get_option( 'um_last_version_upgrade' );
+36
View File
@@ -304,8 +304,44 @@ if ( ! class_exists( 'Admin_Users' ) ) {
UM()->user()->set( $user_id );
if ( ! um_user( 'super_admin' ) ) {
/**
* UM hook
*
* @type action
* @title um_admin_user_action_hook
* @description Action on bulk user action
* @input_vars
* [{"var":"$bulk_action","type":"string","desc":"Bulk Action"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_user_action_hook{$action}', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_admin_user_action_hook', 'my_admin_user_action', 10, 1 );
* function my_admin_user_action( $bulk_action ) {
* // your code here
* }
* ?>
*/
do_action( "um_admin_user_action_hook", $bulk_action );
/**
* UM hook
*
* @type action
* @title um_admin_user_action_{$bulk_action}_hook
* @description Action on bulk user action
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_user_action_{$bulk_action}_hook', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_user_action_{$bulk_action}_hook', 'my_admin_user_action', 10 );
* function my_admin_user_action() {
* // your code here
* }
* ?>
*/
do_action( "um_admin_user_action_{$bulk_action}_hook" );
} else {
@@ -12,8 +12,7 @@ if ( isset($_REQUEST['_wp_http_referer']) ) {
//remove extra query arg
if ( !empty( $_GET['_wp_http_referer'] ) ) {
do_action( 'wp_client_redirect', remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
exit;
um_js_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
}
$order_by = 'u.user_registered';
+58 -38
View File
@@ -3,44 +3,64 @@
if ( ! defined( 'ABSPATH' ) ) exit;
/***
*** @Does an action to user asap
***/
add_action('um_admin_user_action_hook', 'um_admin_user_action_hook');
function um_admin_user_action_hook( $action ){
switch ( $action ) {
/**
* Does an action to user asap
*
* @param string $action
*/
function um_admin_user_action_hook( $action ) {
switch ( $action ) {
default:
do_action("um_admin_custom_hook_{$action}", UM()->user()->id );
break;
default:
/**
* UM hook
*
* @type action
* @title um_admin_custom_hook_{$action}
* @description Integration hook on user action
* @input_vars
* [{"var":"$user_id","type":"int","desc":"User ID"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_custom_hook_{$action}', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_admin_custom_hook_{$action}', 'my_admin_custom_hook', 10, 1 );
* function my_admin_after_main_notices( $user_id ) {
* // your code here
* }
* ?>
*/
do_action( "um_admin_custom_hook_{$action}", UM()->user()->id );
break;
case 'um_put_as_pending':
UM()->user()->pending();
break;
case 'um_approve_membership':
case 'um_reenable':
UM()->user()->approve();
break;
case 'um_reject_membership':
UM()->user()->reject();
break;
case 'um_resend_activation':
UM()->user()->email_pending();
break;
case 'um_deactivate':
UM()->user()->deactivate();
break;
case 'um_delete':
if ( is_admin() )
wp_die('This action is not allowed in backend.','ultimate-member');
UM()->user()->delete();
break;
case 'um_put_as_pending':
UM()->user()->pending();
break;
}
}
case 'um_approve_membership':
case 'um_reenable':
UM()->user()->approve();
break;
case 'um_reject_membership':
UM()->user()->reject();
break;
case 'um_resend_activation':
UM()->user()->email_pending();
break;
case 'um_deactivate':
UM()->user()->deactivate();
break;
case 'um_delete':
if ( is_admin() ) {
wp_die( 'This action is not allowed in backend.', 'ultimate-member' );
}
UM()->user()->delete();
break;
}
}
add_action( 'um_admin_user_action_hook', 'um_admin_user_action_hook', 10, 1 );
+38 -2
View File
@@ -171,8 +171,44 @@ if ( ! defined( 'ABSPATH' ) ) exit;
$subaction = $_REQUEST['sub'];
do_action("um_admin_user_action_hook", $subaction);
do_action("um_admin_user_action_{$subaction}_hook");
/**
* UM hook
*
* @type action
* @title um_admin_user_action_hook
* @description Action on bulk user subaction
* @input_vars
* [{"var":"$subaction","type":"string","desc":"Bulk Subaction"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_user_action_hook', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_admin_user_action_hook', 'my_admin_user_action', 10, 1 );
* function my_admin_user_action( $subaction ) {
* // your code here
* }
* ?>
*/
do_action( "um_admin_user_action_hook", $subaction );
/**
* UM hook
*
* @type action
* @title um_admin_user_action_{$subaction}_hook
* @description Action on bulk user subaction
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_admin_user_action_{$subaction}_hook', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_admin_user_action_{$subaction}_hook', 'my_admin_user_action', 10 );
* function my_admin_user_action() {
* // your code here
* }
* ?>
*/
do_action( "um_admin_user_action_{$subaction}_hook" );
um_reset_user();