Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/55e8ec43e7da5b1974ff8a8142870b4c to your computer and use it in GitHub Desktop.
Save KaineLabs/55e8ec43e7da5b1974ff8a8142870b4c to your computer and use it in GitHub Desktop.
Add Account Pages Settings to Profile Pages Settings
<?php
// Add Account Export and Account Privacy to Profile page !
function add_account_pages_to_profile_page( $pages ) {
if ( 'on' == yz_options( 'yz_allow_private_profiles' ) ) {
$pages['account-privacy'] = array(
'name' => __( 'Account Privacy', 'youzer' ),
'icon' => 'user-secret',
'order' => 60
);
}
$pages['export-data'] = array(
'name' => __( 'Export Data', 'youzer' ),
'icon' => 'download',
'order' => 80
);
return $pages;
}
add_filter( 'profile_settings_pages', 'add_account_pages_to_profile_page' );
// Add Account Pages Settings to Profile Pages Settings
function yzc_add_account_pages_to_profile_pages() {
global $Youzer;
// Get Current Sub Page.
$page = bp_current_action();
switch ( $page ) {
case 'account-privacy':
$Youzer->widgets->basic_infos->account_privacy();
break;
case 'export-data':
$Youzer->widgets->basic_infos->export_data();
break;
}
}
add_action( 'youzer_profile_settings', 'yzc_add_account_page_pages' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment