mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
@@ -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