How to add a user profile page to frontend?
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]
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]
s_ha_dum’s answer prompted me to look into this a little further. I checked the users in the database. It turns out that the dropdown list in Posts -> Edit is using the Display Name, not the User Login, as I had expected. So, the problem was not that WordPress was functioning incorrectly, but that my … Read more
No, there isn’t. WordPress login “sessions” are cookie-based and work on each device as if they were the only one in existence.
Many plugins (and themes) use user levels, you shouldn’t use them in yours. They are still used in WordPress probably to offer backward compatibility with the huge number of plugins and themes that use them. WPCS will throw a warning whenever it busts user levels in code.
In a nutshell, if a client (in the technical sense) has valid username and password then it can provide it to the WP installation to be checked and be placed in a “privileged” context for all the code to run. Being web app, native WP authentication is mostly browser/cookie centric. So for a mobile app … Read more
You could use user_can( $user_id, ‘manage_options’ ) to gauge the ids in the users array and unset($users->[$x]) the appropriate row. I would personally use $users = array(); foreach ($results as $user) if (!user_can( $user->ID, ‘manage_options’ )) $users[] = $user; But that’s just me.
Part 1 Create wpse_admin_user.css file and put it in your current theme, where style.css is: tr.user-admin-color-wrap, tr.user-admin-bar-front-wrap { display: none; } Add this code to your theme’s functions.php: function wpse_user_admin_script() { wp_register_style( ‘wpse_admin_user_css’, get_stylesheet_directory_uri() . ‘/wpse_admin_user.css’ ); wp_enqueue_style( ‘wpse_admin_user_css’ ); } add_action( ‘admin_enqueue_scripts’, ‘wpse_user_admin_script’ ); Part 2 Install and activate Custom User Profile Photo plugin. … Read more
It is not a good practice to add/remove columns to/from the core tables in WordPress. There is no guarantee that the very next update doesn’t change this table’s behavior, or even overwrite your column. Your best approach is to use metadata as you mentioned. But, if you need to do this for some reason, you … Read more
Unfortunately there is no hook available to modify the HTML for the description field on the edit user page. The output is hard-coded. One workaround is to use CSS to set a minimum height for the text area. I think this is the best approach. add_action( ‘admin_print_styles-profile.php’, ‘wpse_user_description_css’ ); add_action( ‘admin_print_styles-user-edit.php’, ‘wpse_user_description_css’ ); function wpse_user_description_css() … Read more
There is a global variable containing the current page in the admin area, called $pagenow. You can use this to detect where the user is now. Now, in your case, you are on admin.php and there are 3 parameters set in the URL, page, delete and id. So: if( in_array( $pagenow, array(‘admin.php’) ) && ( … Read more