How to create user personal pages with information from their meta profile fields?

First of all register the cpt. Probably if you don’t want add the UI for that post type you can set the show_ui to false. $args = array( ‘label’ => ‘Members’, ‘public’ => true, ‘exclude_from_search’ => true, ‘show_ui’ => false, ‘show_in_nav_menus’ => false, ‘show_in_menu’ => false, ‘show_in_admin_bar’ => false, ‘hierarchical’ => false, ‘has_archive’ => true, … Read more

How to use the WP REST API for new user registration (sign up form)?

hopefully you’ve found the answer already. Here’s our solution, for your reference. 😀 The following code should add User Registration via REST API to your WordPress Website. It supports Registration of ‘subscriber’ and ‘customer’. Add it to your function.php add_action(‘rest_api_init’, ‘wp_rest_user_endpoints’); /** * Register a new user * * @param WP_REST_Request $request Full details about … Read more

User profile custom field

Here is an example using a field called my_field. The value is successfully saved and displayed: // Declaring the form fields add_action( ‘show_user_profile’, ‘wpse_show_my_fields’ ); add_action( ‘edit_user_profile’, ‘wpse_show_my_fields’ ); add_action( ‘user_new_form’, ‘wpse_show_my_fields’ ); function wpse_show_my_fields( $user ) { $fetched_field = get_user_meta( $user->ID, ‘my_field’, true ); ?> <tr class=”form-field”> <th scope=”row”><label for=”my_field”><?php _e( ‘Field Name’, ‘text-domain’ … Read more

Show User Their Password

Theoretically, this could be achieved by saving a user’s password elsewhere, when he or she updates it. Note that this sort of thing is hardly ever recommendable. In almost all cases, there is a better architectural approach that renders having to be able to show plain-text passwords unnecessary. That being said, if you absolutely must … Read more

Updating User Meta with SQL Query

How can I write a bulk MySQL command to add in the value wp_capabilites=”a:1:{s:10:”subscriber”;b:1;}” into each user_id except 1, 2 and 3 ie. the newly imported users? You don’t. That is a serialized array which is a PHP construct. MySQL has no idea what to do with it. To the database, it is just an … Read more

Querying Email Addresses for a List of Users with Same Last Name?

Hi @Holidaymaine: Here’s the query you are looking for: <?php include( ‘../wp-load.php’ ); $sql =<<<SQL SELECT DISTINCT u.user_email AS user_email, um.meta_value AS user_lastname FROM {$wpdb->users} AS u LEFT JOIN {$wpdb->usermeta} AS um ON u.ID = um.user_id LEFT JOIN {$wpdb->posts} AS p ON u.ID = p.post_author LEFT JOIN {$wpdb->term_relationships} AS tr ON p.ID = tr.object_id LEFT … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)