Example #1
0
function wpaam_add_account_tabs($current_tab, $all_tabs, $form, $fields, $user_id, $atts)
{
    get_wpaam_template("account-tabs.php", array('tabs' => wpaam_get_account_page_tabs(), 'current_tab' => $current_tab, 'all_tabs' => $all_tabs));
}
Example #2
0
/**
 * Checks the given account tab is registered.
 *
 * @since 1.0.0
 * @param string  $tab the key value of the array in wpaam_get_account_page_tabs() must match slug
 * @return bool
 */
function wpaam_account_tab_exists($tab)
{
    $exists = false;
    if (array_key_exists($tab, wpaam_get_account_page_tabs())) {
        $exists = true;
    }
    return $exists;
}
 /**
  * Output the form.
  *
  * @access public
  * @since 1.0.0
  * @return void
  */
 public static function output($atts = array())
 {
     // Get the tabs
     $current_account_tab = wpaam_get_current_account_tab();
     $all_tabs = array_keys(wpaam_get_account_page_tabs());
     // Display template
     if (is_user_logged_in() && current_user_can('create_users')) {
         if (isset($_POST['submit_wpaam_profile'])) {
             // Show errors from fields
             self::show_errors();
             // Show confirmation messages
             self::show_confirmations();
         }
         get_wpaam_template('forms/account-form.php', array('atts' => $atts, 'form' => self::$form_name, 'user_id' => self::$user->ID, 'current_tab' => $current_account_tab, 'all_tabs' => $all_tabs));
     } elseif (is_user_logged_in() && current_user_can('aam_client')) {
         get_wpaam_template('client_account.php', array('atts' => $atts, 'form' => self::$form_name, 'user_id' => self::$user->ID, 'current_tab' => $current_account_tab, 'all_tabs' => $all_tabs));
         // Show login form if not logged in
     } else {
         echo wpaam_login_form();
     }
 }
Example #4
0
 public function wpaam_account($atts, $content = null)
 {
     $user = wp_get_current_user();
     // Get the tabs
     $current_account_tab = wpaam_get_current_account_tab();
     $all_tabs = array_keys(wpaam_get_account_page_tabs());
     // Display template
     if (is_user_logged_in()) {
         get_wpaam_template('account.php', array('atts' => $atts, 'user_id' => $user->ID, 'current_tab' => $current_account_tab, 'all_tabs' => $all_tabs));
         // Show login form if not logged in
     } else {
         echo wpaam_login_form();
     }
 }