# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
| /** | |
| * mm_register function. | |
| * Register a new user. | |
| * @access public | |
| * @return User errors or user is logged in. | |
| */ | |
| function mm_register() { | |
| if(!is_user_logged_in()) { | |
| if(!empty($_POST)) { |
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
| /** | |
| * mm_sign_in function. | |
| * Sign the user in | |
| * @access public | |
| * @return User errors or true if successful signon | |
| */ | |
| function mm_sign_in() { | |
| if(!is_user_logged_in()) { | |
| if(!empty($_POST)) { | |
| // verify nonce |
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: Custom Login Error | |
| Plugin URI: http://www.thoughtrefinery.com/ | |
| Description: Customize error messages on login form | |
| Version: 0.1 | |
| Author: Nick Ciske | Thought Refinery | |
| Author URI: http://www.thoughtrefinery.com/ | |
| */ |
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 $user_identity; | |
| //$user_submissions = get_posts(); | |
| if ($user = wp_get_current_user()) { | |
| $author = array('id' => $user->ID); | |
| } else { | |
| $commenter = wp_get_current_commenter(); | |
| $author = array( | |
| 'author' => $commenter['comment_author'], |
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
| function wp_welcome_panel() { | |
| global $wp_version; | |
| if ( ! current_user_can( 'edit_theme_options' ) ) | |
| return; | |
| $classes = 'welcome-panel'; | |
| $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); | |
| // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner |
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 | |
| if (isset($_POST['day'])) | |
| { | |
| foreach ($_POST['day'] as $selectedDay) | |
| $selected[$selectedDay] = "checked"; | |
| } | |
| ?> | |
| <form action="" method="post"> | |
| <input type="checkbox" name="day[]" <?php echo $selected['monday'] ?> value="monday" />monday<br /> |
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 |