diff --git a/assets/css/um-styles.css b/assets/css/um-styles.css index a0826f6b..b2aa1265 100644 --- a/assets/css/um-styles.css +++ b/assets/css/um-styles.css @@ -765,3 +765,18 @@ small.um-max-filesize span{ background-repeat: no-repeat; background-size: 24px 24px; } + +.um-search-area { + position: relative; + max-width: 300px; +} + +.um-search-area .um-search-field { + width: 100%; +} + +.um-search-area .um-search-icon { + position: absolute; + top: 7px; + right: 10px; +} diff --git a/assets/js/um-scripts.js b/assets/js/um-scripts.js index 39b8593d..0bf86eb4 100644 --- a/assets/js/um-scripts.js +++ b/assets/js/um-scripts.js @@ -288,4 +288,8 @@ jQuery(document).ready(function() { return false; }); + jQuery(document).on('click', '#um-search-button', function() { + jQuery(this).parents('form').submit(); + }); + }); diff --git a/core/um-actions-login.php b/core/um-actions-login.php index 682db10e..3ba247af 100644 --- a/core/um-actions-login.php +++ b/core/um-actions-login.php @@ -6,24 +6,24 @@ add_action('um_submit_form_errors_hook_login', 'um_submit_form_errors_hook_login', 10); function um_submit_form_errors_hook_login( $args ){ global $ultimatemember; - + $is_email = false; - + $form_id = $args['form_id']; $mode = $args['mode']; if ( isset( $args['username'] ) && $args['username'] == '' ) { $ultimatemember->form->add_error( 'username', __('Please enter your username or email','ultimatemember') ); } - + if ( isset( $args['user_login'] ) && $args['user_login'] == '' ) { $ultimatemember->form->add_error( 'user_login', __('Please enter your username','ultimatemember') ); } - + if ( isset( $args['user_email'] ) && $args['user_email'] == '' ) { $ultimatemember->form->add_error( 'user_email', __('Please enter your email','ultimatemember') ); } - + if ( isset( $args['username'] ) ) { $field = 'username'; if ( is_email( $args['username'] ) ) { @@ -42,7 +42,7 @@ $field = 'user_login'; $user_name = $args['user_login']; } - + if ( !username_exists( $user_name ) ) { if ( $is_email ) { $ultimatemember->form->add_error( $field, __(' Sorry, we can\'t find an account with that email address','ultimatemember') ); @@ -54,23 +54,52 @@ $ultimatemember->form->add_error( 'user_password', __('Please enter your password','ultimatemember') ); } } - + $user = get_user_by( 'login', $user_name ); if ( $user && wp_check_password( $args['user_password'], $user->data->user_pass, $user->ID) ) { $ultimatemember->login->auth_id = username_exists( $user_name ); } else { $ultimatemember->form->add_error( 'user_password', __('Password is incorrect. Please try again.','ultimatemember') ); } - + + // add a way for other plugins like wp limit login + // to limit the login attempts + $user = apply_filters( 'authenticate', null, $user_name, $args['user_password'] ); + + // if there is an error notify wp + if( $ultimatemember->form->has_error( $field ) || $ultimatemember->form->has_error( $user_password ) ) { + do_action( 'wp_login_failed', $user_name ); + } } - + + /** + * Display the login errors from other plugins + */ + add_action( 'um_before_login_fields', 'um_display_login_errors' ); + function um_display_login_errors( $args ) { + global $ultimatemember; + + if( $ultimatemember->form->count_errors() > 0 ) { + $error = array_values( $ultimatemember->form->errors ); + $error = array_shift( $error ); + } + + // hook for other plugins to display error + $errors = trim( apply_filters( 'login_errors', $error ) ); + + if( trim( $errors ) ) + { + echo '

' . $errors . '

'; + } + } + /*** *** @login checks thru the frontend login ***/ add_action('um_submit_form_errors_hook_logincheck', 'um_submit_form_errors_hook_logincheck', 9999 ); function um_submit_form_errors_hook_logincheck($args){ global $ultimatemember; - + // Logout if logged in if ( is_user_logged_in() ) { wp_logout(); @@ -78,10 +107,10 @@ $user_id = ( isset( $ultimatemember->login->auth_id ) ) ? $ultimatemember->login->auth_id : ''; um_fetch_user( $user_id ); - + $status = um_user('account_status'); // account status switch( $status ) { - + // If user can't login to site... case 'inactive': case 'awaiting_admin_review': @@ -90,15 +119,15 @@ um_reset_user(); exit( wp_redirect( add_query_arg( 'err', esc_attr( $status ), $ultimatemember->permalinks->get_current_url() ) ) ); break; - + } - + if ( isset( $args['form_id'] ) && $args['form_id'] == $ultimatemember->shortcodes->core_login_form() && $ultimatemember->form->errors && !isset( $_POST[ $ultimatemember->honeypot ] ) ) { exit( wp_redirect( um_get_core_page('login') ) ); } - + } - + /*** *** @store last login timestamp ***/ @@ -107,7 +136,7 @@ delete_user_meta( $user_id, '_um_last_login' ); update_user_meta( $user_id, '_um_last_login', current_time( 'timestamp' ) ); } - + add_action( 'wp_login', 'um_store_lastlogin_timestamp_' ); function um_store_lastlogin_timestamp_( $login ) { $user = get_user_by('login',$login); @@ -115,7 +144,7 @@ delete_user_meta( $user_id, '_um_last_login' ); update_user_meta( $user_id, '_um_last_login', current_time( 'timestamp' ) ); } - + /*** *** @login user ***/ @@ -125,57 +154,57 @@ extract( $args ); $rememberme = ( isset($args['rememberme']) ) ? 1 : 0; - + if ( um_get_option('deny_admin_frontend_login') && strstr( um_user('wp_roles' ), 'administrator' ) ) wp_die( __('This action has been prevented for security measures.','ultimatemember') ); - + $ultimatemember->user->auto_login( um_user('ID'), $rememberme ); - + // Hook that runs after successful login and before user is redirected do_action('um_on_login_before_redirect', um_user('ID') ); - + // Priority redirect if ( isset( $args['redirect_to'] ) && ! empty( $args['redirect_to'] ) ) { exit( wp_redirect( urldecode( $args['redirect_to'] ) ) ); } - + // Role redirect $after = um_user('after_login'); switch( $after ) { - + case 'redirect_admin': exit( wp_redirect( admin_url() ) ); break; - + case 'redirect_profile': exit( wp_redirect( um_user_profile_url() ) ); break; - + case 'redirect_url': exit( wp_redirect( um_user('login_redirect_url') ) ); break; - + case 'refresh': exit( wp_redirect( $ultimatemember->permalinks->get_current_url() ) ); break; - + } - + } - + /*** *** @form processing ***/ add_action('um_submit_form_login', 'um_submit_form_login', 10); function um_submit_form_login($args){ global $ultimatemember; - + if ( !isset($ultimatemember->form->errors) ) { do_action( 'um_user_login', $args ); } - + do_action('um_user_login_extra_hook', $args ); - + } /*** @@ -187,18 +216,18 @@ // DO NOT add when reviewing user's details if ( $ultimatemember->user->preview == true && is_admin() ) return; - + $primary_btn_word = $args['primary_btn_word']; $primary_btn_word = apply_filters('um_login_form_button_one', $primary_btn_word, $args ); - + $secondary_btn_word = $args['secondary_btn_word']; $secondary_btn_word = apply_filters('um_login_form_button_two', $secondary_btn_word, $args ); - + $secondary_btn_url = ( isset( $args['secondary_btn_url'] ) && $args['secondary_btn_url'] ) ? $args['secondary_btn_url'] : um_get_core_page('register'); $secondary_btn_url = apply_filters('um_login_form_button_two_url', $secondary_btn_url, $args ); - + ?> - +
- +
- + - +
- + - +
- +
- + - +
- + fields->display( 'login', $args ); - - } \ No newline at end of file + + } diff --git a/core/um-actions-password.php b/core/um-actions-password.php index c0434708..f2cf8723 100644 --- a/core/um-actions-password.php +++ b/core/um-actions-password.php @@ -1,5 +1,5 @@ user_email; @@ -19,15 +19,15 @@ $ultimatemember->password->reset_request['user_id'] = $data->ID; $ultimatemember->password->reset_request['user_email'] = $user_email; - + um_fetch_user( $data->ID ); - + $ultimatemember->user->password_reset(); um_reset_user(); - + } - + /*** *** @process a change request ***/ @@ -37,32 +37,32 @@ extract( $args ); wp_set_password( $args['user_password'], $args['user_id'] ); - + delete_user_meta( $args['user_id'], 'reset_pass_hash'); delete_user_meta( $args['user_id'], 'reset_pass_hash_token'); delete_user_meta( $args['user_id'], 'password_rst_attempts'); do_action('um_after_changing_user_password', $args['user_id'] ); - - + + if ( is_user_logged_in() ) { wp_logout(); } - + exit( wp_redirect( um_get_core_page('login', 'password_changed') ) ); - + } - + /** * Overrides password changed notification - * + * */ function um_send_password_change_email( $args ){ global $ultimatemember; um_fetch_user( $user_id ); - + $ultimatemember->user->password_changed(); um_reset_user(); @@ -70,7 +70,7 @@ return false; } - + /*** *** @This is executed after changing password ***/ @@ -79,20 +79,20 @@ global $ultimatemember; } - + /*** *** @Error handler: reset password ***/ add_action('um_reset_password_errors_hook','um_reset_password_errors_hook'); function um_reset_password_errors_hook( $args ) { global $ultimatemember; - + if ( $_POST[ $ultimatemember->honeypot ] != '' ) wp_die('Hello, spam bot!'); $form_timestamp = trim($_POST['timestamp']); $live_timestamp = current_time( 'timestamp' ); - + if ( $form_timestamp == '' && um_get_option('enable_timebot') == 1 ) wp_die( __('Hello, spam bot!') ); @@ -102,9 +102,9 @@ if ( strlen(trim( $_POST['username_b'] ) ) == 0 ) { $ultimatemember->form->add_error('username_b', __('Please provide your username or email','ultimatemember') ); } - + $user = $_POST['username_b']; - + if ( ( !is_email( $user ) && !username_exists( $user ) ) || ( is_email( $user ) && !email_exists( $user ) ) ) { $ultimatemember->form->add_error('username_b', __('We can\'t find an account registered with that address or username','ultimatemember') ); } else { @@ -120,38 +120,38 @@ update_user_meta( $user_id, 'password_rst_attempts', $attempts + 1 ); } } - + } - + /*** *** @Error handler: changing password ***/ add_action('um_change_password_errors_hook','um_change_password_errors_hook'); function um_change_password_errors_hook( $args ) { global $ultimatemember; - + if ( $_POST[ $ultimatemember->honeypot ] != '' ) wp_die('Hello, spam bot!'); $form_timestamp = trim($_POST['timestamp']); $live_timestamp = current_time( 'timestamp' ); - + if ( $form_timestamp == '' && um_get_option('enable_timebot') == 1 ) wp_die( __('Hello, spam bot!') ); if ( $live_timestamp - $form_timestamp < 3 && um_get_option('enable_timebot') == 1 ) wp_die( __('Whoa, slow down! You\'re seeing this message because you tried to submit a form too fast and we think you might be a spam bot. If you are a real human being please wait a few seconds before submitting the form. Thanks!') ); - + if ( !$args['user_password'] ) { $ultimatemember->form->add_error('user_password', __('You must enter a new password','ultimatemember') ); } if ( um_get_option('reset_require_strongpass') ) { - + if ( strlen( utf8_decode( $args['user_password'] ) ) < 8 ) { $ultimatemember->form->add_error('user_password', __('Your password must contain at least 8 characters','ultimatemember') ); } - + if ( strlen( utf8_decode( $args['user_password'] ) ) > 30 ) { $ultimatemember->form->add_error('user_password', __('Your password must contain less than 30 characters','ultimatemember') ); } @@ -159,99 +159,101 @@ if ( !$ultimatemember->validation->strong_pass( $args['user_password'] ) ) { $ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') ); } - + } if ( !$args['confirm_user_password'] ) { $ultimatemember->form->add_error('confirm_user_password', __('You must confirm your new password','ultimatemember') ); } - + if ( $args['user_password'] != $args['confirm_user_password'] ) { $ultimatemember->form->add_error('confirm_user_password', __('Your passwords do not match','ultimatemember') ); } } - + /*** *** @hidden fields ***/ add_action('um_change_password_page_hidden_fields','um_change_password_page_hidden_fields'); function um_change_password_page_hidden_fields( $args ) { - + ?> - + - + - + - + - + builtin->get_specific_fields('password_reset_text,username_b'); ?> - + $data ) { $output .= $ultimatemember->fields->edit_field( $key, $data ); }echo $output; ?> - + + +
- +
- +
- +
- + builtin->get_specific_fields('user_password'); ?> - + $data ) { $output .= $ultimatemember->fields->edit_field( $key, $data ); }echo $output; ?> - +
- +
- +
- +
- + permalinks->get_query_array(); - + foreach( $ultimatemember->members->core_search_fields as $key ) { - + if ( isset( $query[$key] ) && ! empty( $query[$key] ) ) { $query_args['search'] = '*' . trim($query[$key]) . '*'; } } - + return $query_args; } @@ -66,6 +66,12 @@ $query = $ultimatemember->permalinks->get_query_array(); + // if searching + if( isset( $query['search'] ) ) { + $query_args['search'] = '*' . um_filter_search( $query['search'] ) . '*'; + unset( $query['search'] ); + } + if ( $query && is_array( $query ) ) { foreach( $query as $field => $value ) { @@ -147,7 +153,7 @@ 'value' => '', 'compare' => '!=' ) - + ); } diff --git a/core/um-form.php b/core/um-form.php index c7995900..756ff515 100644 --- a/core/um-form.php +++ b/core/um-form.php @@ -20,6 +20,20 @@ class UM_Form { } + /** + * Count the form errors. + * @return integer + */ + function count_errors() { + $errors = $this->errors; + + if( $errors && is_array( $errors ) ) { + return count( $errors ); + } + + return 0; + } + /*** *** @add errors ***/ @@ -67,7 +81,7 @@ class UM_Form { $this->form_id = $_POST['form_id']; $this->form_status = get_post_status( $this->form_id ); - + if ( $this->form_status == 'publish' ) { @@ -77,11 +91,11 @@ class UM_Form { $this->post_form = $this->beautify( $this->post_form ); $this->form_data = $ultimatemember->query->post_data( $this->form_id ); - + $this->post_form['submitted'] = $this->post_form; $this->post_form = array_merge( $this->form_data, $this->post_form ); - + $role = $this->assigned_role( $this->form_id ); if( $role && isset( $this->form_data['custom_fields'] ) && ! strstr( $this->form_data['custom_fields'], 'role_' ) ){ // has assigned role. Validate non-global forms @@ -114,7 +128,7 @@ class UM_Form { } /* Continue based on form mode - pre-validation */ - + do_action('um_submit_form_errors_hook', $this->post_form ); do_action("um_submit_form_{$this->post_form['mode']}", $this->post_form ); @@ -171,7 +185,7 @@ class UM_Form { function assigned_role( $post_id ){ $register_use_globals = get_post_meta( $post_id, '_um_register_use_globals', true); - + if( $register_use_globals == 1 ){ $role = um_get_option('default_role'); }else if( $register_use_globals == 0 ){ diff --git a/core/um-members.php b/core/um-members.php index 991e16af..e620b3ed 100644 --- a/core/um-members.php +++ b/core/um-members.php @@ -78,11 +78,15 @@ class UM_Members { $type = 'select'; } else if ( 'user_tags' == $attrs['type'] ) { $attrs['options'] = apply_filters('um_multiselect_options_user_tags', array(), $attrs); + $attrs['custom'] = 1; $type = 'select'; } else { $type = 'text'; } + // filter all search fields + $attrs = apply_filters( 'um_search_fields', $attrs ); + switch( $type ) { case 'select': @@ -143,7 +147,7 @@ class UM_Members { $query_args = array(); $query_args = apply_filters( 'um_prepare_user_query_args', $query_args, $args ); $users = new WP_User_Query( $query_args ); - + // number of profiles for mobile if ( $ultimatemember->mobile->isMobile() && isset( $profiles_per_page_mobile ) ) $profiles_per_page = $profiles_per_page_mobile; diff --git a/core/um-profile.php b/core/um-profile.php index c7d13324..3488b280 100644 --- a/core/um-profile.php +++ b/core/um-profile.php @@ -3,19 +3,30 @@ class UM_Profile { function __construct() { - + add_action('template_redirect', array(&$this, 'active_tab'), 10002); add_action('template_redirect', array(&$this, 'active_subnav'), 10002); - + } - + /*** *** @all tab data ***/ function tabs(){ - return apply_filters('um_profile_tabs', $tabs = array() ); + $tabs = apply_filters('um_profile_tabs', $tabs = array() ); + + // disable private tabs + if( !is_admin() ) { + foreach( $tabs as $id => $tab ) { + if( !$this->can_view_tab( $id ) ) { + unset( $tabs[$id] ); + } + } + } + + return $tabs; } - + /*** *** @tabs that are active ***/ @@ -27,7 +38,7 @@ class UM_Profile { } return $tabs; } - + /*** *** @primary tabs only ***/ @@ -40,7 +51,7 @@ class UM_Profile { } return $primary; } - + /*** *** @Activated tabs in backend ***/ @@ -55,7 +66,63 @@ class UM_Profile { } return ( isset( $primary ) ) ? $primary : ''; } - + + /*** + *** @Privacy options + ***/ + function tabs_privacy() { + $privacy = array( + 0 => 'Anyone', + 1 => 'Guests only', + 2 => 'Members only', + 3 => 'Only the owner', + 4 => 'Specific roles' + ); + + return $privacy; + } + + /*** + *** @Check if the user can view the current tab + ***/ + function can_view_tab( $tab ) { + global $ultimatemember; + + $privacy = intval( um_get_option( 'profile_tab_' . $tab . '_privacy' ) ); + $can_view = false; + + switch( $privacy ) { + case 1: + $can_view = is_user_logged_in() ? false : true; + break; + + case 2: + $can_view = is_user_logged_in() ? true : false; + break; + + case 3: + $can_view = get_current_user_id() == um_user( 'ID' ) ? true : false; + break; + + case 4: + $can_view = false; + if( is_user_logged_in() ) { + $roles = um_get_option( 'profile_tab_' . $tab . '_roles' ); + if( is_array( $roles ) + && in_array( $ultimatemember->user->get_role(), $roles ) ) { + $can_view = true; + } + } + break; + + default: + $can_view = true; + break; + } + + return $can_view; + } + /*** *** @Get active_tab ***/ @@ -66,53 +133,53 @@ class UM_Profile { if ( get_query_var('profiletab') ) { $this->active_tab = get_query_var('profiletab'); } - + $this->active_tab = apply_filters( 'um_profile_active_tab', $this->active_tab ); return $this->active_tab; } - + /*** *** @Get active active_subnav ***/ function active_subnav() { - + $this->active_subnav = null; - + if ( get_query_var('subnav') ) { $this->active_subnav = get_query_var('subnav'); } - + return $this->active_subnav; } - + /*** *** @Show meta in profile ***/ function show_meta( $array ) { global $ultimatemember; $output = ''; - + foreach( $array as $key ) { $data = ''; if ( $key && um_filtered_value( $key ) ) { - + if ( isset( $ultimatemember->builtin->all_user_fields[$key]['icon'] ) ) { $icon = $ultimatemember->builtin->all_user_fields[$key]['icon']; } else { $icon = ''; } - + $icon = ( isset( $icon ) && !empty( $icon ) ) ? '' : ''; - + if ( !um_get_option('profile_show_metaicon') ) $icon = ''; - + $value = um_filtered_value( $key ); - + $items[] = '' . $icon . $value . ''; $items[] = ''; - + } } @@ -126,4 +193,4 @@ class UM_Profile { return $output; } -} \ No newline at end of file +} diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 087aeaa1..13f317e8 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -1524,3 +1524,46 @@ function um_fetch_user( $user_id ) { return $value; } + + /** + * Filters the search query. + * + * @param string $search + * @return string + */ + function um_filter_search($search) { + $search = trim( strip_tags( $search ) ); + $search = preg_replace('/[^a-z \.\@\_\-]+/i', '', $search); + + return $search; + } + + /** + * Returns the user search query + * @return string + */ + function um_get_search_query() { + global $ultimatemember; + + $query = $ultimatemember->permalinks->get_query_array(); + $search = isset( $query['search'] ) ? $query['search'] : ''; + + return um_filter_search($search); + } + + /** + * Returns the ultimate member search form + * @return string + */ + function um_get_search_form() { + return do_shortcode( '[ultimatemember_searchform]' ); + } + + /** + * Display the search form. + * + * @return string + */ + function um_search_form() { + echo um_get_search_form(); + } diff --git a/core/um-shortcodes.php b/core/um-shortcodes.php index edfcf2c8..2d16b30c 100644 --- a/core/um-shortcodes.php +++ b/core/um-shortcodes.php @@ -13,6 +13,7 @@ class UM_Shortcodes { add_shortcode('um_loggedin', array(&$this, 'um_loggedin')); add_shortcode('um_loggedout', array(&$this, 'um_loggedout')); add_shortcode('um_show_content', array(&$this, 'um_shortcode_show_content_for_role') ); + add_shortcode('ultimatemember_searchform', array(&$this, 'ultimatemember_searchform') ); add_filter('body_class', array(&$this, 'body_class'), 0); @@ -570,4 +571,20 @@ class UM_Shortcodes { return ''; } + public function ultimatemember_searchform($args = array(), $content = "") { + // turn off buffer + ob_start(); + + // load template + $this->load_template( 'searchform' ); + + // get the buffer + $template = ob_get_contents(); + + // clear the buffer + ob_end_clean(); + + return $template; + } + } diff --git a/core/widgets/um-search-widget.php b/core/widgets/um-search-widget.php new file mode 100644 index 00000000..f81a61c4 --- /dev/null +++ b/core/widgets/um-search-widget.php @@ -0,0 +1,71 @@ + __( 'Shows users they follow in a widget.', 'ultimatemember' ), ) + ); + + } + + // Creating widget front-end + public function widget( $args, $instance ) { + $title = apply_filters( 'widget_title', $instance['title'] ); + + // before and after widget arguments are defined by themes + echo $args['before_widget']; + if ( ! empty( $title ) ) { + echo $args['before_title'] . $title . $args['after_title']; + } + + // display the search form + um_search_form(); + + echo $args['after_widget']; + } + + // Widget Backend + public function form( $instance ) { + global $ultimatemember; + + if ( isset( $instance[ 'title' ] ) ) { + $title = $instance[ 'title' ]; + } else { + $title = __( 'Search Users', 'ultimatemember' ); + } + + if ( isset( $instance[ 'max' ] ) ) { + $max = $instance[ 'max' ]; + } else { + $max = 11; + } + + // Widget admin form + ?> + +

+ + +

+ + "> + +
+ + + +
+ diff --git a/um-config.php b/um-config.php index c833e65d..7df81853 100644 --- a/um-config.php +++ b/um-config.php @@ -1594,6 +1594,30 @@ foreach( $tabs as $id => $tab ) { 'off' => __('Off','ultimatemember'), ); + $tab_options[] = array( + 'id' => 'profile_tab_' . $id . '_privacy', + 'type' => 'select', + 'select2' => array( 'allowClear' => 0, 'minimumResultsForSearch' => -1 ), + 'title' => sprintf( __( 'Who can see %s Tab?','ultimatemember' ), $tab ), + 'desc' => __( 'Select which users can view this tab.','ultimatemember' ), + 'default' => 0, + 'options' => $ultimatemember->profile->tabs_privacy(), + 'required' => array( 'profile_tab_' . $id, '=', 1 ), + ); + + $tab_options[] = array( + 'id' => 'profile_tab_' . $id . '_roles', + 'type' => 'select', + 'multi' => true, + 'select2' => array( 'allowClear' => 1, 'minimumResultsForSearch' => -1 ), + 'title' => __( 'Allowed roles','ultimatemember' ), + 'desc' => __( 'Select the the user roles allowed to view this tab.','ultimatemember' ), + 'default' => '', + 'options' => $ultimatemember->query->get_roles(), + 'placeholder' => __( 'Choose user roles...','ultimatemember' ), + 'required' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ), + ); + } $tab_options[] = array( diff --git a/um-init.php b/um-init.php index 30be66f3..5ad179ad 100644 --- a/um-init.php +++ b/um-init.php @@ -58,6 +58,12 @@ class UM_API { __('This add-on enables you to link gravatar photos to user accounts with their email address.', 'ultimatemember'), ); + // include widgets + require_once um_path . 'core/widgets/um-search-widget.php'; + + // init widgets + add_action( 'widgets_init', array(&$this, 'widgets_init' ) ); + } /*** @@ -198,6 +204,10 @@ class UM_API { } + function widgets_init() { + register_widget( 'um_search_widget' ); + } + } -$ultimatemember = new UM_API(); \ No newline at end of file +$ultimatemember = new UM_API();