コード例 #1
0
/**
 * Search content for email tags and filter email tags through their hooks
 *
 * @param string $content Content to search for email tags
 * @param int $user_id The user id
 * @param string $private_key the password
 *
 * @since 1.0.0
 *
 * @return string Content with email tags filtered out.
 */
function wpaam_do_email_tags($content, $user_id, $private_key)
{
    // Replace all tags
    $content = WPAAM()->email_tags->do_tags($content, $user_id, $private_key);
    // Return content
    return $content;
}
コード例 #2
0
ファイル: functions.php プロジェクト: devd123/wpaam
/**
 * Get the list of invoices fields formatted into an array.
 * The format of the array is used by the forms.
 *
 * @since 1.0.0
 * @return array - list of fields.
 */
function wpaam_get_invoices_fields()
{
    // Get fields from the database
    $group_id = 3;
    $args = array('id' => $group_id, 'array' => true, 'number' => -1, 'orderby' => 'field_order', 'order' => 'ASC');
    $data = WPAAM()->fields->get_by_group($args);
    // Manipulate fields list into a list formatted for the forms API.
    $fields = array();
    // Loop through the found fields
    foreach ($data as $key => $field) {
        $fields[$field['meta']] = apply_filters('wpaam_form_field', array('priority' => $field['field_order'], 'label' => $field['name'], 'type' => $field['type'], 'meta' => $field['meta'], 'required' => $field['is_required'], 'description' => $field['description'], 'placeholder' => apply_filters('wpaam_profile_field_placeholder', null, $field), 'options' => apply_filters('wpaam_profile_field_options', null, $field), 'value' => apply_filters('wpaam_profile_field_value', null, $field)), $field['options']);
    }
    return apply_filters('wpaam_get_invoices_fields', $fields);
}
コード例 #3
0
ファイル: template-actions.php プロジェクト: devd123/wpaam
function wpaam_show_invoices_edit_form($current_tab, $all_tabs, $form, $fields, $user_id, $atts)
{
    echo WPAAM()->forms->get_form('edit-invoice');
}
コード例 #4
0
ファイル: wp-aam.php プロジェクト: devd123/wpaam
                // Look in global /wp-content/languages/wpaam folder
                load_textdomain('wpaam', $mofile_global);
            } elseif (file_exists($mofile_local)) {
                // Look in local /wp-content/plugins/wp-user-manager/languages/ folder
                load_textdomain('wpaam', $mofile_local);
            } else {
                // Load the default language files
                load_plugin_textdomain('wpaam', false, $wpaam_lang_dir);
            }
        }
    }
}
/**
 * The main function responsible for returning WP_Adavance_Account_Manager
 * Instance to functions everywhere.
 *
 * Use this function like you would a global variable, except without needing
 * to declare the global.
 *
 * Example: <?php $wpaam = WPAAM(); ?>
 *
 * @since 1.0.0
 * @return object WP_Adavance_Account_Manager Instance
 */
function WPAAM()
{
    return WP_Adavance_Account_Manager::instance();
}
// Get WPAAM Running
WPAAM();
コード例 #5
0
ファイル: misc-functions.php プロジェクト: devd123/wpaam
/**
 * Wrapper function to install fields database table and install primary fields.
 *
 * @since 1.0.0
 * @return void
 */
function wpaam_install_fields()
{
    if (!get_option('wpaam_version_upgraded_from')) {
        // Create database table for field groups
        @WPAAM()->fields->create_table();
        // Get primary group id
        $primary_group = WPAAM()->field_groups->get_group_by('primary');
        // Install fields
        $fields = array(array('id' => 1, 'group_id' => $primary_group->id, 'type' => 'username', 'name' => 'Username', 'is_required' => true, 'show_on_registration' => true, 'can_delete' => false, 'meta' => 'username'), array('id' => 2, 'group_id' => $primary_group->id, 'type' => 'email', 'name' => 'Email', 'is_required' => true, 'show_on_registration' => true, 'can_delete' => false, 'meta' => 'user_email'), array('id' => 3, 'group_id' => $primary_group->id, 'type' => 'password', 'name' => 'Password', 'is_required' => true, 'show_on_registration' => true, 'can_delete' => false, 'meta' => 'password'), array('id' => 4, 'group_id' => $primary_group->id, 'type' => 'text', 'name' => 'First Name', 'is_required' => false, 'show_on_registration' => false, 'can_delete' => false, 'meta' => 'first_name'), array('id' => 5, 'group_id' => $primary_group->id, 'type' => 'text', 'name' => 'Last Name', 'is_required' => false, 'show_on_registration' => false, 'can_delete' => false, 'meta' => 'last_name'), array('id' => 6, 'group_id' => $primary_group->id, 'type' => 'nickname', 'name' => 'Nickname', 'is_required' => true, 'show_on_registration' => false, 'can_delete' => false, 'meta' => 'nickname'), array('id' => 8, 'group_id' => $primary_group->id, 'type' => 'text', 'name' => 'Website', 'is_required' => false, 'show_on_registration' => false, 'can_delete' => false, 'meta' => 'user_url'), array('id' => 9, 'group_id' => $primary_group->id, 'type' => 'textarea', 'name' => 'Description', 'is_required' => false, 'show_on_registration' => false, 'can_delete' => false, 'meta' => 'description'), array('id' => 10, 'group_id' => $primary_group->id, 'type' => 'avatar', 'name' => 'Profile Picture', 'is_required' => false, 'show_on_registration' => false, 'can_delete' => false, 'meta' => 'user_avatar'));
        foreach ($fields as $field) {
            WPAAM()->fields->add($field);
        }
    }
}
コード例 #6
0
 /**
  * Password Recovery Form Shortcode
  *
  * @access public
  * @since  1.0.0
  * @return $output shortcode output
  */
 public function wpaam_password($atts, $content = null)
 {
     extract(shortcode_atts(array('form_id' => 'default_password_form', 'login_link' => '', 'psw_link' => '', 'register_link' => ''), $atts));
     // Set default values
     if (!array_key_exists('form_id', $atts) || empty($atts['form_id'])) {
         $atts['form_id'] = 'default_password_form';
     }
     return WPAAM()->forms->get_form('password', $atts);
 }