This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Force update our username (user_login) | |
| global $wpdb; | |
| $tablename = $wpdb->prefix . "users"; | |
| // method 1 | |
| //$sql = $wpdb->prepare("UPDATE %s SET user_login=%s WHERE ID=%d", $tablename, $user_email, $user_id); | |
| //$wpdb->query($sql); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Force update our username (user_login) | |
| global $wpdb; | |
| $tablename = $wpdb->prefix . "users"; | |
| // method 1 | |
| //$sql = $wpdb->prepare("UPDATE %s SET user_login=%s WHERE ID=%d", $tablename, $user_email, $user_id); | |
| //$wpdb->query($sql); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| register_activation_hook( __FILE__, 'add_last_activity_for_all_users' ); | |
| function add_last_activity_for_all_users() { | |
| global $wpdb; | |
| $sql = $wpdb->prepare( " | |
| SELECT | |
| u.ID | |
| FROM | |
| $wpdb->users AS u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //How to edit a user profile on the front end? | |
| //http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end | |
| //Forcing nickname as display_name in custom edit profile template | |
| //http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template | |
| /////// | |
| <?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Processing Section | |
| global $current_user, $wp_roles; | |
| get_currentuserinfo(); | |
| /* Load the registration file. */ | |
| require_once( ABSPATH . WPINC . '/registration.php' ); | |
| /* If profile was saved, update profile. */ | |
| if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| global $current_user; | |
| get_currentuserinfo(); | |
| echo 'Username: ' . $current_user->user_login . "\n"; | |
| echo '<br />'; | |
| echo 'User first name: ' . $current_user->user_firstname . "\n"; | |
| echo '<br />'; | |
| echo 'User last name: ' . $current_user->user_lastname . "\n"; | |
| echo '<br />'; | |
| echo 'User display name: ' . $current_user->display_name . "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function sce_create_page($user_id){ | |
| $the_user = get_userdata($user_id);; | |
| $new_user_name = $the_user->user_login; | |
| $my_post = array(); | |
| $cat_name = wp_create_category('premium'); | |
| $my_post['post_title'] = $new_user_name . $cat_name; | |
| $my_post['post_type'] = 'post'; | |
| $my_post['post_content'] = ''; | |
| $my_post['post_status'] = 'publish'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Mingle - Users - Online (example) | |
| Description: Requires WP-UserOnline to be installed | |
| */ | |
| function mingle_linked_names( $name, $user ) { | |
| if ( !$user->user_id ) { | |
| return $name; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function getTweets($hash_tag) { | |
| $url = 'http://search.twitter.com/search.atom?q='.urlencode($hash_tag) ; | |
| echo "<p>Connecting to <strong>$url</strong> ...</p>"; | |
| $ch = curl_init($url); | |
| curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE); | |
| $xml = curl_exec ($ch); | |
| curl_close ($ch); |