$value ) : ?>

Have a question? Not sure how to proceed?

Open a new ticket over at
https://wordpress.org/support/plugin/profile-builder/

Describe your problem:

  • What you tried to do
  • What you expected to happen
  • What actually happened
  • Screenshots help. Use a service like snipboard.io and share the link.

Get help from our team

Register

Add registration forms where users can sign-up and enter their initial details.

[wppb-register]
Login

Allow members to login.

[wppb-login]
Edit Profile

Allow members to edit their account information.

[wppb-edit-profile]
Restrict Content

Restrict pieces of content on individual posts and pages based on user role.

[wppb-restrict user_roles="subscriber"]
true, 'data' => array(), ); // generate filter data $args = array(); if( $interval == 'this_month' ){ $args['interval'][] = date( 'Y-m-01', time() ); $args['interval'][] = date( 'Y-m-d', time() ); } else if( $interval == 'last_month' ){ $args['interval'][] = date( 'Y-m-01', strtotime( '-1 month' ) ); $args['interval'][] = date( 'Y-m-t', strtotime( '-1 month' ) ); } else if( $interval == 'this_year' ){ $args['interval'][] = date( 'Y-01-01', time() ); $args['interval'][] = date( 'Y-m-d', time() ); } $return['data'] = wppb_users_stats( $args ); echo json_encode( $return ); die(); } add_action( 'wp_ajax_wppb_get_dashboard_stats', 'wppb_get_dashboard_stats' ); /** * Get User stats * */ function wppb_users_stats( $args = array() ) { $total_users = count_users(); $users_stats = array( 'all_users' => $total_users['total_users'], 'newly_registered' => '', ); if ( empty( $args ) ) { $reg_start_date = date('Y-m-d', strtotime('-30 days')); $reg_end_date = date('Y-m-d' ); } else { $reg_start_date = $args['interval'][0]; $reg_end_date = $args['interval'][1]; } $query_args = array( 'date_query' => array( array( 'after' => $reg_start_date, 'before' => $reg_end_date, 'inclusive' => true, ), ), ); $user_query = new WP_User_Query( $query_args ); $users_stats['newly_registered'] = $user_query->get_total(); return $users_stats; } /** * Get the Labels for User stats * */ function wppb_users_stats_labels() { $labels = array( 'all_users' => __( 'All Users', 'profile-builder' ), 'newly_registered' => __( 'New Registered Users', 'profile-builder' ), ); return $labels; } /** * Get recently registered Users * */ function wppb_recent_registrations( $args = array() ) { $query_args = array( 'orderby' => 'user_registered', 'order' => 'DESC', 'number' => 5, ); $user_query = new WP_User_Query( $query_args ); $users_stats = array(); if( !empty( $user_query->results ) ){ foreach ( $user_query->results as $user_data ) { $user_roles = wppb_user_role_names( $user_data->roles ); $user_info = array( 'id' => $user_data->ID, 'display_name' => $user_data->display_name, 'role' => $user_roles, 'reg_date' => $user_data->user_registered, ); $users_stats[] = $user_info; } } return $users_stats; } /** * Get a list of User Role Names out of Role Slugs * */ function wppb_user_role_names( $role_slugs ) { if ( empty( $role_slugs ) ) return ''; $role_names = array(); foreach ( $role_slugs as $slug ) { $role_names[] = wp_roles()->get_names()[$slug]; } if ( !empty( $role_names ) ) $role_names = implode(', ', $role_names); return $role_names; }