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
| //first you need to get the current author of the page | |
| if(isset($_GET['author_name'])) : | |
| $curauth = get_userdatabylogin($author_name); | |
| else : | |
| $curauth = get_userdata(intval($author)); | |
| endif; | |
| //then your condition | |
| if(!empty($curauth->website)){ | |
| //shows the website |
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); |
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 getDistanceBetweenPointsNew($latitude1, $longitude1, $latitude2, $longitude2) { | |
| $theta = $longitude1 - $longitude2; | |
| $miles = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta))); | |
| $miles = acos($miles); | |
| $miles = rad2deg($miles); | |
| $miles = $miles * 60 * 1.1515; | |
| $feet = $miles * 5280; | |
| $yards = $feet / 3; |
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 my_copyright_meta() { | |
| if(is_singular()){ | |
| echo "<meta name="copyright" content="© Me, 2011">"; | |
| } | |
| } | |
| add_action("wp_head", "my_copyright_meta"); | |
| ?> |