| @@ -257,18 +257,8 @@ | ||
| 257 | 257 | */ |
| 258 | 258 | require_once dirname( dirname( __FILE__ ) ) . '/admin/settings/class-formbuilder.php'; |
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | - * The class responsible for adding admin table listing | |
| 262 | - */ | |
| 263 | - require_once dirname ( dirname ( __FILE__ ) ) . '/admin/tables/class-user-types-table.php'; | |
| 264 | - | |
| 265 | - /** | |
| 266 | - * The class responsible for adding user types | |
| 267 | - */ | |
| 268 | - require_once dirname( dirname( __FILE__ ) ) . '/admin/settings/class-user-types.php'; | |
| 269 | - | |
| 270 | - /** | |
| 271 | 261 | * The class responsible for defining all admin area settings. |
| 272 | 262 | */ |
| 273 | 263 | require_once dirname( dirname( __FILE__ ) ) . '/admin/settings/class-uwp-settings-profile-tabs.php'; |
| 274 | 264 | |
| @@ -508,9 +498,9 @@ | ||
| 508 | 498 | register_activation_hook( USERSWP_PLUGIN_FILE, array( 'UsersWP_Activator', 'activate' ) ); |
| 509 | 499 | add_action( 'admin_init', array( 'UsersWP_Activator', 'automatic_upgrade' ) ); |
| 510 | 500 | add_action( 'init', array( 'UsersWP_Activator', 'init_background_updater' ), 5 ); |
| 511 | 501 | add_action( 'widgets_init', array( $this, 'register_widgets' ) ); |
| 512 | - add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) ); | |
| 502 | + add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); | |
| 513 | 503 | add_action( 'uwp_flush_rewrite_rules', array( $this, 'flush_rewrite_rules' ) ); |
| 514 | 504 | add_action( 'uwp_language_file_add_string', array( $this, 'register_string' ), 10, 1 ); |
| 515 | 505 | add_action( 'after_setup_theme', array( $this, 'hide_admin_bar' )); |
| 516 | 506 | } |
| @@ -538,10 +528,8 @@ | ||
| 538 | 528 | add_filter( 'uwp_before_extra_fields_save', array( $instance, 'save_user_ip_on_register' ), 10, 3 ); |
| 539 | 529 | add_filter( 'uwp_update_usermeta', array( $instance, 'modify_datepicker_value_on_update' ), 10, 3 ); |
| 540 | 530 | add_filter( 'uwp_get_usermeta', array( $instance, 'modify_datepicker_value_on_get' ), 10, 4 ); |
| 541 | 531 | add_action( 'get_user_metadata', array( $instance, 'dynamically_add_user_meta' ), 10, 4 ); |
| 542 | - // enqueue select2 on auth pages. | |
| 543 | - add_filter( 'aui_is_conditional_select2', array( $this, 'enqueue_select2_on_auth_pages'), 10, 1 ); | |
| 544 | 532 | } |
| 545 | 533 | |
| 546 | 534 | public function load_files_actions_and_filters( $instance ) { |
| 547 | 535 | if ( $instance->doing_upload() ) { |
| @@ -570,9 +558,9 @@ | ||
| 570 | 558 | add_action( 'wp_ajax_nopriv_uwp_ajax_forgot_password', array( $instance, 'process_forgot' ) ); |
| 571 | 559 | |
| 572 | 560 | // general |
| 573 | 561 | add_action( 'init', array( $instance, 'init_notices' ), 1 ); |
| 574 | - add_action( 'init', array( $instance, 'handler' ), 11 ); | |
| 562 | + add_action( 'uwp_loaded', array( $instance, 'handler' ) ); | |
| 575 | 563 | add_action( 'init', array( $instance, 'privacy_submit_handler' ) ); |
| 576 | 564 | add_action( 'uwp_template_display_notices', array( $instance, 'display_notices' ), 10, 1 ); |
| 577 | 565 | add_action( 'wp_ajax_uwp_upload_file_remove', array( $instance, 'upload_file_remove' ) ); |
| 578 | 566 | //User search form |
| @@ -916,26 +904,13 @@ | ||
| 916 | 904 | * Filter the locale to use for translations. |
| 917 | 905 | */ |
| 918 | 906 | $locale = apply_filters( 'plugin_locale', $locale, 'userswp' ); |
| 919 | 907 | |
| 920 | - unload_textdomain( 'userswp', true ); | |
| 908 | + unload_textdomain( 'userswp' ); | |
| 921 | 909 | load_textdomain( 'userswp', WP_LANG_DIR . '/userswp/userswp-' . $locale . '.mo' ); |
| 922 | 910 | load_plugin_textdomain( 'userswp', false, plugin_basename( dirname( USERSWP_PLUGIN_FILE ) ) . '/languages/' ); |
| 923 | 911 | |
| 924 | 912 | do_action( 'uwp_loaded' ); |
| 925 | - } | |
| 926 | - | |
| 927 | - /** | |
| 928 | - * Ensure Select2 is enqueued in auth pages only if not already done. | |
| 929 | - * | |
| 930 | - * @return void | |
| 931 | - * | |
| 932 | - * @since 1.2.29 | |
| 933 | - */ | |
| 934 | - public function enqueue_select2_on_auth_pages() { | |
| 935 | - if ( ! wp_script_is( 'select2', 'enqueued' ) ) { | |
| 936 | - wp_enqueue_script( 'select2' ); | |
| 937 | - } | |
| 938 | 913 | } |
| 939 | 914 | |
| 940 | 915 | /** |
| 941 | 916 | * Flush rewrite rules. |