Tag Info

New answers tagged

0

In short you want to mach your password with real hash code right. $user = get_user_by( 'login', $username ); if ( $user && wp_check_password( '123456', $user->data->user_pass, $user->ID) ) echo "password Matched"; else echo "Not matched";


0

If you're using WooCommerce, they have a shortcode that displays the logged in user's account details on a front end page: [woocommerce_my_account]


0

You set a custom url after rewrite from a login. A small example, usable in a template of the theme to login. <?php $redirect = esc_url( 'your-url' ); if ( ! is_user_logged_in() ) { $link = '<a href="' . get_option( 'siteurl' ) . '/wp-login.php?redirect_to=' . home_url( '/' ...


0

In cases like this its better off (IHMO) to simple use a custom query using the $wpdb class ex: <?php global $wpdb; //first get a list of all meta keys $keys = $wpdb->get_col("SELECT distinct meta_key FROM $wpdb->usermeta"); //then prepare the meta keys query as fields which we'll join to the user table fields $meta_columns = ''; foreach ($keys ...


0

My mistake. I had Absolute Privacy plugin turned on and that was interfering.


1

You can try the map_meta_cap filter: /** * Uneditable posts/pages for editors */ add_filter( 'map_meta_cap', function ( $caps, $cap, $user_id, $args ) { // Edit to your needs: $post_ids = [123, 234, 345, 456]; // Uneditable posts $role = 'editor'; // Uneditable by this user role // Make given posts uneditable for the ...


0

Here is one example I did for quick eidt add_action( 'quick_edit_custom_box', 'ks_add_to_bulk_quick_edit_custom_box', 10, 2 ); function ks_add_to_bulk_quick_edit_custom_box( $column_name, $post_type ) { switch ( $post_type ) { case 'post': switch( $column_name ) { case 'my_post_active': ?><fieldset ...


0

The hooks are important, no matter how we sorted form fields inside the function. Follow my inline comments. As of WordPress 4.2.2 we have plenty of hooks now: <?php /** * Declaring the form fields */ function show_my_fields( $user ) { $fetched_field = get_user_meta( $user->ID, 'my_field', true ); ?> <tr class="form-field"> ...


0

Assuming that those users have accounts on your site (are subscribers, authors, or some other role), you can add custom fields to their profiles. The easiest way is to use a plugin, like Advanced Custom Fields (https://wordpress.org/plugins/advanced-custom-fields/). The fields would be available in their profile pages, and you can add, and use in any ...


0

I used User Role Editor a couple of times and is pretty good. Maybe it could help you too. Here is the link User Role Editor


0

If you can deploy wp-cli on WAMP, just use the wp user create command. A much saner way to do it than trying to do it in phpMyAdmin.


0

Yes, the links will always be accessible unless you disable them on your htaccess or a PHP file. If you don't have any author page, probably the users (or bots) that are reaching this page are seeing your index page. I highly recommend you install Google Analytics code on your website to track what your users are seeing instead of a server log.


0

I think you should create password in form of MD5, suggested by @passatgt. Also one point is missed that you not mentioned so I suggest to check your 'siteurl' and 'home' fields from db table. The two fields you need to edit are 'siteurl' and 'home'. Replace the URL contained in "option_value" with http://localhost/yourfoldername/. It's done. PS:If this ...


0

This way would work ... the user_register action is fired when the user is stored in the data base. You can add meta data to a user with add_metadata. add_action( 'user_register', 'myplugin_registration_save', 10, 1 ); function myplugin_registration_save( $user_id ) { add_metadata( $user_id, 'unique_number', date( 'Y' ).str_pad( $user_id, 4 ) ); }


1

Edit the user in phpmyadmin, enter the password as text in the user_pass field and there is a “Function” column with drop down boxes. On this field just select MD5 in the function column. When you save it phpMyAdmin will automatically md5 hash it for you.


0

Try This will not Showing you the warning like Missing argument 2 for wpdb::prepare() function user_id_exists($user_id){ global $wpdb; $count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->users WHERE ID = %d",$user_id)); if($count == 1){ return true; }else{ return false; } }


3

If you're logged into WordPress as an administrator, you can easily change the post author of a post to someone else. So what you'll want to do is set up different user accounts for your different authors and then set yourself up as an administrator. Then when you go to publish a post using your administrator account you can select which author you want it ...


0

You need to run this code before any headers are sent to the client. Try segregating the login code. This question is almost a year old, so please let us know what, if anything worked.



Top 50 recent answers are included