Adding more fields to the add user page on dashboard
Check the Advanced Custom Field Plugin. Very powerfull tool that let’s you add custom fields anywhere and use them in the way you wish.
Check the Advanced Custom Field Plugin. Very powerfull tool that let’s you add custom fields anywhere and use them in the way you wish.
You need to use the global variable for the user ID (if you actually need to use it) somewhat like this: global $user_ID; get_currentuserinfo(); The get_currentuserinfo() call will populate the global $user_ID variable which you can then use directly, as you have it in your args currently. Reference
Curly braces for foreach is missing. Try this: /* Template Name: Directory */ add_action( ‘genesis_entry_content’, ‘ogs_directory’, 5 ); function ogs_directory() { $args = array( ‘blog_id’ => 1, // unless yours is a multisite install, you shouldn’t need to change this ‘exclude’ => array(), // IDs of users that need to be excluded ‘orderby’ => ‘display_name’ … Read more
I’ve just done something like this and it’s fairly simple add_filter(‘wp_nav_menu_items’, ‘add_login_logout_link’, 10, 2); function add_login_logout_link($items, $args) { //check if user is logged in, and add user name to menu if (is_user_logged_in()){ $user = wp_get_current_user(); $items .= ‘<li>’ . $user->display_name . ‘</li>’; } //add login/logout link to menu $items .= ‘<li>’. wp_loginout(get_permalink(),false) .'</li>’; return $items; … Read more
I found that the answer was not found in my query, as it is correct. I was not passing variables to the query properly. From my research, there is no constraint on the number of custom meta queries you can place in one query.
First of all, you’re testing for a string, as you’re wrapping the_field(“my_field”) in single quotes. So, you want to remove these quotes. Next, the_field(“my_field”) outputs a field, it doesn’t return it. You should try get_field instead of the_field.
Use ‘show_option_none’ argument for this. wp_dropdown_users( array(‘show_option_none’ => __(‘No user selected’) ) );
To get post meta fields, you can use get_post_meta() function, but obviously not get_user_meta(), the name of the functions are self-explanatory. The first parameter of get_post_meta() function is the post ID; here you define which post you want to get postmeta from. So, you need to get frist the post ID of the post you … Read more
For this, you have to use user_register hook defined on wp-includes/users.php line 1759. personal_options_update hook is called, when an user updating his own profile. edit_user_profile_update is called, when an administrator updating other user profile. nothing is called, when an administrator creating a new user. On user-new.php page, new user are created using the edit_user function, … Read more
Well, it’s not going to work because you won’t always have the post value on each page (only when they have just logged in). So as soon as wp serves up the next page it won’t have a the POST variable anymore. Why do you feel a need to do this? (Personally I cannot think … Read more