mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Refactor debug information structure across plugins
Updated the structure of debug information methods by replacing `array_merge` with simpler array extensions and renaming variables for clarity. This ensures consistent handling of role metadata and improves readability and maintainability of code across multiple plugins.
This commit is contained in:
+1431
-1499
File diff suppressed because it is too large
Load Diff
@@ -1403,6 +1403,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'args' => array(
|
||||
'textarea_rows' => 6,
|
||||
),
|
||||
'conditional' => array( 'account_tab_delete', '=', '1' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'delete_account_no_pass_required_text',
|
||||
@@ -1412,6 +1413,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'args' => array(
|
||||
'textarea_rows' => 6,
|
||||
),
|
||||
'conditional' => array( 'account_tab_delete', '=', '1' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -103,7 +103,24 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
|
||||
* @return array
|
||||
*/
|
||||
public function tabs_privacy() {
|
||||
$privacy = apply_filters(
|
||||
/**
|
||||
* Filters a privacy list extend.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @hook um_profile_tabs_privacy_list
|
||||
*
|
||||
* @param {array} $privacy_option Add options for profile tabs' privacy.
|
||||
*
|
||||
* @return {array} Options for profile tabs' privacy.
|
||||
*
|
||||
* @example <caption>Add options for profile tabs' privacy.</caption>
|
||||
* function um_profile_menu_link_attrs( $privacy_option ) {
|
||||
* // your code here
|
||||
* return $privacy_option;
|
||||
* }
|
||||
* add_filter( 'um_profile_tabs_privacy_list', 'um_profile_tabs_privacy_list', 10, 1 );
|
||||
*/
|
||||
return apply_filters(
|
||||
'um_profile_tabs_privacy_list',
|
||||
array(
|
||||
0 => __( 'Anyone', 'ultimate-member' ),
|
||||
@@ -114,53 +131,46 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
|
||||
5 => __( 'Owner and specific roles', 'ultimate-member' ),
|
||||
)
|
||||
);
|
||||
|
||||
return $privacy;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* All tab data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function tabs() {
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type filter
|
||||
* @title um_profile_tabs
|
||||
* @description Extend user profile tabs
|
||||
* @input_vars
|
||||
* [{"var":"$tabs","type":"array","desc":"Profile tabs"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage
|
||||
* <?php add_filter( 'um_profile_tabs', 'function_name', 10, 1 ); ?>
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_profile_tabs', 'my_profile_tabs', 10, 1 );
|
||||
* function my_profile_tabs( $tabs ) {
|
||||
* // your code here
|
||||
* return $tabs;
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$tabs = apply_filters( 'um_profile_tabs', array(
|
||||
'main' => array(
|
||||
public function tabs() {
|
||||
$tabs = array(
|
||||
'main' => array(
|
||||
'name' => __( 'About', 'ultimate-member' ),
|
||||
'icon' => 'um-faicon-user'
|
||||
'icon' => 'um-faicon-user',
|
||||
),
|
||||
'posts' => array(
|
||||
'posts' => array(
|
||||
'name' => __( 'Posts', 'ultimate-member' ),
|
||||
'icon' => 'um-faicon-pencil'
|
||||
'icon' => 'um-faicon-pencil',
|
||||
),
|
||||
'comments' => array(
|
||||
'name' => __( 'Comments', 'ultimate-member' ),
|
||||
'icon' => 'um-faicon-comment'
|
||||
)
|
||||
) );
|
||||
'icon' => 'um-faicon-comment',
|
||||
),
|
||||
);
|
||||
/**
|
||||
* Filters user profile tabs
|
||||
*
|
||||
* @since 1.3.x
|
||||
* @hook um_profile_tabs
|
||||
*
|
||||
* @param {array} $tabs tabs list.
|
||||
*
|
||||
* @return {array} tabs list.
|
||||
*
|
||||
* @example <caption>Add user profile tabs.</caption>
|
||||
* function um_profile_tabs( $tabs ) {
|
||||
* // your code here
|
||||
* return $tabs;
|
||||
* }
|
||||
* add_filter( 'um_profile_tabs', 'um_profile_tabs' );
|
||||
*/
|
||||
$tabs = apply_filters( 'um_profile_tabs', $tabs );
|
||||
|
||||
// disable private tabs
|
||||
if ( ! is_admin() ) {
|
||||
|
||||
Reference in New Issue
Block a user