Skip to content

Instantly share code, notes, and snippets.

<?php
/**
*
* ----------------------------------------------
* HTML to JSON
* ----------------------------------------------
*
* [Currently used in Wordpress to output HTML into a Google Maps InfoWindow correctly]
*
/**
*Navigation overrides
*/
.navbar a.btn-warning.pull-left {
margin-top: 18px;
}
.navbar .nav {
margin-top: 14px;
<?php
/**
* WordPress WP_User_Query Comprehensive Reference
* Compiled by wpsmith - wpsmith.net
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_User_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/user.php
*/
$args = array(

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # 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
/**
* 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)) {
/**
* 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
<?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/
*/
<?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'],
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