Plugin Directory

Changeset 3186203


Ignore:
Timestamp:
11/12/2024 06:42:38 AM (16 months ago)
Author:
danbilabs
Message:

Version 0.9.4

Location:
advanced-members/trunk
Files:
51 edited

Legend:

Unmodified
Added
Removed
  • advanced-members/trunk/acf/fields/base/trait-amem-field.php

    r3182890 r3186203  
    1818
    1919        protected function _form_type() {
    20             if ( isset(AMem()->form['_amem_local']) )
    21                 return AMem()->form['type'];
    22             if ( isset(AMem()->form['post_id']) ) {
    23                 return amem_form_type(AMem()->form['post_id']);
     20            if ( isset(amem()->form['_amem_local']) )
     21                return amem()->form['type'];
     22            if ( isset(amem()->form['post_id']) ) {
     23                return amem_form_type(amem()->form['post_id']);
    2424            }
    2525            return null;
  • advanced-members/trunk/acf/fields/class-display-name.php

    r3182890 r3186203  
    5454        if ( amem_user('ID') || $this->_user ) {
    5555            if ( $this->_user ) {
    56                 AMem()->switch($this->_user->ID);
     56                amem()->switch($this->_user->ID);
    5757            }
    5858
     
    125125        }
    126126        if ( $this->_user ) {
    127             AMem()->user->restore();
     127            amem()->user->restore();
    128128            $this->_user = null;
    129129        }
  • advanced-members/trunk/acf/fields/class-user-email.php

    r3182890 r3186203  
    7373        if( $user_id ){
    7474            $edit_user = get_user_by( 'ID', $user_id );
     75        }
     76
     77        if ( $this->mode() == 'login' ) {
     78            if ( !email_exists( $value ) ) {
     79                return sprintf( __( 'The email is not existing in this site. Please try a different email', 'advanced-members' ) );
     80            }
     81            // Validation will be passed to login action validator
     82            return $is_valid;
    7583        }
    7684
  • advanced-members/trunk/acf/fields/class-user-password-confirm.php

    r3182890 r3186203  
    3232
    3333    function prepare_field( $field ) {
    34         $form = AMem()->form;
     34        $form = amem()->form;
    3535        if ( isset( $field['wrapper']['class'] ) ) {
    3636            $field['wrapper']['class'] .= ' amem-password-confirm amem-pwd';
  • advanced-members/trunk/acf/fields/class-user-password-current.php

    r3182890 r3186203  
    4343        }
    4444
    45         $form = AMem()->form;
     45        $form = amem()->form;
    4646        if ( isset( $form['approval'] ) ) {
    4747            return false;
     
    7070            return __( 'Current password is required', 'advanced-members' );
    7171
    72         $user_data = !empty(AMem()->user->data) ? AMem()->user->data : [];
     72        $user_data = !empty(amem()->user->data) ? amem()->user->data : [];
    7373
    7474        $user = false;
    7575        if ( $user_data && wp_check_password( $value, $user_data['user_pass'], $user_data['ID'] ) ) {
    76             AMem()->submission['form']['auth_id'] = $user_data['ID'];
     76            amem()->submission['form']['auth_id'] = $user_data['ID'];
    7777        } else {
    78             $is_valid = AMem()->errors->text('password_incorrect');//__( 'Current password is incorrect. Please try again.', 'advanced-members' );
     78            $is_valid = amem()->errors->text('password_incorrect');//__( 'Current password is incorrect. Please try again.', 'advanced-members' );
    7979            // amem_add_error( $this->name, __( 'Current password is incorrect. Please try again.', 'advanced-members' ) );
    8080        }
  • advanced-members/trunk/acf/fields/class-user-password.php

    r3182890 r3186203  
    5252        // }
    5353
    54         $form = AMem()->form;
     54        $form = amem()->form;
    5555        if ( isset( $form['approval'] ) ) {
    5656            return false;
     
    8080        }
    8181
    82         if ( $field['show_pass_confirm'] && AMem()->is_amem() ) {
     82        if ( $field['show_pass_confirm'] && amem()->is_amem() ) {
    8383            $ps_confirm_field = sanitize_key( $_POST['custom_password_confirm'] ); // phpcs:disable WordPress.Security.NonceVerification -- already verified by ACF
    8484            if ( !isset($_POST[ $ps_confirm_field ]) || sanitize_text_field($_POST[ $ps_confirm_field ]) != $value ) { // phpcs:disable WordPress.Security.NonceVerification -- already verified by ACF
     
    163163        $confirm = acf_get_local_field('user_password_confirm');
    164164
    165         AMem()->render->render_field( $confirm, $form, $args );
     165        amem()->render->render_field( $confirm, $form, $args );
    166166
    167167        remove_action( 'amem/field/after_field/key=' . $field['key'], [$this, 'print_confirm_field'] );
  • advanced-members/trunk/acf/fields/class-username.php

    r3182890 r3186203  
    3636    public function prepare_field( $field ) {
    3737        // make sure field is not disabled when no value exists
    38         if ( ! $field['value'] || !empty( AMem()->submission ) ) {
     38        if ( ! $field['value'] || !empty( amem()->submission ) ) {
    3939            $field['disabled'] = 0;
    4040        } else {
  • advanced-members/trunk/admin/class-admin-forms.php

    r3182890 r3186203  
    77}
    88
    9 if ( ! class_exists( 'AMem_ADMIN_FORMS' ) ) :
     9if ( ! class_exists( 'AMEM_ADMIN_FORMS' ) ) :
    1010class ADMIN_FORMS extends Module {
    1111
     
    255255     */
    256256    function register_fields() {
    257         $form_ajax = AMem()->options->get('ajax_submit');
     257        $form_ajax = amem()->options->get('ajax_submit');
    258258
    259259        $general_fields = [
     
    592592
    593593        $account_fields = [];
    594         // if ( AMem()->options->get('account/use_delete') ) {
     594        // if ( amem()->options->get('account/use_delete') ) {
    595595            // $account_fields[] = array(
    596596            //  'type'                              => 'select',
     
    10911091}
    10921092
    1093 AMem()->register_module('admin/forms', ADMIN_FORMS::getInstance());
     1093amem()->register_module('admin/forms', ADMIN_FORMS::getInstance());
    10941094
    10951095endif; // class_exists check
  • advanced-members/trunk/admin/class-admin-options.php

    r3182890 r3186203  
    9595        if( isset($_POST['amem_modules'])){ // phpcs:disable WordPress.Security.NonceVerification -- already verified by ACF
    9696            update_option( 'amem_modules', amem_sanitize_vars($_POST['amem_modules']) ); // phpcs:disable WordPress.Security.NonceVerification -- already verified by ACF
    97             AMem()->options->modules = amem_sanitize_vars($_POST['amem_modules']); // phpcs:disable WordPress.Security.NonceVerification -- already verified by ACF
     97            amem()->options->modules = amem_sanitize_vars($_POST['amem_modules']); // phpcs:disable WordPress.Security.NonceVerification -- already verified by ACF
    9898            acf_add_admin_notice( __('Dashboard Update Success', 'advanced-members'), 'success' );
    9999        }
     
    324324            'account'       => __( 'Account', 'advanced-members' ),
    325325        );
    326         if ( AMem()->options->getmodule('_use_redirects') ) {
     326        if ( amem()->options->getmodule('_use_redirects') ) {
    327327            $option_tabs['redirects'] = __( 'Redirects', 'advanced-members' );
    328328        }
    329         if ( AMem()->options->getmodule('_use_adminbar') ) {
     329        if ( amem()->options->getmodule('_use_adminbar') ) {
    330330            $option_tabs['adminbar'] = __( 'Admin Bar', 'advanced-members' );
    331331        }
     
    389389
    390390    function enqueue_admin_scripts() {
    391         wp_enqueue_style( 'amem-admin', amem_get_url('assets/build/css/admin.css'), [], AMem_VERSION );
     391        wp_enqueue_style( 'amem-admin', amem_get_url('assets/build/css/admin.css'), [], AMEM_VERSION );
    392392        if ( !amem_is_screen( ['amem-form', 'edit-amem-form', 'acf-field-group', 'acf_page_amem_settings', 'acf_page_amem_dashboard']) )
    393393            return;
    394394
    395         AMem()->fields->enqueue_scripts();
     395        amem()->fields->enqueue_scripts();
    396396
    397397        $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.min' : '';
    398         wp_register_script( 'amem-admin', amem_get_url('assets/build/js/amem-admin.js'), ['jquery', 'acf-input', 'amem-input'], AMem_VERSION, true );
     398        wp_register_script( 'amem-admin', amem_get_url('assets/build/js/amem-admin.js'), ['jquery', 'acf-input', 'amem-input'], AMEM_VERSION, true );
    399399
    400400        $account_forms = array(
     
    437437
    438438    function register_core_page_option_button() {
    439         foreach( array_keys(AMem()->config->core_pages) as $page_key ) {
    440             $name = AMem()->options->get_core_page_id($page_key);
     439        foreach( array_keys(amem()->config->core_pages) as $page_key ) {
     440            $name = amem()->options->get_core_page_id($page_key);
    441441            // $name = "amem_options[{$name}]";
    442442            add_action( 'acf/render_field/name=' . $name, [$this, 'core_page_option_button'] );
     
    466466            break;
    467467            case 'account':
    468             if ( AMem()->options->get('accform/default') )
    469                 return AMem()->options->get('accform/default');
     468            if ( amem()->options->get('accform/default') )
     469                return amem()->options->get('accform/default');
    470470            return false;
    471471            break;
     
    497497}
    498498
    499 AMem()->register_module('admin_options', ADMIN_OPTIONS::getInstance());
     499amem()->register_module('admin_options', ADMIN_OPTIONS::getInstance());
    500500
    501501endif; // class_exists check
  • advanced-members/trunk/admin/class-admin.php

    r3182890 r3186203  
    9393     */
    9494    function render_custom_user_profile_fields( $user ) {
    95         // if( AMem()->options->get('accform/account_form_showadmin') ) {
     95        // if( amem()->options->get('accform/account_form_showadmin') ) {
    9696        // Removed option and provides hook
    9797        if ( apply_filters( 'amem/account/fields/showadmin', true ) ) {
     
    106106                );
    107107
    108                 $bypass = AMem()->fields->predefined_fields();
     108                $bypass = amem()->fields->predefined_fields();
    109109
    110110                echo '<table class="form-table"><tbody>';
     
    127127
    128128    public function add_display_post_states( $post_states, $post ) {
    129         foreach ( AMem()->config->core_pages as $page_key => $page_value ) {
    130             $page_id = AMem()->options->get( AMem()->options->get_core_page_id($page_key) );
     129        foreach ( amem()->config->core_pages as $page_key => $page_value ) {
     130            $page_id = amem()->options->get( amem()->options->get_core_page_id($page_key) );
    131131            if ( $page_id == $post->ID ) {
    132132                $post_states[ 'amem_' . $page_key ] = sprintf( 'Advanced Members for ACF %s', $page_value['label'] );
     
    150150        }
    151151        $role = $user_role;
    152         $account_option = AMem()->options->options['accform'];
     152        $account_option = amem()->options->options['accform'];
    153153        if( is_array($user_role) ){
    154154            $role = $user_role[0];
     
    183183    }
    184184    public function not_install_core_pages() {
    185         AMem()->setup()->not_install_core_pages();
     185        amem()->setup()->not_install_core_pages();
    186186    }
    187187
    188188    public function install_core_pages() {
    189         AMem()->setup()->install_default_forms();
     189        amem()->setup()->install_default_forms();
    190190    }
    191191
    192192    protected $name = 'amem/admin';
    193193}
    194 AMem()->register_module('admin', ADMIN::getInstance());
     194amem()->register_module('admin', ADMIN::getInstance());
    195195
    196196endif; // class_exists check
  • advanced-members/trunk/admin/class-menu.php

    r3182890 r3186203  
    2323
    2424        /** @todo Supports Customizer menu settings and save when WP core supports plugins */
    25         if ( AMem()->is_dev() ) {
     25        if ( amem()->is_dev() ) {
    2626            add_action( 'wp_nav_menu_item_custom_fields_customize_template', [ __CLASS__, 'custom_fields_customize_template' ] );
    2727            // add_action( 'customize_controls_print_footer_scripts', [ __CLASS__, 'print_scripts' ] );
     
    5252
    5353        // if ( $item->object == 'page' ) {
    54         //  $menu_type = array_search( $item->object_id, AMem()->options->get_core_pages() );
     54        //  $menu_type = array_search( $item->object_id, amem()->options->get_core_pages() );
    5555        // }
    5656
  • advanced-members/trunk/admin/views/html-dashboard-page.php

    r3182890 r3186203  
    4242                                            'key'          => '_use_redirects',
    4343                                            'prefix'       => 'amem_modules',
    44                                             'value'        => AMem()->options->getmodule('_use_redirects'),
     44                                            'value'        => amem()->options->getmodule('_use_redirects'),
    4545                                            'label'        => __( 'Redirects', 'advanced-members' ),
    4646                                            'instructions' => __( 'Redirect users to different pages or URLs after they register, login in and log out based on user roles.', 'advanced-members' ),
     
    5959                                                'key'          => '_use_menu',
    6060                                                'prefix'       => 'amem_modules',
    61                                                 'value'        => AMem()->options->getmodule('_use_menu'),
     61                                                'value'        => amem()->options->getmodule('_use_menu'),
    6262                                                'label'        => __( 'Menu Item Visibility', 'advanced-members' ),
    6363                                                'instructions' => __( 'Enable/disable menu visibility settings on navigation menu screen. You can show or hide the menu by user\'s login status and role.', 'advanced-members' ),
     
    8484                                            'key'          => '_use_adminbar',
    8585                                            'prefix'       => 'amem_modules',
    86                                             'value'        => AMem()->options->getmodule('_use_adminbar'),
     86                                            'value'        => amem()->options->getmodule('_use_adminbar'),
    8787                                            'label'        => __( 'Disable Admin Bar', 'advanced-members' ),
    8888                                            'instructions' => __( 'Disable the admin bar based on user roles.', 'advanced-members' ),
  • advanced-members/trunk/admin/views/html-option-single-role.php

    r3182890 r3186203  
    2929                        'key'          => '_after_' . $act,
    3030                        'prefix'       => $prefix,
    31                         'value'        => AMem()->options->get('redirect/roles/'.$key.'/_after_' . $act),
     31                        'value'        => amem()->options->get('redirect/roles/'.$key.'/_after_' . $act),
    3232                        'label'        => $data['label'],
    3333                        'choices'      => $_choices,
     
    4343                        'key'          => $act . '_redirect_url',
    4444                        'prefix'       => $prefix,
    45                         'value'        => AMem()->options->get('redirect/roles/' .$key .'/'. $act . '_redirect_url'),
     45                        'value'        => amem()->options->get('redirect/roles/' .$key .'/'. $act . '_redirect_url'),
    4646                        'label'        => __( 'Set Custom Redirect URL', 'advanced-members' ),
    4747                        'instructions' => $instuction,
  • advanced-members/trunk/admin/views/html-options-list-email.php

    r3182890 r3186203  
    4949            'key'          => 'activation_link_expiry_time',
    5050            'prefix'       => 'amem_options',
    51             'value'        => AMem()->options->get('activation_link_expiry_time', 0),
     51            'value'        => amem()->options->get('activation_link_expiry_time', 0),
    5252            'label'        => __( 'Email Activation Link Expiry', 'advanced-members' ),
    5353            'instructions' => __( 'Set email activation link expiry time limit in days.', 'advanced-members' ),
  • advanced-members/trunk/admin/views/html-options-page.php

    r3182890 r3186203  
    2222        // Re-initialize updated options
    2323        if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
    24             AMem()->options->init(true);
     24            amem()->options->init(true);
    2525
    2626        $pages = array(
     
    124124                            case 'general':
    125125                                echo '<h3>' . esc_html__( 'Advanced Members for ACF Pages', 'advanced-members' ) . '</h3>';
    126                                 foreach (AMem()->config->core_pages as $page_key => $page_value) {
    127                                     $page_id = AMem()->options->get_core_page_id($page_key);
     126                                foreach (amem()->config->core_pages as $page_key => $page_value) {
     127                                    $page_id = amem()->options->get_core_page_id($page_key);
    128128                                    // if ( $page_id && $page_key == 'account' ) {
    129129                                    //  $instructions = __('Edit form link for account is \'Default Account Form\' set form Account Forms settings.', 'advanced-members');
     
    137137                                            'key'          => $page_id,
    138138                                            'prefix'       => 'amem_options',
    139                                             'value'        => AMem()->options->get($page_id),
     139                                            'value'        => amem()->options->get($page_id),
    140140                                            'label'        => $page_value['label'],
    141141                                            'choices'      => $pages,
     
    156156                                        'key'          => 'ajax_submit',
    157157                                        'prefix'       => 'amem_options',
    158                                         'value'        => AMem()->options->get('ajax_submit'),
     158                                        'value'        => amem()->options->get('ajax_submit'),
    159159                                        'label'        => __( 'AJAX Submit', 'advanced-members' ),
    160160                                        'instructions' => __( 'Enable/disable AJAX form submit instead of page load. This option is overridden by Form and Shorcode option.', 'advanced-members' ),
     
    172172                                        'key'          => 'load_theme',
    173173                                        'prefix'       => 'amem_options',
    174                                         'value'        => AMem()->options->get('load_theme', true),
     174                                        'value'        => amem()->options->get('load_theme', true),
    175175                                        'label'        => __( 'Load default style', 'advanced-members' ),
    176176                                        'instructions' => __( 'Enable/disable loading default CSS style.', 'advanced-members' ),
     
    189189                                //      'key'          => 'account_form_showadmin',
    190190                                //      'prefix'       => 'amem_options[accform]',
    191                                 //      'value'        => AMem()->options->get('accform/account_form_showadmin'),
     191                                //      'value'        => amem()->options->get('accform/account_form_showadmin'),
    192192                                //      'label'        => __( 'User Profile', 'advanced-members' ),
    193193                                //      'instructions' => __( 'Enable/disable used on the User Profile edit', 'advanced-members' ),
     
    203203                                        'key'          => 'show_current_passwd',
    204204                                        'prefix'       => 'amem_options[account]',
    205                                         'value'        => AMem()->options->get('account/show_current_passwd'),
     205                                        'value'        => amem()->options->get('account/show_current_passwd'),
    206206                                        'label'        => __( 'Current Password on Account', 'advanced-members' ),
    207207                                        'instructions' => __( 'Show current password confirm field on general account page', 'advanced-members' ),
     
    217217                                //      'key'          => 'use_password',
    218218                                //      'prefix'       => 'amem_options[account]',
    219                                 //      'value'        => AMem()->options->get('account/use_password'),
     219                                //      'value'        => amem()->options->get('account/use_password'),
    220220                                //      'label'        => __( 'Account Password Change', 'advanced-members' ),
    221221                                //      'instructions' => __( 'Enable/disable the Password Change for account. <code>[advanced-members-account tab="password"]</code>', 'advanced-members' ),
     
    231231                                //      'key'          => 'use_delete',
    232232                                //      'prefix'       => 'amem_options[account]',
    233                                 //      'value'        => AMem()->options->get('account/use_delete'),
     233                                //      'value'        => amem()->options->get('account/use_delete'),
    234234                                //      'label'        => __( 'Account Deletion', 'advanced-members' ),
    235235                                //      'instructions' => __( 'Enable/disable the Delete account for account. <code>[advanced-members-account tab="delete"]</code>', 'advanced-members' ),
     
    248248                                        'key'          => 'default',
    249249                                        'prefix'       => 'amem_options[accform]',
    250                                         'value'        => AMem()->options->get('accform/default'),
     250                                        'value'        => amem()->options->get('accform/default'),
    251251                                        'label'        => __( 'Default Account Form', 'advanced-members' ),
    252252                                        'choices'      => $account_forms,
     
    263263
    264264                                );
    265                                 if( !empty( AMem()->options->get('accform/rules') ) ) {
    266                                     $view_args['group'] = AMem()->options->get('accform/rules');
     265                                if( !empty( amem()->options->get('accform/rules') ) ) {
     266                                    $view_args['group'] = amem()->options->get('accform/rules');
    267267                                }
    268268                                amem_get_view( __DIR__ . '/html-options-rule-fields.php', $view_args );
     
    275275                                            'key'          => $role_key,
    276276                                            'prefix'       => 'amem_options[accform]',
    277                                             'value'        => AMem()->options->get('accform/role_key'),
     277                                            'value'        => amem()->options->get('accform/role_key'),
    278278                                            'label'        => $role_label,
    279279                                            'choices'      => $account_forms,
     
    295295                                    'key'          => 'delete_account_text',
    296296                                    'prefix'       => 'amem_options[account]',
    297                                     'value'        => AMem()->options->get('account/delete_account_text'),
     297                                    'value'        => amem()->options->get('account/delete_account_text'),
    298298                                    'label'        => __( 'Account Deletion Custom Text', 'advanced-members' ),
    299299                                    'instructions' => __( 'This is custom text that will be displayed to users before they delete their accounts from your site.', 'advanced-members' ),
     
    313313                                    'key'          => 'delete_account_label',
    314314                                    'prefix'       => 'amem_options[account]',
    315                                     'value'        => AMem()->options->get('account/delete_account_label'),
     315                                    'value'        => amem()->options->get('account/delete_account_label'),
    316316                                    'label'        => __( 'Account Deletion Confirmation Label', 'advanced-members' ),
    317317                                    'instructions' => __( 'This is label that will be displayed right of account deletion agree check.', 'advanced-members' ),
     
    342342                                        'key'          => '_after_' . $act,
    343343                                        'prefix'       => 'amem_options[redirect]',
    344                                         'value'        => AMem()->options->get('redirect/_after_' . $act),
     344                                        'value'        => amem()->options->get('redirect/_after_' . $act),
    345345                                        'label'        => $data['label'],
    346346                                        'choices'      => $_choices,
     
    356356                                        'key'          => $act . '_redirect_url',
    357357                                        'prefix'       => 'amem_options[redirect]',
    358                                         'value'        => AMem()->options->get('redirect/' . $act . '_redirect_url'),
     358                                        'value'        => amem()->options->get('redirect/' . $act . '_redirect_url'),
    359359                                        'label'        => __( 'Set Custom Redirect URL', 'advanced-members' ),
    360360                                        'instructions' => $instuction,
     
    379379                                    'key'          => 'apply_roles_redirection',
    380380                                    'prefix'       => 'amem_options[roles]',
    381                                     'value'        => AMem()->options->get('roles/apply_roles_redirection'),
     381                                    'value'        => amem()->options->get('roles/apply_roles_redirection'),
    382382                                    'label'        => __( 'Enable redirection by role', 'advanced-members' ),
    383383                                    'instructions' => __( 'Enable/disable used on the redirection by role', 'advanced-members' ),
     
    393393                                'redirections'              => $redirections,
    394394                                'choices'                           => $choices,
    395                                 'table_wrap_class'      => AMem()->options->get('roles/apply_roles_redirection', true) ? '' : ' acf-hidden'
     395                                'table_wrap_class'      => amem()->options->get('roles/apply_roles_redirection', true) ? '' : ' acf-hidden'
    396396                            );
    397397                            amem_get_view( __DIR__ . '/html-options-roles-redirection.php', $view_args );
     
    400400                            case 'email':
    401401                                // $email_key = empty( $_GET['email'] ) ? '' : sanitize_key( $_GET['email'] );
    402                                 $email_notifications = AMem()->config->email_notifications;
     402                                $email_notifications = amem()->config->email_notifications;
    403403                                if( $email_notifications ){
    404404                                    $view_args = array(
    405405                                        'email_notifications' => $email_notifications,
    406                                         'email_options'             => AMem()->options->get_emails(),
     406                                        'email_options'             => amem()->options->get_emails(),
    407407                                    );
    408408                                    amem_get_view( __DIR__ . '/html-options-list-email.php', $view_args );
     
    416416                            //      'key'          => 'global',
    417417                            //      'prefix'       => 'amem_options[adminbar]',
    418                             //      'value'        => AMem()->options->get('adminbar/global'),
     418                            //      'value'        => amem()->options->get('adminbar/global'),
    419419                            //      'label'        => __( 'Disable Admin Bar', 'advanced-members' ),
    420420                            //      'instructions' => __( 'Admin bar on frontend is disabled when this option is on', 'advanced-members' ),
     
    430430                            //      'key'          => 'by_roles',
    431431                            //      'prefix'       => 'amem_options[adminbar]',
    432                             //      'value'        => AMem()->options->get('adminbar/by_roles'),
     432                            //      'value'        => amem()->options->get('adminbar/by_roles'),
    433433                            //      'label'        => __( 'Enable admin bar visibility by role', 'advanced-members' ),
    434434                            //      'instructions' => __( 'Enable/disable show/hide admin bar by role', 'advanced-members' ),
     
    456456                                        'key'          => $key,
    457457                                        'prefix'       => 'amem_options[adminbar][roles]',
    458                                         'value'        => AMem()->options->get('adminbar/roles/'.$key),
     458                                        'value'        => amem()->options->get('adminbar/roles/'.$key),
    459459                                        'label'              => $role['name'],
    460460                                        // 'choices'      => $choices,
  • advanced-members/trunk/advanced-members.php

    r3182890 r3186203  
    44 * Plugin URI: https://advanced-members.com/
    55 * Description: Lightweight & All-in-One Membership Plugin for ACF Fans.
    6  * Version: 0.9.3
     6 * Version: 0.9.4
    77 * Author: DanbiLabs
    88 * Author URI: https://danbistore.com
     
    4545
    4646    /** @var string version */
    47     public static $version = '0.9.3';
     47    public static $version = '0.9.4';
    4848
    4949    /** @var string version */
     
    9191    function __construct() {
    9292        add_action( 'setup_theme', array( $this, 'setup_plugin' ), 10, 0 );
    93         $this->dev = defined( 'AMem_DEV') && AMem_DEV;
     93        $this->dev = defined( 'AMEM_DEV') && AMEM_DEV;
    9494    }
    9595
     
    214214        require_once( __DIR__ . '/core/functions-helpers.php' );
    215215
    216         $this->define( 'AMem_NAME', static::$name );
    217         $this->define( 'AMem_PATH', plugin_dir_path( __FILE__ ) );
    218         $this->define( 'AMem_BASENAME', plugin_basename( __FILE__ ) );
    219         $this->define( 'AMem_URL', plugin_dir_url( __FILE__ ) );
    220         $this->define( 'AMem_VERSION', static::$version );
     216        $this->define( 'AMEM_NAME', static::$name );
     217        $this->define( 'AMEM_PATH', plugin_dir_path( __FILE__ ) );
     218        $this->define( 'AMEM_BASENAME', plugin_basename( __FILE__ ) );
     219        $this->define( 'AMEM_URL', plugin_dir_url( __FILE__ ) );
     220        $this->define( 'AMEM_VERSION', static::$version );
    221221
    222222        load_plugin_textdomain( 'advanced-members', false, basename( __DIR__ ) . '/languages' );
     
    268268        amem_include( 'core/class-rest.php' );
    269269
    270         do_action( 'amem/setup_plugin', AMem_VERSION );
     270        do_action( 'amem/setup_plugin', AMEM_VERSION );
    271271
    272272        // Apply hooks by modules
     
    300300        amem_include( 'core/forms/actions.php' );
    301301        amem_include( 'core/actions/user.php' );
    302         do_action( 'amem/register_actions', AMem_VERSION );
     302        do_action( 'amem/register_actions', AMEM_VERSION );
    303303
    304304        // Load core addons
    305305        global $wp_version;
    306         if ( version_compare( $wp_version, '5.4.0', '>=' ) && AMem()->options->getmodule('_use_menu') )
     306        if ( version_compare( $wp_version, '5.4.0', '>=' ) && amem()->options->getmodule('_use_menu') )
    307307            amem_include( 'core/modules/menu/class-items.php' );
    308308
    309         if ( AMem()->options->getmodule('_use_redirects') )
     309        if ( amem()->options->getmodule('_use_redirects') )
    310310            amem_include( 'core/modules/class-redirects.php' );
    311311
    312         if ( AMem()->options->getmodule('_use_adminbar') )
     312        if ( amem()->options->getmodule('_use_adminbar') )
    313313            amem_include( 'core/modules/class-adminbar.php' );
    314314
    315315        // Load AddOns
    316         do_action( 'amem/register_addons', AMem_VERSION );
     316        do_action( 'amem/register_addons', AMEM_VERSION );
    317317
    318318        do_action( 'amem/load' );
     
    473473
    474474    public function is_amem() {
    475         return $this->is_amem || AMem()->submission;
     475        return $this->is_amem || amem()->submission;
    476476    }
    477477
     
    497497}
    498498
    499 function AMem() {
     499function amem() {
    500500    global $amem;
    501501
     
    508508
    509509// Initalize plugin
    510 AMem();
     510amem();
    511511
    512512endif;
  • advanced-members/trunk/core/abstracts/action.php

    r3182890 r3186203  
    3939        $nonce_value = sprintf( 'amem_submission_%s_%s', $form['key'], $hashed_args );
    4040        if ( ! wp_verify_nonce( $nonce, $nonce_value ) ) {
    41             amem_add_error( 'field_amem_errors', AMem()->errors->text('nonce_failed') );
     41            amem_add_error( 'field_amem_errors', amem()->errors->text('nonce_failed') );
    4242        }
    4343    }
  • advanced-members/trunk/core/abstracts/addon.php

    r3182890 r3186203  
    2323    protected $label = '';// Display name of module
    2424
    25     protected $version = AMem_VERSION;// Module version. used for upgrade actions and scripts, styles print
     25    protected $version = AMEM_VERSION;// Module version. used for upgrade actions and scripts, styles print
    2626
    2727    protected $min_amem_version;// Minimum Advanced Members for ACF version required for module
  • advanced-members/trunk/core/abstracts/module.php

    r3182890 r3186203  
    1919  protected $url = '';
    2020
    21   protected $version = AMem_VERSION;
     21  protected $version = AMEM_VERSION;
    2222
    2323  public $priority = 10;
  • advanced-members/trunk/core/actions/account.php

    r3182890 r3186203  
    4242        // add_filter( 'amem/form/error_message', [$this, 'error_message'] );
    4343
    44         $this->current_tab =& AMem()->account->current_tab;
     44        $this->current_tab =& amem()->account->current_tab;
    4545    }
    4646
    4747    function validate( $form, $args, $fields ) {
    4848        if ( !is_user_logged_in() ) {
    49             amem_add_error( 'field_amem_errors', AMem()->errors->text('logged_out') );
     49            amem_add_error( 'field_amem_errors', amem()->errors->text('logged_out') );
    5050        }
    5151    }
     
    170170        $user_data = array();
    171171
    172         $predefined_fields = AMem()->fields->predefined_fields();
     172        $predefined_fields = amem()->fields->predefined_fields();
    173173        $processed = [];
    174174
     
    208208                $error = $updated_user_id->get_error_message();
    209209            }
    210             AMem()->errors->add( 'user_update_error', $error );
     210            amem()->errors->add( 'user_update_error', $error );
    211211            return false;
    212212        }
     
    215215       
    216216        if ( ! $user || is_null( $user ) ) {
    217             AMem()->errors->add( 'user_update_error', $error );
     217            amem()->errors->add( 'user_update_error', $error );
    218218            return false;
    219219        }
     
    222222
    223223        // Save user ID to submission object
    224         AMem()->submission['user'] = $user->ID;
     224        amem()->submission['user'] = $user->ID;
    225225       
    226226        do_action( 'amem/user/updated', $user, $form, $args );
     
    241241        do_action( 'amem/user/delete/before', $user_id, $form, $args );
    242242
    243         if ( !AMem()->is_dev() )
    244         AMem()->user->delete($user_id);
     243        if ( !amem()->is_dev() )
     244        amem()->user->delete($user_id);
    245245
    246246        do_action( 'amem/user/delete/after', $user_id, $form, $args );
     
    305305                'required' => true,
    306306                // 'custom_username' => true,
    307                 // 'value' => AMem()->user->get('user_login'),
     307                // 'value' => amem()->user->get('user_login'),
    308308                '_amem_local' => true,
    309309            ),
     
    315315                'required' => true,
    316316                // 'custom_email' => true,
    317                 // 'value' => AMem()->user->get('user_email'),
     317                // 'value' => amem()->user->get('user_email'),
    318318                '_amem_local' => true,
    319319            ),
     
    323323            //  'name' => 'first_name',
    324324            //  'type' => 'first_name',
    325             //  // 'value' => AMem()->user->get('first_name'),
     325            //  // 'value' => amem()->user->get('first_name'),
    326326            //  '_amem_local' => true,
    327327            // ),
     
    331331            //  'name' => 'last_name',
    332332            //  'type' => 'last_name',
    333             //  // 'value' => AMem()->user->get('last_name'),
     333            //  // 'value' => amem()->user->get('last_name'),
    334334            //  '_amem_local' => true,
    335335            // ),
     
    403403        $fields = [];
    404404
    405         $alert_text = AMem()->options->get('account/account_delete_text');
     405        $alert_text = amem()->options->get('account/account_delete_text');
    406406        if ( !$alert_text ) {
    407407            /* translators: Delete account explain message */
     
    415415        }
    416416
    417         $confirm_text = AMem()->options->get('account/delete_account_label');
     417        $confirm_text = amem()->options->get('account/delete_account_label');
    418418        if ( !$confirm_text ) {
    419419            // $confirm_text = sprintf( __( 'I acknowledge that the account and data on &quot;%s&quot; will be deleted.', 'advanced-members' ), get_bloginfo('name') );
     
    466466
    467467        if ( $field_group )
    468             AMem()->render->render_field_group( $field_group, $form, $args );
     468            amem()->render->render_field_group( $field_group, $form, $args );
    469469    }
    470470
     
    475475        add_action( 'amem/form/after_fields/type=account', [$this, 'local_fields'], 50, 2 );
    476476
    477         AMem()->render->render( AMem()->account->get_form_id(), $args );
     477        amem()->render->render( amem()->account->get_form_id(), $args );
    478478    }
    479479
     
    484484        add_action( 'amem/form/local_fields/type=account', [$this, 'local_fields'], 10, 2 );
    485485
    486         AMem()->render->render( AMem()->account->get_form_id(), $args );
     486        amem()->render->render( amem()->account->get_form_id(), $args );
    487487    }
    488488
     
    493493        add_action( 'amem/form/local_fields/type=account', [$this, 'local_fields'], 10, 2 );
    494494
    495         AMem()->render->render( AMem()->account->get_form_id(), $args );
     495        amem()->render->render( amem()->account->get_form_id(), $args );
    496496    }
    497497
    498498    function content_logged_out($args, $data) {
    499499        // Always use local form key to avoid render account fields
    500         AMem()->render->render( AMem()->account->form_key, $args );
     500        amem()->render->render( amem()->account->form_key, $args );
    501501    }
    502502
     
    510510            case 'general':
    511511            case 'password':
    512             $is_required = AMem()->options->get( 'account/show_current_passwd' );
     512            $is_required = amem()->options->get( 'account/show_current_passwd' );
    513513            break;
    514514            case 'delete':
     
    532532}
    533533
    534 AMem()->register_action('account', Account::getInstance());
     534amem()->register_action('account', Account::getInstance());
  • advanced-members/trunk/core/actions/login.php

    r3182890 r3186203  
    6060        // Do not append to existing
    6161        if ( '' == $message && is_user_logged_in() ) {
    62             $message = AMem()->errors->text( 'logged_in' );
     62            $message = amem()->errors->text( 'logged_in' );
    6363        }
    6464
     
    6868    function validate( $form, $args, $fields ) {
    6969        if ( is_user_logged_in() ) {
    70             amem_add_error( 'field_amem_errors', AMem()->errors->text('logged_in') );
     70            amem_add_error( 'field_amem_errors', amem()->errors->text('logged_in') );
    7171        }
    7272    }
     
    8787
    8888        if ( $user_password == '' ) {
    89             amem_add_error( $amem['user_password'], AMem()->errors->text('empty_password') );
     89            amem_add_error( $amem['user_password'], amem()->errors->text('empty_password') );
    9090            return;
    9191        }
    9292
    9393        if ( isset( $data['username'] ) && $data['username'] == '' ) {
    94             amem_add_error( $amem['username'], AMem()->errors->text('empty_username_email') );
     94            amem_add_error( $amem['username'], amem()->errors->text('empty_username_email') );
    9595        }
    9696
    9797        if ( isset( $data['user_email'] ) && $data['user_email'] == '' ) {
    98             amem_add_error( $amem['user_email'], AMem()->errors->text('empty_email') );
     98            amem_add_error( $amem['user_email'], amem()->errors->text('empty_email') );
    9999        }
    100100
     
    103103            if ( isset($data[$ukey]) ) {
    104104                if ( $data[$ukey] == '' ) {
    105                     amem_add_error( $amem[$ukey], AMem()->errors->text('empty_username_email') );
     105                    amem_add_error( $amem[$ukey], amem()->errors->text('empty_username_email') );
    106106                } else {
    107107                    $user_name = $data[$ukey];
     
    112112
    113113        if ( $user_name == '' ) {
    114             amem_add_error( 'field_amem_errors', AMem()->errors->text('empty_username_email') );
     114            amem_add_error( 'field_amem_errors', amem()->errors->text('empty_username_email') );
    115115            return;
    116116        }
     
    125125
    126126        if ( !$user || is_wp_error($user) ) {
    127             amem_add_error( $amem[$ukey], sprintf( AMem()->errors->text('username_not_exists'), $data[$field] ) );
     127            amem_add_error( $amem[$ukey], sprintf( amem()->errors->text('username_not_exists'), $data[$field] ) );
    128128            return;
    129129        }
     
    131131        $auth_id = 0;
    132132        if ( wp_check_password( $user_password, $user->data->user_pass, $user->ID ) ) {
    133             AMem()->submission['form']['auth_id'] = $user->ID;
     133            amem()->submission['form']['auth_id'] = $user->ID;
    134134        } else {
    135             amem_add_error( $amem['user_password'], AMem()->errors->text('password_incorrect') );
     135            amem_add_error( $amem['user_password'], amem()->errors->text('password_incorrect') );
    136136        }
    137137
     
    147147                amem_add_error( $amem['user_password'], $user->get_error_message() );
    148148            } else {
    149                 amem_add_error( $amem['user_password'], AMem()->errors->text('password_incorrect') );
     149                amem_add_error( $amem['user_password'], amem()->errors->text('password_incorrect') );
    150150            }
    151151        }
     
    156156                amem_add_error( $amem['user_password'], $user->get_error_message() );
    157157            } else {
    158                 amem_add_error( $amem['user_password'], AMem()->errors->text('password_incorrect') );
     158                amem_add_error( $amem['user_password'], amem()->errors->text('password_incorrect') );
    159159            }
    160160        }
     
    162162        // if there is an error notify wp
    163163        if ( !$this->is_valid() ) {
    164             do_action( 'wp_login_failed', $user_name, AMem()->errors->to_wp_error() );
     164            do_action( 'wp_login_failed', $user_name, amem()->errors->to_wp_error() );
    165165        }
    166166    }
     
    177177        }
    178178
    179         $user_id = ( isset( AMem()->submission['form']['auth_id'] ) ) ? AMem()->submission['form']['auth_id'] : '';
     179        $user_id = ( isset( amem()->submission['form']['auth_id'] ) ) ? amem()->submission['form']['auth_id'] : '';
    180180        $status = '';
    181181
     
    190190            case 'rejected':
    191191            $redirect_url = add_query_arg( 'errc', esc_attr( $status ), amem_get_current_url() );
    192             if ( AMem()->submissions->is_ajax() ) {
    193                 amem_add_error( 'field_amem_errors', AMem()->errors->text($status) );
    194                 // amem_add_submission_error( AMem()->errors->text($status) );
     192            if ( amem()->submissions->is_ajax() ) {
     193                amem_add_error( 'field_amem_errors', amem()->errors->text($status) );
     194                // amem_add_submission_error( amem()->errors->text($status) );
    195195                // remove_action( 'amem/user/login', array( $this, 'process') );
    196                 AMem()->submissions->set_redirect( $redirect_url );
     196                amem()->submissions->set_redirect( $redirect_url );
    197197            }   else {
    198                 amem_add_error( 'field_amem_errors', AMem()->errors->text($status) );
     198                amem_add_error( 'field_amem_errors', amem()->errors->text($status) );
    199199                // wp_safe_redirect( $redirect_url );
    200200                // exit;
     
    213213        $user_password = !isset($data['user_password']) ? '' : $data['user_password'];
    214214        // double check user is verified by check_fields
    215         $user_id = isset(AMem()->submission['form']['auth_id']) ? AMem()->submission['form']['auth_id'] : 0;
     215        $user_id = isset(amem()->submission['form']['auth_id']) ? amem()->submission['form']['auth_id'] : 0;
    216216
    217217        $user_name = '';
     
    245245        $rememberme = ( isset( $_REQUEST['amem_login_rememberme'] ) && 1 === (int) $_REQUEST['amem_login_rememberme'] ) ? 1 : 0;
    246246
    247         $user_id = isset(AMem()->submission['form']['auth_id']) ? AMem()->submission['form']['auth_id'] : 0;
     247        $user_id = isset(amem()->submission['form']['auth_id']) ? amem()->submission['form']['auth_id'] : 0;
    248248        $this->auto_login( $form, $rememberme );
    249249    }
     
    298298
    299299            <?php if ( $data['rememberme'] ) {
    300             // AMem()->render->render_field($rememberme, $form, $args); ?>
     300            // amem()->render->render_field($rememberme, $form, $args); ?>
    301301            <div class="amem-local-field">
    302302                <label for="amem_login_rememberme">
     
    354354}
    355355
    356 AMem()->register_action('login', Login::getInstance());
     356amem()->register_action('login', Login::getInstance());
  • advanced-members/trunk/core/actions/password-reset.php

    r3182890 r3186203  
    3737
    3838    function get_mode() {
    39         return AMem()->passwordreset->get_mode();
     39        return amem()->passwordreset->get_mode();
    4040    }
    4141
     
    5454        // Do not append to existing
    5555        if ( '' == $message && is_user_logged_in() ) {
    56             $message = AMem()->errors->text('logged_in');
     56            $message = amem()->errors->text('logged_in');
    5757        }
    5858
     
    7070    function validate( $form, $args, $fields ) {
    7171        if ( is_user_logged_in() ) {
    72             amem_add_error( 'field_amem_errors', AMem()->errors->text('logged_in') );
     72            amem_add_error( 'field_amem_errors', amem()->errors->text('logged_in') );
    7373        }
    7474    }
     
    9999
    100100        if ( !$this->user || is_wp_error($this->user) ) {
    101             amem_add_error( 'username', AMem()->errors->text('username_not_exists') );
     101            amem_add_error( 'username', amem()->errors->text('username_not_exists') );
    102102            return;
    103103        }
     
    107107        // $attempts = (int) get_user_meta( $user_id, 'password_rst_attempts', true );
    108108        // $is_admin = user_can( absint( $user_id ), 'manage_options' );
    109         // $limit = AMem()->options->get( 'reset_password_limit_number' );
    110         // if ( $limit && AMem()->options->get( 'enable_reset_password_limit' ) ) {
    111         //  if ( ! ( AMem()->options->get( 'disable_admin_reset_password_limit' ) && $is_admin ) ) {
     109        // $limit = amem()->options->get( 'reset_password_limit_number' );
     110        // if ( $limit && amem()->options->get( 'enable_reset_password_limit' ) ) {
     111        //  if ( ! ( amem()->options->get( 'disable_admin_reset_password_limit' ) && $is_admin ) ) {
    112112        //      // Doesn't trigger this when a user has admin capabilities and when reset password limit is disabled for admins
    113113        //      if ( $attempts >= $limit ) {
     
    156156        }
    157157
    158         AMem()->user->email_password_reset($this->user->ID);
     158        amem()->user->email_password_reset($this->user->ID);
    159159        $redirect = remove_query_arg( ['hash', 'login', 'act', 'sent', 'updated'], amem_get_current_url() );
    160160        wp_safe_redirect( add_query_arg( 'updated', 'pwreset_checkemail', $redirect) );
     
    164164    function process_change( $form, $fields, $args ) {
    165165        $record = $form['record'];
    166         $user = AMem()->passwordreset->get_requested_user();
     166        $user = amem()->passwordreset->get_requested_user();
    167167
    168168        $errors = new \WP_Error();
    169169        if ( !$user || is_wp_error($user) ) {
    170             AMem()->passwordreset->setcookie( null, false );
     170            amem()->passwordreset->setcookie( null, false );
    171171            if ( $user && 'expired_key' === $user->get_error_code() ) {
    172172                wp_safe_redirect( add_query_arg( array( 'updated' => 'pwreset_expiredkey' ), amem_get_core_page( 'password-reset' ) ) );
     
    191191
    192192            // send the Password Changed Email
    193             AMem()->user->email_password_changed( $user->ID );
     193            amem()->user->email_password_changed( $user->ID );
    194194
    195195            // clear temporary data
     
    198198                update_user_meta( $user->ID, 'password_rst_attempts', 0 );
    199199            }
    200             AMem()->passwordreset->setcookie( null, false );
     200            amem()->passwordreset->setcookie( null, false );
    201201
    202202            do_action( 'amem/user/passwordchange/after', $user->ID );
     
    254254}
    255255
    256 AMem()->register_action('passwordreset', PasswordReset::getInstance());
     256amem()->register_action('passwordreset', PasswordReset::getInstance());
  • advanced-members/trunk/core/actions/registration.php

    r3182890 r3186203  
    3939        // Do not append to existing
    4040        if ( '' == $message && is_user_logged_in() ) {
    41             $message = AMem()->errors->text( 'logged_in' );
     41            $message = amem()->errors->text( 'logged_in' );
    4242        }
    4343
     
    6767    function validate( $form, $args, $fields ) {
    6868        if ( is_user_logged_in() ) {
    69             amem_add_error( 'field_amem_errors', AMem()->errors->text('logged_in') );
     69            amem_add_error( 'field_amem_errors', amem()->errors->text('logged_in') );
    7070            return false;
    7171        }
     
    7474
    7575        if ( 'new' != $user_id && !$user_id ) {
    76             amem_add_error( 'field_amem_errors', AMem()->errors->text('invalid_form') );
     76            amem_add_error( 'field_amem_errors', amem()->errors->text('invalid_form') );
    7777            return false;
    7878        }
     
    9393        $user_data = array();
    9494
    95         $predefined_fields = AMem()->fields->predefined_fields();
     95        $predefined_fields = amem()->fields->predefined_fields();
    9696
    9797        $processed = [];
     
    140140                $error = $inserted_id->get_error_message();
    141141            }
    142             AMem()->errors->add( 'user_insert_error', $error );
     142            amem()->errors->add( 'user_insert_error', $error );
    143143            return false;
    144144        }
     
    147147       
    148148        if ( ! $user || is_null( $user ) ) {
    149             AMem()->errors->add( 'user_insert_error', $error );
     149            amem()->errors->add( 'user_insert_error', $error );
    150150            return false;
    151151        }
     
    160160
    161161        // Save user ID to submission object
    162         AMem()->submission['user'] = $user->ID;
     162        amem()->submission['user'] = $user->ID;
    163163        $status = $form['data']['account_status'];
    164164
     
    166166        switch( $status ) {
    167167            case 'approve':
    168             AMem()->user->approve( $user->ID );
     168            amem()->user->approve( $user->ID );
    169169            break;
    170170            case 'mailcheck':
    171             AMem()->user->email_pending( $user->ID );
     171            amem()->user->email_pending( $user->ID );
    172172            add_filter( 'amem/form/submit/redirect/registration', function($url) {
    173173                if ( '' == $url )
     
    187187
    188188        // if ( $status == 'approve' ) {
    189         //  AMem()->actions->login->auto_login( amem_encrypt($user->ID) );
     189        //  amem()->actions->login->auto_login( amem_encrypt($user->ID) );
    190190        // }
    191191
     
    203203}
    204204
    205 AMem()->register_action('registration', Registration::getInstance());
     205amem()->register_action('registration', Registration::getInstance());
  • advanced-members/trunk/core/class-account.php

    r3182890 r3186203  
    6565
    6666    function acf_form_data($data, $form, $args) {
    67         if ( $form['type'] == 'account' && AMem()->user->id > 0 ) {
    68             $data['post_id'] = "user_" . AMem()->user->id;         
     67        if ( $form['type'] == 'account' && amem()->user->id > 0 ) {
     68            $data['post_id'] = "user_" . amem()->user->id;         
    6969        }
    7070        return $data;
     
    8787            $role = 'subscriber';
    8888
    89         $form_id = AMem()->options->get('accform/default');
    90         foreach ( (array) AMem()->options->get('accform/rules') as $rule ) {
     89        $form_id = amem()->options->get('accform/default');
     90        foreach ( (array) amem()->options->get('accform/rules') as $rule ) {
    9191            if ( !is_array($rule) ) continue;
    9292            if ( in_array($rule['role'], $roles) && $rule['value'] > '0' ) {
     
    165165            );
    166166
    167             // if ( AMem()->options->get('account/use_password') ) {
     167            // if ( amem()->options->get('account/use_password') ) {
    168168                $tabs[200]['password'] = array(
    169169                    'icon'         => null,
     
    173173            // }
    174174
    175             // if ( AMem()->options->get('account/use_delete') ) {
     175            // if ( amem()->options->get('account/use_delete') ) {
    176176                // If user cannot delete profile hide delete tab.
    177                 // if ( AMem()->user->can( 'delete_profile' ) || AMem()->user->can( 'delete_users' ) ) {
     177                // if ( amem()->user->can( 'delete_profile' ) || amem()->user->can( 'delete_users' ) ) {
    178178                    $tabs[99999]['delete'] = array(
    179179                        'icon'         => null,
     
    289289            // do_action( "amem/account/before" . $args['tab'], $args );
    290290
    291             // AMem()->template->template_load( $args['template'], $args );
     291            // amem()->template->template_load( $args['template'], $args );
    292292        }
    293293
     
    327327            'type' => 'account',
    328328            'data' => array(
    329                 'ajax' => AMem()->options->get('ajax_submit'),
     329                'ajax' => amem()->options->get('ajax_submit'),
    330330                'description' => '',
    331331                'success_message' => '',
     
    351351                //  $form['data']['redirect_url'] = get_post_meta($_form_id, "amem_form_account_delete_redirect_url", true);
    352352                // } else {
    353                 //  $form['data']['after_submit'] = AMem()->options->get('redirect/_after_account_delete');
    354                 //  $form['data']['redirect_url'] = AMem()->options->get('redirect/account_delete_redirect_url');
     353                //  $form['data']['after_submit'] = amem()->options->get('redirect/_after_account_delete');
     354                //  $form['data']['redirect_url'] = amem()->options->get('redirect/account_delete_redirect_url');
    355355                // }
    356356                if ( $form['data']['after_submit'] == 'success_message' ) {// DEV compatibility
     
    362362        }
    363363
    364         AMem()->local->add_form($form);
     364        amem()->local->add_form($form);
    365365
    366366        $registered = true;
     
    369369}
    370370
    371 AMem()->register_module('account', Account::getInstance());
     371amem()->register_module('account', Account::getInstance());
  • advanced-members/trunk/core/class-blocks.php

    r3182890 r3186203  
    142142            'slug' => ''
    143143        ];
    144         $forms = AMem()->rest->forms( ['type' => ['login', 'registration']] );
     144        $forms = amem()->rest->forms( ['type' => ['login', 'registration']] );
    145145        $forms = [$blank_form] + $forms;
    146146
    147         $preForms = AMem()->rest->preForms();
     147        $preForms = amem()->rest->preForms();
    148148        $preForms = [$blank_form] + $preForms;
    149149
     
    211211}
    212212
    213 AMem()->register_module( 'blocks', Blocks::getInstance() );
     213amem()->register_module( 'blocks', Blocks::getInstance() );
  • advanced-members/trunk/core/class-config.php

    r3182890 r3186203  
    316316}
    317317
    318 AMem()->register_module('config', Config::getInstance());
     318amem()->register_module('config', Config::getInstance());
  • advanced-members/trunk/core/class-errors.php

    r3182890 r3186203  
    106106}
    107107
    108 AMem()->register_module('errors', Errors::getInstance());
     108amem()->register_module('errors', Errors::getInstance());
  • advanced-members/trunk/core/class-fields.php

    r3182890 r3186203  
    9999        amem_include( $this->inc  . "class-user-password-confirm.php" );
    100100
    101         do_action( 'amem/include_field_types', AMem_VERSION );
     101        do_action( 'amem/include_field_types', AMEM_VERSION );
    102102
    103103    }
     
    196196    function register_scripts() {
    197197        $min = '';
    198         wp_register_script( 'amem-input', amem_get_url("assets/build/js/amem-input{$min}.js"), array( 'jquery', 'acf-input' ), AMem_VERSION, true );
     198        wp_register_script( 'amem-input', amem_get_url("assets/build/js/amem-input{$min}.js"), array( 'jquery', 'acf-input' ), AMEM_VERSION, true );
    199199
    200200        do_action( 'amem/register_scripts' );
     
    227227}
    228228
    229 AMem()->register_module('fields', Fields::getInstance());
     229amem()->register_module('fields', Fields::getInstance());
  • advanced-members/trunk/core/class-files.php

    r3182890 r3186203  
    313313}
    314314
    315 AMem()->register_module( 'files', Files::getInstance() );
     315amem()->register_module( 'files', Files::getInstance() );
  • advanced-members/trunk/core/class-local.php

    r3182890 r3186203  
    116116}
    117117
    118 AMem()->register_module('local', Local::getInstance());
     118amem()->register_module('local', Local::getInstance());
  • advanced-members/trunk/core/class-locations.php

    r3182890 r3186203  
    8383}
    8484
    85 AMem()->register_module('locations', Locations::getInstance());
     85amem()->register_module('locations', Locations::getInstance());
  • advanced-members/trunk/core/class-logout.php

    r3182890 r3186203  
    4848
    4949}
    50 AMem()->register_module('logout', Logout::getInstance());
     50amem()->register_module('logout', Logout::getInstance());
  • advanced-members/trunk/core/class-mail.php

    r3182890 r3186203  
    5959        }
    6060
    61         $options = AMem()->options->get_emails();
     61        $options = amem()->options->get_emails();
    6262
    6363        if( !isset($options[$template]) ){
     
    123123    public function add_replace_placeholder( $replace_placeholders ) {
    124124        $replace_placeholders[] = get_bloginfo( 'url' );
    125         $replace_placeholders[] = AMem()->options->get('admin_email');
     125        $replace_placeholders[] = amem()->options->get('admin_email');
    126126        $replace_placeholders[] = amem_get_core_page( 'login' );
    127127        $replace_placeholders[] = esc_html__( 'Your set password', 'advanced-members' );
     
    131131    }
    132132}
    133 AMem()->register_module('mail', Mail::getInstance());
     133amem()->register_module('mail', Mail::getInstance());
  • advanced-members/trunk/core/class-options.php

    r3182890 r3186203  
    135135     */
    136136    function get_core_pages() {
    137         $core_pages = array_keys( AMem()->config->core_pages );
     137        $core_pages = array_keys( amem()->config->core_pages );
    138138        if ( empty( $core_pages ) ) {
    139139            return $this->permalinks;
     
    152152
    153153    function default_emails() {
    154         $emails = AMem()->config->email_notifications;
     154        $emails = amem()->config->email_notifications;
    155155        $options = [];
    156156        foreach ( $emails as $k => $email ) {
     
    261261}
    262262
    263 AMem()->register_module('options', Options::getInstance());
     263amem()->register_module('options', Options::getInstance());
  • advanced-members/trunk/core/class-password-reset.php

    r3182890 r3186203  
    6767        if ( in_array($updated, ['pwreset_checkemail', 'pwreset_password_changed'], true) ) {
    6868            // manually print message
    69             amem_form_updated_message( AMem()->local->get_form( $this->form_key ), $atts, true );
     69            amem_form_updated_message( amem()->local->get_form( $this->form_key ), $atts, true );
    7070        } else {
    71             AMem()->render->render($this->form_key, $atts);
     71            amem()->render->render($this->form_key, $atts);
    7272        }
    7373
     
    186186        );
    187187
    188         AMem()->local->add_form($form);
     188        amem()->local->add_form($form);
    189189
    190190        switch( $this->mode ) {
     
    229229        }
    230230
    231         AMem()->local->add_group( array(
     231        amem()->local->add_group( array(
    232232            'key' => 'group_amem_passwordreset',
    233233            'title' => '',
     
    267267}
    268268
    269 AMem()->register_module('passwordreset', PasswordReset::getInstance());
     269amem()->register_module('passwordreset', PasswordReset::getInstance());
  • advanced-members/trunk/core/class-rest.php

    r3182890 r3186203  
    133133}
    134134
    135 AMem()->register_module( 'rest', REST::getInstance() );
     135amem()->register_module( 'rest', REST::getInstance() );
  • advanced-members/trunk/core/class-setup.php

    r3182890 r3186203  
    2121    public function install_default_options() {
    2222
    23         foreach ( AMem()->get_module('config')->default_settings as $key => $value ) {
     23        foreach ( amem()->get_module('config')->default_settings as $key => $value ) {
    2424            $options[ $key ] = $value;
    2525        }
     
    3232    public function install_default_forms() {
    3333        if ( current_user_can( 'manage_options' ) && ! get_option( 'amem_default_installed' ) ) {
    34             foreach ( AMem()->get_module('config')->core_forms as $id ) {
    35                 $isset_form = AMem()->options->find_core( 'amem-form', 'amem_core_form', $id );
     34            foreach ( amem()->get_module('config')->core_forms as $id ) {
     35                $isset_form = amem()->options->find_core( 'amem-form', 'amem_core_form', $id );
    3636                if ( ! $isset_form ) {
    3737                    // if( $id != 'register' ){
     
    5757                    $form_id = wp_insert_post( $form );
    5858                    $form_key = '';
    59                     foreach ( AMem()->config->amem_default_form_meta[ $id ] as $key => $value ) {
     59                    foreach ( amem()->config->amem_default_form_meta[ $id ] as $key => $value ) {
    6060                        if( $key == 'form_key'){
    6161                            $form_key = $value;
     
    6464                    }
    6565
    66                     $acf_fied_group_content = AMem()->config->amem_default_field_group;
     66                    $acf_fied_group_content = amem()->config->amem_default_field_group;
    6767                    $acf_fied_group_content['location'][0][0]['value'] = $form_key;
    6868                    $field_group_id = $this->install_default_field_groups( $id, $current_uid , $acf_fied_group_content );
    6969
    7070                    if( $field_group_id ){
    71                         $acf_fied_group_fields = AMem()->config->amem_default_fields[$id];
     71                        $acf_fied_group_fields = amem()->config->amem_default_fields[$id];
    7272                        $this->insert_fields( $acf_fied_group_fields , $field_group_id );
    7373                    }
     
    116116
    117117    public function install_default_pages() {
    118         $amem_core_pages = AMem()->config->core_pages;
     118        $amem_core_pages = amem()->config->core_pages;
    119119        $core_pages = array();
    120120        $current_uid = get_current_user_id();
     
    124124
    125125        foreach ($amem_core_pages as $slug => $page) {
    126             $isset_page = AMem()->options->find_core( 'page', 'amem_core_page', $slug );
     126            $isset_page = amem()->options->find_core( 'page', 'amem_core_page', $slug );
    127127            if ( ! $isset_page ) {
    128128                //insert new core page
     
    150150                    break;
    151151                    default:
    152                     $form_id = AMem()->options->find_core( 'amem-form', 'amem_core_form', $slug );
     152                    $form_id = amem()->options->find_core( 'amem-form', 'amem_core_form', $slug );
    153153                    if( !empty($form_id) ){
    154154                        $hash = esc_attr( get_post_meta( $form_id, 'form_key', true ) );
     
    197197}
    198198
    199 AMem()->register_module('setup', Setup::getInstance());
     199amem()->register_module('setup', Setup::getInstance());
  • advanced-members/trunk/core/class-template.php

    r3182890 r3186203  
    9090}
    9191
    92 AMem()->register_module('template', Tempalte::getInstance());
     92amem()->register_module('template', Tempalte::getInstance());
  • advanced-members/trunk/core/class-user.php

    r3182890 r3186203  
    225225        $user->destroy_all();
    226226
    227         AMem()->mail->send( amem_user( 'user_email' ) , 'checkmail_email' );
     227        amem()->mail->send( amem_user( 'user_email' ) , 'checkmail_email' );
    228228
    229229        if ( $user_id )
     
    242242        $key = $this->maybe_generate_password_reset_key( $userdata );
    243243
    244         add_filter( 'amem/template/merge_tags', array( AMem()->passwordreset, 'add_placeholder' ), 10, 1 );
    245         add_filter( 'amem/template/merge_tags/replace', array( AMem()->passwordreset, 'add_replace_placeholder' ), 10, 1 );
    246 
    247         AMem()->mail->send( $userdata->user_email, 'resetpw_email' );
     244        add_filter( 'amem/template/merge_tags', array( amem()->passwordreset, 'add_placeholder' ), 10, 1 );
     245        add_filter( 'amem/template/merge_tags/replace', array( amem()->passwordreset, 'add_replace_placeholder' ), 10, 1 );
     246
     247        amem()->mail->send( $userdata->user_email, 'resetpw_email' );
    248248
    249249        if ( $user_id )
     
    262262        }
    263263
    264         AMem()->mail->send( amem_user( 'user_email' ) , 'changedpw_email' );
     264        amem()->mail->send( amem_user( 'user_email' ) , 'changedpw_email' );
    265265
    266266        if ( $user_id )
     
    286286            $this->maybe_generate_password_reset_key( $userdata );
    287287
    288             AMem()->mail->send( amem_user( 'user_email' ), 'approved_email' );
    289 
    290         } else {
    291             AMem()->mail->send( amem_user( 'user_email' ), 'welcome_email' );
     288            amem()->mail->send( amem_user( 'user_email' ), 'approved_email' );
     289
     290        } else {
     291            amem()->mail->send( amem_user( 'user_email' ), 'welcome_email' );
    292292        }
    293293
    294294        // Admin notification
    295         AMem()->mail->send( AMem()->options->get('admin_email'), 'notification_new_user', array( 'admin' => true ) );
     295        amem()->mail->send( amem()->options->get('admin_email'), 'notification_new_user', array( 'admin' => true ) );
    296296
    297297
     
    352352
    353353        /** @todo Add options and remove comments on delete */
    354         if ( AMem()->options->get( 'delete_comments' ) ) {
     354        if ( amem()->options->get( 'delete_comments' ) ) {
    355355            $user = get_user_by( 'id', $this->id );
    356356
     
    363363        // send email notifications
    364364        if ( $this->send_deleted_mail ) {
    365             AMem()->mail->send( amem_user( 'user_email' ), 'deletion_email' );
    366 
    367             $admin_email = AMem()->options->get( 'admin_email' );
    368             AMem()->mail->send( $admin_email, 'notification_deletion', array( 'admin' => true ) );
     365            amem()->mail->send( amem_user( 'user_email' ), 'deletion_email' );
     366
     367            $admin_email = amem()->options->get( 'admin_email' );
     368            amem()->mail->send( $admin_email, 'notification_deletion', array( 'admin' => true ) );
    369369        }
    370370    }
     
    387387        $this->usermeta_update( 'registration_secretkey_hash' );
    388388
    389         $expiry_time = (int) AMem()->options->get( 'activation_link_expiry_time' );
     389        $expiry_time = (int) amem()->options->get( 'activation_link_expiry_time' );
    390390        if ( $expiry_time ) {
    391391            $expiry_time = $expiry_time * DAY_IN_SECONDS;
     
    508508}
    509509
    510 AMem()->register_module('user', User::getInstance());
     510amem()->register_module('user', User::getInstance());
  • advanced-members/trunk/core/forms/actions.php

    r3182890 r3186203  
    4040
    4141    function __get($key) {
    42         if ( $action = AMem()->get_action($key) )
     42        if ( $action = amem()->get_action($key) )
    4343            return $action;
    4444        return null;
     
    5757
    5858        if ( in_array($form_type, ['registration', 'login', 'passwordreset']) && is_user_logged_in() ) {
    59             return AMem()->errors->text('logged_in');
     59            return amem()->errors->text('logged_in');
    6060        } elseif ( $form_type == 'account' && !is_user_logged_in() ) {
    61             return AMem()->errors->text('logged_out');
    62         } elseif ( $form_type == 'account' && AMem()->account->get_current_tab() == 'delete' && is_super_admin() ) {
     61            return amem()->errors->text('logged_out');
     62        } elseif ( $form_type == 'account' && amem()->account->get_current_tab() == 'delete' && is_super_admin() ) {
    6363            // return __( 'Super administrators can not be deleted.', 'advanced-members' );
    6464        }
     
    7474
    7575    function redirect_to_redirect_url($url) {
     76        cym_debug( sanitize_text_field($_REQUEST['redirect_to']) );
    7677        if ( !empty($_REQUEST['redirect_to']) ) { // phpcs:disable WordPress.Security.NonceVerification
    7778            return sanitize_text_field($_REQUEST['redirect_to']); // phpcs:disable WordPress.Security.NonceVerification
     
    186187            $after_submit = 'refresh';
    187188        }
    188         if ( $form_type == 'account' && wp_doing_ajax() && AMem()->account->current_tab != 'delete' ) {
     189        if ( $form_type == 'account' && wp_doing_ajax() && amem()->account->current_tab != 'delete' ) {
    189190            $after_submit = 'success_message';
    190191        }
     
    192193        $redirect = $this->after_submit_url( $after_submit, $form );
    193194
     195        $redirect = apply_filters( 'amem/form/submit/redirect_url', $redirect, $form, $args );
    194196        $redirect = apply_filters( "amem/form/submit/redirect/$form_type", $redirect, $form, $args );
    195197
     
    220222            case 'just_success_message':
    221223            if ( wp_doing_ajax() ) {
    222                 AMem()->submissions->set_redirect($after_submit);
     224                amem()->submissions->set_redirect($after_submit);
    223225            }
    224226            return $after_submit;
     
    247249        if ( in_array($redirect, ['success_message', 'just_success_message'], true) ) {
    248250            if ( wp_doing_ajax() ) {
    249                 AMem()->submissions->set_redirect($redirect);
     251                amem()->submissions->set_redirect($redirect);
    250252            }
    251253            return;
     
    253255
    254256        if ( wp_doing_ajax() ) {
    255             AMem()->submissions->set_redirect($redirect);
     257            amem()->submissions->set_redirect($redirect);
    256258        } else {
    257259            wp_safe_redirect( $redirect );
     
    272274            if ( $allkeys ) {
    273275                $tmp_key = array_shift($allkeys);
    274                 amem_add_error( $tmp_key, AMem()->errors->text('logged_in') );
     276                amem_add_error( $tmp_key, amem()->errors->text('logged_in') );
    275277            } else {
    276                 amem_add_submission_error( AMem()->errors->text('logged_in') );
     278                amem_add_submission_error( amem()->errors->text('logged_in') );
    277279            }
    278280        }
     
    301303     */
    302304    function form_from_post( $form, $post ) {
    303         $amem_fields = apply_filters( 'amem/form/from_post/amem', array_values( AMem()->fields->predefined_fields() ), $form, $post );
     305        $amem_fields = apply_filters( 'amem/form/from_post/amem', array_values( amem()->fields->predefined_fields() ), $form, $post );
    304306
    305307        $form['amem'] = array_fill_keys( $amem_fields, false );
     
    338340}
    339341
    340 AMem()->register_module('actions', Actions::getInstance());
     342amem()->register_module('actions', Actions::getInstance());
  • advanced-members/trunk/core/forms/render.php

    r3182890 r3186203  
    1919        // add_shortcode( 'acf_members', array( $this, 'form_shortcode' ) );
    2020        add_action( 'amem/form/render', array( $this, 'render' ), 10, 2 );
     21
     22        add_filter( 'wp_kses_allowed_html', array( $this, 'allowed_html_tags' ), 10, 2 );
    2123    }
    2224
     
    4244    }
    4345
     46    function allowed_html_tags( $tags, $context ) {
     47        global $allowedposttags, $allowedamemtags;
     48        if ( $context != 'amem' )
     49            return $tags;
     50
     51        if ( is_array( $allowedamemtags) )
     52            return $allowedamemtags;
     53
     54        $allowedamemtags = $allowedposttags;
     55        $allowedamemtags['form'] = array(
     56            'action'         => true,
     57            'accept'         => true,
     58            'accept-charset' => true,
     59            'enctype'        => true,
     60            'method'         => true,
     61            'name'           => true,
     62            'target'         => true,
     63        );
     64
     65        $atts = array(
     66      'type' => true,
     67      'class' => true,
     68      'id' => true,
     69      'data-*' => true,
     70      'aria-*' => true,
     71      'name' => true,
     72      'value' => true,
     73      'checked' => true,
     74      'disabled' => true,
     75      'value' => true,
     76      'multiple' => true,
     77    );
     78
     79        $allowedamemtags['input'] = $atts;
     80        $allowedamemtags['select'] = $atts;
     81        $allowedamemtags['option'] = $atts;
     82
     83        return $allowedamemtags;
     84    }
     85
    4486    /**
    4587     * Renders the form specified by ID
     
    5597
    5698        // Set global AMem Form
    57         AMem()->set_form($form, $args);
    58         AMem()->set_amem(true);
     99        amem()->set_form($form, $args);
     100        amem()->set_amem(true);
    59101
    60102        // Enqueue scripts and styles
     
    166208        do_action( 'amem/form/after_render/type=' . $form['type'], $form, $args );
    167209
    168         AMem()->set_amem(false);// End of AMem Form
     210        amem()->set_amem(false);// End of AMem Form
    169211    }
    170212
     
    176218    function render_submission_error( $form, $args ) {
    177219        if ( amem_submission_failed( $form['key'] ) ) {
    178             // $errors = AMem()->submission['errors'];
    179             $errors = AMem()->errors->get_errors();
     220            // $errors = amem()->submission['errors'];
     221            $errors = amem()->errors->get_errors();
    180222
    181223            foreach ( $errors as $error ) {
     
    312354
    313355        // Get all fields for field group
    314         if ( ! $fields = AMem()->local->get_group_fields($field_group) ) {
     356        if ( ! $fields = amem()->local->get_group_fields($field_group) ) {
    315357            $fields = acf_get_fields( $field_group );           
    316358        }
     
    533575
    534576        if ( !empty($submit_button) ) {
    535             echo wp_kses_post($submit_button);
     577            echo wp_kses($submit_button, 'amem');
    536578            return;
    537579        }
     
    545587}
    546588
    547 AMem()->register_module('render', Render::getInstance());
     589amem()->register_module('render', Render::getInstance());
  • advanced-members/trunk/core/forms/submissions.php

    r3182890 r3186203  
    4949                'valid' => 0,
    5050                'errors' => array(
    51                     array( 'input' => 'acf[field_amem_errors]', 'message' => AMem()->errors->text('nonce_failed') ),
     51                    array( 'input' => 'acf[field_amem_errors]', 'message' => amem()->errors->text('nonce_failed') ),
    5252                ),
    5353            ) );
     
    6767                'valid' => 0,
    6868                'errors' => array(
    69                     array( 'input' => 'acf[field_amem_errors]', 'message' => AMem()->errors->text('nonce_failed') ),
     69                    array( 'input' => 'acf[field_amem_errors]', 'message' => amem()->errors->text('nonce_failed') ),
    7070                ),
    7171            ) );
    7272        }
    7373
    74         $form = AMem()->submission['form'];
    75         $args = AMem()->submission['args'];
    76         $fields = AMem()->submission['fields'];
     74        $form = amem()->submission['form'];
     75        $args = amem()->submission['args'];
     76        $fields = amem()->submission['fields'];
    7777
    7878        // Process submission. If it fails we return all errors.
    79         if ( ! $this->process_submission( AMem()->submission ) ) {
     79        if ( ! $this->process_submission( amem()->submission ) ) {
    8080            $errors = array();
    81             foreach ( AMem()->submission['errors'] as $message ) {
     81            foreach ( amem()->submission['errors'] as $message ) {
    8282                $errors[] = array(
    8383                    'input' => 'field_amem_errors',
     
    168168        }
    169169
    170         $this->process_submission( AMem()->submission );
    171 
    172         // static::after_submission( AMem()->submission );
     170        $this->process_submission( amem()->submission );
     171
     172        // static::after_submission( amem()->submission );
    173173    }
    174174
     
    246246        }
    247247
    248         $form = AMem()->submission['form'];
    249         $fields = AMem()->submission['fields'];
    250         $args = AMem()->submission['args'];
     248        $form = amem()->submission['form'];
     249        $fields = amem()->submission['fields'];
     250        $args = amem()->submission['args'];
    251251
    252252        if ( !$this->honeypot_check() ) {
    253             amem_add_error( 'field_amem_errors', AMem()->errors->text('invalid_honeypot') );
     253            amem_add_error( 'field_amem_errors', amem()->errors->text('invalid_honeypot') );
    254254            return;
    255255        }
     
    260260
    261261    /**
    262      * Populate AMem()->submission with submission data
     262     * Populate amem()->submission with submission data
    263263     * Returns boolean indicating whether a submission was loaded
    264264     *
     
    269269        // Check if there is a cookie-passed submission
    270270        if ( $submission = $this->get_submission() ) {
    271             AMem()->submission = $submission;
     271            amem()->submission = $submission;
    272272
    273273            // Return false to stop the submission from being processed again
     
    281281
    282282        // Bail early if already loaded
    283         if ( AMem()->submission ) {
     283        if ( amem()->submission ) {
    284284            return true;
    285285        }
     
    304304
    305305        // Save submission data to the global AMem object
    306         AMem()->submission = $submission;
    307         AMem()->set_form($submission['form'], $submission['args']);
     306        amem()->submission = $submission;
     307        amem()->set_form($submission['form'], $submission['args']);
    308308
    309309        return true;
     
    340340        if ( ! wp_verify_nonce( $nonce, $nonce_value ) ) {
    341341            if ( doing_action( 'acf/validate_save_post') ) {
    342                 amem_add_error( 'field_amem_errors', AMem()->errors->text('nonce_failed') );
     342                amem_add_error( 'field_amem_errors', amem()->errors->text('nonce_failed') );
    343343                return false;
    344344            }   else {
    345                 amem_add_submission_error( AMem()->errors->text('nonce_failed') );
     345                amem_add_submission_error( amem()->errors->text('nonce_failed') );
    346346                // wp_die( 'Your submission failed. Please reload the page and try again.' );
    347347                return false;
     
    527527}
    528528
    529 AMem()->register_module('submissions', Submissions::getInstance());
     529amem()->register_module('submissions', Submissions::getInstance());
  • advanced-members/trunk/core/functions-forms.php

    r3182890 r3186203  
    2929    // Get fields from the global submission object if fields weren't passed
    3030    if ( ! $fields && amem_has_submission() ) {
    31         $fields = AMem()->submission['fields'];
     31        $fields = amem()->submission['fields'];
    3232    }
    3333
     
    100100    }
    101101
    102     $fields = AMem()->submission['fields'];
     102    $fields = amem()->submission['fields'];
    103103
    104104    // $excluded_fields = array_map( function($field) { return is_array($field) ? $field['name'] : $field; }, (array)$excluded_fields );
     
    135135    // Get fields from the global submission object if fields weren't passed
    136136    if ( ! $fields && amem_has_submission() ) {
    137         $fields = AMem()->submission['fields'];
     137        $fields = amem()->submission['fields'];
    138138    }
    139139
     
    222222
    223223    if ( $form ) {
    224         AMem()->local->add_form($form);
     224        amem()->local->add_form($form);
    225225    }
    226226
     
    263263        'type' => false,
    264264        'data' => array(
    265             'ajax' => AMem()->options->get('ajax_submit'),
     265            'ajax' => amem()->options->get('ajax_submit'),
    266266            'user' => 0,
    267267            'description' => '',
     
    338338
    339339    $form_type = amem_form_type( $form_post->ID );
    340     $form_ajax = AMem()->options->get('ajax_submit');
     340    $form_ajax = amem()->options->get('ajax_submit');
    341341
    342342    if ( get_post_meta( $form_post->ID, 'amem_form_ajax_override', true ) ) {
     
    401401 */
    402402function amem_form_from_key( $key ) {
    403     if ( $form = AMem()->local->get_form($key) ) {
     403    if ( $form = amem()->local->get_form($key) ) {
    404404        return $form;
    405405    }
     
    514514
    515515    // Get all locally registered forms
    516     if ( $local_forms = AMem()->local->get_forms() ) {
     516    if ( $local_forms = amem()->local->get_forms() ) {
    517517        foreach ( $local_forms as $form ) {
    518518            $forms[] = $form;
     
    534534    }
    535535
    536     if ( $groups = AMem()->local->get_form_groups($form_key) ) {
     536    if ( $groups = amem()->local->get_form_groups($form_key) ) {
    537537        return $groups;
    538538    }
     
    551551        $form_key = $form_key['key'];
    552552    }
    553     return AMem()->local->get_form_groups($form_key);
     553    return amem()->local->get_form_groups($form_key);
    554554}
    555555
     
    567567    }
    568568
    569     if ( $form_fields = AMem()->local->get_form_fields($form_key) ) {
     569    if ( $form_fields = amem()->local->get_form_fields($form_key) ) {
    570570        $formFields[$cacheKey] = $form_fields;
    571571        return $form_fields;
     
    585585    if ( $field_groups ) {
    586586        foreach ( $field_groups as $field_group ) {
    587             if ( ! $fields = AMem()->local->get_group_fields($field_group) )
     587            if ( ! $fields = amem()->local->get_group_fields($field_group) )
    588588                $fields = acf_get_fields( $field_group );
    589589            if ( ! empty ( $fields ) ) {
     
    630630        return;
    631631
    632     $message = AMem()->errors->text($updated_code);
     632    $message = amem()->errors->text($updated_code);
    633633    $message = apply_filters( 'amem/form/updated_message', $message, $updated_code, $form, $args );
    634634    $message = apply_filters( 'amem/form/updated_message/type=' . $form['type'], $message, $updated_code, $form, $args );
     
    652652        return;
    653653
    654     $message = AMem()->errors->text($error_code);
     654    $message = amem()->errors->text($error_code);
    655655    $message = apply_filters( 'amem/form/error_message', $message, $error_code, $form, $args );
    656656    $message = apply_filters( 'amem/form/error_message/type=' . $form['type'], $message, $error_code, $form, $args );
     
    674674    // Enqueue the hotfix that prevents validation from firing across all forms on the same page when one is submitted.
    675675    if ( apply_filters( 'amem/settings/enqueue_validation_hotfix', false ) ) {
    676         wp_enqueue_script( 'amem-multi-form-validation-hotfix', amem_get_url("assets/build/js/multi-form-validation-hotfix.js"), [ 'acf-input' ], AMem_VERSION, true );
     676        wp_enqueue_script( 'amem-multi-form-validation-hotfix', amem_get_url("assets/build/js/multi-form-validation-hotfix.js"), [ 'acf-input' ], AMEM_VERSION, true );
    677677    }
    678678
     
    682682    $min = '';
    683683
    684     wp_register_script( 'amem-password-strength', amem_get_url("assets/build/js/password-strength{$min}.js"), array( 'password-strength-meter' ), AMem_VERSION, true );
     684    wp_register_script( 'amem-password-strength', amem_get_url("assets/build/js/password-strength{$min}.js"), array( 'password-strength-meter' ), AMEM_VERSION, true );
    685685    acf_localize_text( array( 'Passwords Match' => __( 'Passwords Match', 'advanced-members' ) ) );
    686686
     
    689689    wp_localize_script( 'acf-input', 'acfL10n', $acf_l10n );
    690690
    691     AMem()->fields->enqueue_scripts();
    692 
    693     wp_enqueue_script( 'amem-forms-script', amem_get_url("assets/build/js/forms.js"), ['jquery', 'acf-input', 'amem-input'], AMem_VERSION, true );
    694 
    695     wp_enqueue_style( 'amem-form-style', amem_get_url("assets/build/css/form.css"), false, AMem_VERSION );
    696 
    697     if ( AMem()->options->get('load_theme', true) ) {
    698         wp_enqueue_style( 'amem-theme-default', amem_get_url("assets/build/css/themes/default.css"), false, AMem_VERSION );
     691    amem()->fields->enqueue_scripts();
     692
     693    wp_enqueue_script( 'amem-forms-script', amem_get_url("assets/build/js/forms.js"), ['jquery', 'acf-input', 'amem-input'], AMEM_VERSION, true );
     694
     695    wp_enqueue_style( 'amem-form-style', amem_get_url("assets/build/css/form.css"), false, AMEM_VERSION );
     696
     697    if ( amem()->options->get('load_theme', true) ) {
     698        wp_enqueue_style( 'amem-theme-default', amem_get_url("assets/build/css/themes/default.css"), false, AMEM_VERSION );
    699699    }
    700700
  • advanced-members/trunk/core/functions-helpers.php

    r3182890 r3186203  
    3737 */
    3838function amem_get_path( $filename = '', $base = null ) {
    39     return ( !$base ? AMem_PATH : $base ) . ltrim( $filename, '/' );
     39    return ( !$base ? AMEM_PATH : $base ) . ltrim( $filename, '/' );
    4040}
    4141
     
    5252 */
    5353function amem_get_url( $filename = '', $base = null ) {
    54     return ( !$base ? AMem_URL : $base ) . ltrim( $filename, '/' );
     54    return ( !$base ? AMEM_URL : $base ) . ltrim( $filename, '/' );
    5555}
    5656
     
    9999function amem_get_core_page( $slug, $updated = false, $redirect_to = '' ) {
    100100    $url = '';
    101     if ( isset( AMem()->options->permalinks[ $slug ] ) ) {
    102         $url = get_permalink( AMem()->options->permalinks[ $slug ] );
     101    if ( isset( amem()->options->permalinks[ $slug ] ) ) {
     102        $url = get_permalink( amem()->options->permalinks[ $slug ] );
    103103        if ( $updated ) {
    104104            $url = add_query_arg( 'updated', esc_attr( $updated ), $url );
     
    130130    }
    131131
    132     if ( isset( $post->ID ) && isset( AMem()->options->permalinks[ $page ] ) && $post->ID == AMem()->options->permalinks[ $page ] ) {
     132    if ( isset( $post->ID ) && isset( amem()->options->permalinks[ $page ] ) && $post->ID == amem()->options->permalinks[ $page ] ) {
    133133        return true;
    134134    }
     
    257257    switch ($key) {
    258258        case 'ID':
    259         return AMem()->user->id;
     259        return amem()->user->id;
    260260        break;
    261261
    262262        default:
    263         $value = maybe_unserialize( AMem()->user->get($key) );
     263        $value = maybe_unserialize( amem()->user->get($key) );
    264264        if ( is_array( $value ) ) {
    265265            $value = implode( ",", $value );
     
    310310    // Get fields from the global submission object if fields weren't passed
    311311    if ( ! $fields && amem_has_submission() ) {
    312         $fields = AMem()->submission['fields'];
     312        $fields = amem()->submission['fields'];
    313313    }
    314314
     
    875875
    876876function amem_is_pro() {
    877     return defined( 'AMem_PRO' ) && AMem_PRO;
    878 }
     877    return defined( 'AMEM_PRO' ) && AMEM_PRO;
     878}
  • advanced-members/trunk/core/functions-submissions.php

    r3182890 r3186203  
    7575 */
    7676function amem_has_submission( $hash = false ) {
    77   $submission = AMem()->submission;
     77  $submission = amem()->submission;
    7878
    7979  if ( empty( $submission ) ) {
     
    9595 */
    9696function amem_submission_failed( $key = false ) {
    97   $submission = AMem()->submission;
     97  $submission = amem()->submission;
    9898
    9999  if ( empty( $submission ) ) {
     
    109109  }
    110110
    111   if ( AMem()->errors->has_errors() )
     111  if ( amem()->errors->has_errors() )
    112112    return true;
    113113
     
    122122 */
    123123function amem_add_submission_error( $message, $input=null ) {
    124   return AMem()->errors->add($input, $message);
     124  return amem()->errors->add($input, $message);
    125125}
    126126
  • advanced-members/trunk/core/modules/class-adminbar.php

    r3182890 r3186203  
    2121
    2222    function __construct() {
    23         if ( AMem()->options->getmodule('_use_adminbar') ) {
     23        if ( amem()->options->getmodule('_use_adminbar') ) {
    2424            add_filter( 'show_admin_bar', [$this, 'show_admin_bar'], 88 );
    2525        }
     
    3131
    3232        // global disable adminbar option
    33         // $bool = ! AMem()->options->get('adminbar/global');
     33        // $bool = ! amem()->options->get('adminbar/global');
    3434
    35         // if ( AMem()->options->get('adminbar/by_roles') ) {
    36             foreach ( AMem()->user->get('roles') as $role ) {
    37                 $role_op = AMem()->options->get('adminbar/roles/'.$role, null );
     35        // if ( amem()->options->get('adminbar/by_roles') ) {
     36            foreach ( amem()->user->get('roles') as $role ) {
     37                $role_op = amem()->options->get('adminbar/roles/'.$role, null );
    3838                if ( $role_op ) {
    3939                    $bool = false;
     
    4848}
    4949
    50 AMem()->register_module('adminbar', AdminBar::getInstance());
     50amem()->register_module('adminbar', AdminBar::getInstance());
  • advanced-members/trunk/core/modules/class-redirects.php

    r3182890 r3186203  
    2121
    2222    function __construct() {
    23         if ( AMem()->options->getmodule('_use_redirects') ) {
     23        if ( amem()->options->getmodule('_use_redirects') ) {
    2424            // apply after core form filters
    2525            add_filter( 'amem/form/from_post', [$this, 'form_redirects'], 33 );
     
    3737
    3838    function logout_redirects($url) {
    39         if ( $opt_url = AMem()->options->get("redirect/_after_logout", $url) ) {
     39        if ( $opt_url = amem()->options->get("redirect/_after_logout", $url) ) {
    4040            $url = $opt_url;
    41             $url = AMem()->actions->after_submit_url( $url, ['redirect_url' => AMem()->options->get("redirect/logout_redirect_url")] );
     41            $url = amem()->actions->after_submit_url( $url, ['redirect_url' => amem()->options->get("redirect/logout_redirect_url")] );
    4242        }
    43         if ( AMem()->options->get('roles/apply_roles_redirection') ) {
     43        if ( amem()->options->get('roles/apply_roles_redirection') ) {
    4444            $roles = amem_user('roles');
    4545            if ( $rule = $this->rule_for_roles($roles, 'logout') ) {
    46                 $url = AMem()->actions->after_submit_url($rule['after_submit'], $rule);
     46                $url = amem()->actions->after_submit_url($rule['after_submit'], $rule);
    4747            }
    4848        }
     
    5757        //  $redirect_url = get_post_meta($form_post->ID, "amem_form_{$form_type}_redirect_url", true);
    5858        // } else {
    59         //  $after_submit = AMem()->options->get("redirect/_after_{$form_type}");
    60         //  $redirect_url = AMem()->options->get("redirect/{$form_type}_redirect_url");
     59        //  $after_submit = amem()->options->get("redirect/_after_{$form_type}");
     60        //  $redirect_url = amem()->options->get("redirect/{$form_type}_redirect_url");
    6161        // }
    6262
    6363        $form_type = $this->tab_to_form_type($form['type'], $form);
    6464
    65         $after_submit = AMem()->options->get("redirect/_after_{$form_type}", $form['data']['after_submit']);
    66         $redirect_url = AMem()->options->get("redirect/{$form_type}_redirect_url", $form['data']['redirect_url']);
     65        $after_submit = amem()->options->get("redirect/_after_{$form_type}", $form['data']['after_submit']);
     66        $redirect_url = amem()->options->get("redirect/{$form_type}_redirect_url", $form['data']['redirect_url']);
    6767
    68         if ( AMem()->options->get('roles/apply_roles_redirection') ) {
     68        if ( amem()->options->get('roles/apply_roles_redirection') ) {
    6969            if ( $rule = $this->get_rule_for_role($form_type) ) {
    7070                $after_submit = $rule['after_submit'];
     
    9191            break;
    9292            default:
    93             $roles = AMem()->user->get('roles');
     93            $roles = amem()->user->get('roles');
    9494            break;
    9595        }
     
    113113
    114114        foreach( (array)$roles as $role ) {
    115             $after_submit = AMem()->options->get('redirect/roles/'.$role.'/_after_' . $form_type);
     115            $after_submit = amem()->options->get('redirect/roles/'.$role.'/_after_' . $form_type);
    116116            if ( !$after_submit )
    117117                continue;
    118             $redirect_url = AMem()->options->get('redirect/roles/' .$role .'/'. $form_type . '_redirect_url');
     118            $redirect_url = amem()->options->get('redirect/roles/' .$role .'/'. $form_type . '_redirect_url');
    119119            break;
    120120        }
     
    125125}
    126126
    127 AMem()->register_module('redirects', Redirects::getInstance());
     127amem()->register_module('redirects', Redirects::getInstance());
  • advanced-members/trunk/core/modules/menu/class-items.php

    r3182890 r3186203  
    159159}
    160160
    161 AMem()->register_addon( 'menu/items', Items::getInstance() );
     161amem()->register_addon( 'menu/items', Items::getInstance() );
    162162
    163163if ( is_admin() ) {
  • advanced-members/trunk/core/rest/class-rest-controller.php

    r3182890 r3186203  
    9494        }
    9595
    96         $items = AMem()->rest->get_forms($args);
     96        $items = amem()->rest->get_forms($args);
    9797
    9898        return rest_ensure_response( $items );
     
    101101    public function get_form( \WP_REST_Request $request ) {
    102102        $id = $request->get_param( 'id' );
    103         $item = AMem()->rest->get_form( $id );
     103        $item = amem()->rest->get_form( $id );
    104104
    105105        if ( ! $item ) {
  • advanced-members/trunk/languages/advanced-members.pot

    r3182890 r3186203  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-11-06T14:49:48+09:00\n"
     12"POT-Creation-Date: 2024-11-11T16:50:13+09:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.7.1\n"
     
    100100msgstr ""
    101101
     102#: acf/fields/class-user-email.php:79
     103msgid "The email is not existing in this site. Please try a different email"
     104msgstr ""
     105
    102106#. translators: email value string
    103 #: acf/fields/class-user-email.php:82
     107#: acf/fields/class-user-email.php:90
    104108msgid "The email %s is already assigned to an existing account. Please try a different email or login to your account"
    105109msgstr ""
    106110
    107111#. translators: email value string
    108 #: acf/fields/class-user-email.php:91
     112#: acf/fields/class-user-email.php:99
    109113msgid "The username %s is taken. Please try a different username"
    110114msgstr ""
    111115
    112 #: acf/fields/class-user-email.php:140
     116#: acf/fields/class-user-email.php:148
    113117msgid "Set as Username"
    114118msgstr ""
    115119
    116 #: acf/fields/class-user-email.php:141
     120#: acf/fields/class-user-email.php:149
    117121msgid "Save value as username as well. (Only works with registration forms)"
    118122msgstr ""
     
    14511455msgstr ""
    14521456
    1453 #: core/forms/render.php:75
     1457#: core/forms/render.php:117
    14541458msgid "Submit"
    14551459msgstr ""
  • advanced-members/trunk/readme.txt

    r3182890 r3186203  
    11=== Advanced Members for ACF ===
    22Tags: acf, advanced custom fields, members, registration, account
    3 Stable tag: 0.9.3
     3Stable tag: 0.9.4
    44Requires at least: 5.8
    55Tested up to: 6.6.1
     
    7171== Changelog ==
    7272
    73 = 0.9.0 =
     73= 0.9.3 =
    7474- Intitial Release
     75
     76= 0.9.4 =
     77- Fix: not follow redirect_to query string
     78- Fix: login button kses stripped
     79- Fix: uppercase constant names, lowercase function names
     80- New: Support email field on login form
    7581
    7682== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.