Tag Info

Hot answers tagged

3

You can add this to your functions.php file in your template to allow the user to edit pages that they have created. Just specify their $user_id (i.e. 27): //to add capability to $user_id $user = new WP_User( $user_id ); $user->add_cap( 'edit_pages' ); $user->add_cap( 'edit_published_pages' ); You can find a specific user's $user_id from the URL ...


2

The solution that we have gone with in the end uses a single call to get_user_meta passing just the $user_id - this way all user data is returned in a single query, reducing a heavy load on the DB during large user data exports. We then run a series of checks against the returned data - including: is_serialized( $value ) - to check if the data has been ...


2

You need to use the login_redirect filter returning the redirect location: add_filter( 'login_redirect', 'redirect_to_home', 10, 3 ); function redirect_to_home( $redirect_to, $request, $user ) { if( $user->ID == 6 ) { //If user ID is 6, redirect to home return get_home_url(); } else { //If user ID is not 6, leave ...


2

Not being able to find anything I finally went ahead and created the WordPress plugin Terms before download. From the plugin's description: Terms Before Download adds a shortcode that can be used instead of HTML anchors to link to downloadable files. If such a link is clicked a popup dialog shows terms and conditions (EULA) which must be accepted ...


1

You need to select either of option button: "Delete all content" or "Attribute all content to:" then "Confirm Deletion" button will get enabled. If you are not able to see the button itself then some plugin css must be hiding it. So please try deactivating plugins one by one and check if you can see the button.


1

Turns out that the correct key was icl_admin_language. I was able to drop the key from the "get_user_meta" function and then print_r the variable. This showed me all custom user meta which I could then sift through for my desired key.


1

use login_redirect hook instead login_form And you can move conditions inside your function like below code. function redirect_to_front_page() { global $redirect_to; if ( is_user_logged_in() ) { $user_id = get_current_user_id(); if ($user_id == 6) { /* redirect users to front page after login */ if ...



Only top voted, non community-wiki answers of a minimum length are eligible