Getting $curauth->ID to work inside a shortcode
/wp-admin/user-edit.php starting on line 99. Just check the hooks and filters there and how $profileuser get’s called. (Pay attention on the switch.) 🙂
/wp-admin/user-edit.php starting on line 99. Just check the hooks and filters there and how $profileuser get’s called. (Pay attention on the switch.) 🙂
For a quick solution put this code in functions.php of your theme: add_action( ‘show_user_profile’, ‘show_extra_profile_fields’, 10 ); add_action( ‘edit_user_profile’, ‘show_extra_profile_fields’, 10 ); function show_extra_profile_fields( $user ) { ?> <input type=”text” name=”twitter” value=”<?php echo esc_attr( get_the_author_meta( ‘twitter’, $user->ID ) ); ?>” /> <?php } Or you could do it with a plugin: http://www.cozmoslabs.com/wordpress-profile-builder/
You’ll have to install the entire plugin, but you can turn off the portions you don’t want to use. I’ve done that with one my sites and the users just have extended profiles.
Try Justin Tadlock’s members plug-in. You can then create custom roles per user in the Users/Roles/Add New section of the WP-Admin Area. Once the role is created, you can add custom capabilities. I’ve never tried the email option you’ve mentioned, but it’s possible. If you go this route I’ll try to help you figure it … Read more
You could register a user_meta field (probably a dropdown) and use that to select templates. You will still need to use if statements to differentiate the templates, but you’re going to need that regardless of the route you take. If you use get_template_part() you can split out the actual html and such of it and … Read more
To be able to do both – i.e. add something to the registration form AND have it editable from the admin side, you need to do 2 things. The first, is add extra user meta (so you can see them from the admin side) and the second is to create a new registration template which … Read more
<input type=”text” name=”facility” id=”facility” value=”<?php echo esc_attr( get_the_author_meta( ‘facility’, $user->ID ) ); ?>” <?php if (!is_admin()) { echo ‘disabled=”disabled”‘; } class=”regular-text” /><br /> <span class=”description”><?php _e(“Please enter the facility name.”); ?></span> Add this third line to all your inputs that you don’t want the non-admins to edit.
It looks like you have the function both in bp-custom.php and in your plugin. You don’t need a plugin. Put your code in plugins/bp-custom.php only. Or in your-theme/functions.php
You can use the WPDB class to instantiate an external DB. Looks like roughly this: define(‘EXT_DB_USER’, ‘username’); define(‘EXT_DB_PASSWORD’, ‘password’); define(‘EXT_DB_NAME’, ‘ext_data’ ); define(‘EXT_DB_HOST’, ‘123.123.123.123:3307′); $wpdb_ext = new wpdb(EXT_DB_USER, EXT_DB_PASSWORD, EXT_DB_NAME, EXT_DB_HOST); then you just call $wpdb_ext with normal WP functions just like you would #wpdb. For log in info it’s usually easiest to sync login … Read more
According to the README_OFFICIAL.txt plugin file, you can use the get_cimyFieldValue() plugin function to retrieve user fields. In your case, on the author page, assuming you have named the field gender the PHP needed to get the gender for the current author page is: $gender = get_cimyFieldValue( get_query_var( ‘author’ ), ‘gender’ ); Please send me … Read more