/** * Checks the given account tab is registered. * * @since 1.0.0 * @param string $tab the key value of the array in wpum_get_account_page_tabs() must match slug * @return bool */ function wpum_account_tab_exists($tab) { $exists = false; if (array_key_exists($tab, wpum_get_account_page_tabs())) { $exists = true; } return $exists; }
/** * Adds tabs navigation on top of the account edit page. * * @since 1.0.0 * @access public * @return void */ function wpum_add_account_tabs($current_tab, $all_tabs, $form, $fields, $user_id, $atts) { get_wpum_template("account-tabs.php", array('tabs' => wpum_get_account_page_tabs(), 'current_tab' => $current_tab, 'all_tabs' => $all_tabs)); }
/** * Output the form. * * @access public * @since 1.0.0 * @return void */ public static function output($atts = array()) { // Get the tabs $current_account_tab = wpum_get_current_account_tab(); $all_tabs = array_keys(wpum_get_account_page_tabs()); // Get fields self::get_profile_fields(); // Display template if (is_user_logged_in()) { if (isset($_POST['submit_wpum_profile'])) { // Show errors from fields self::show_errors(); } get_wpum_template('account.php', array('atts' => $atts, 'form' => self::$form_name, 'fields' => self::get_fields('profile'), 'user_id' => self::$user->ID, 'current_tab' => $current_account_tab, 'all_tabs' => $all_tabs)); // Show login form if not logged in } else { echo wpum_login_form(); } }