How to disable users changing their display_name?

You can use jQuery to disable the display name select. function disable_display_name() { global $pagenow; if ( $pagenow == ‘profile.php’ ) { ?> <script> jQuery( document ).ready(function() { jQuery(‘#display_name’).prop(‘disabled’, ‘disabled’); }); </script> <?php } } add_action( ‘admin_head’, ‘disable_display_name’, 15 );

Get the author registration date in the header.php file

If you are using this on author pages or in loop then you can simply use this. echo the_author_meta( ‘user_registered’ ); This will output registration date of author. So your function will become. if ( is_author() ) { $curauth = ( isset($_GET[‘author_name’]) ) ? get_user_by( ‘slug’, $author_name ) : get_userdata( intval($author) ); $date = the_author_meta( … Read more

How to get only 1 role from user

Try this: if ( !empty( $user->roles ) && is_array( $user->roles ) ) { $first_role = array_shift($user->roles); echo $first_role; } Function array_shift obtains the first element of the $user->roles array.

Not able to call value in the core files

You’r following an bad idea. What you would like to reallize is, displaying a few profiles, not all. It doesn’t matter if the role is named “king” or “queen” even if your specific roles called so. There is an better way to reallize such Kind of requirements: Capabilities. Add an capabilitie to WordPress and just … Read more

admin ajax is not working for non logged in users

There are some “magic” request parameters that are better avoided, mostly anything that can be used as a parameter name at a request url but also some more like “email” (don’t think it is well documented and a quick google failed to bring a good reference). Try to change the names of your parameters especially … Read more

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