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
Works when plugged in to custom reusable metaboxes by TammyHart | |
This code takes the values of THREE input fields and saves them as one meta option value. This works particularly well for time inputs where the user enters the hour, minute, and am/pm and you want to store a unix timestamp OR a 24 hour time stamp | |
// settings for grouped input fields | |
array( | |
'label'=> 'Start Time', | |
'desc' => '', | |
'id' => $prefix.'startselect', | |
'type' => 'timegroup', | |
'options' => array( |
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
/** | |
* override output of author drop down to include ALL user roles | |
*/ | |
add_filter('wp_dropdown_users', 'include_all_users'); | |
function include_all_users($output) | |
{ | |
//set the $post global for checking user against author | |
global $post; | |
$users = get_users(); |
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 | |
//Custom Slider | |
function theme_kmca_teaser_slider($atts, $content) | |
{ | |
extract(shortcode_atts(array( | |
"class" => "", | |
"color" => "", | |
"type" => "", | |
"title" => "", | |
"subtitle" => "", |
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
class Custom_Widget_Pods_Testimonials extends WP_Widget { | |
public function __construct() { | |
$widget_ops = array('classname' => 'widget_pods_testimonials', 'description' => __( "Featured Testimonials.") ); | |
parent::__construct('pods_testimonials', __('Featured Testimonials'), $widget_ops); | |
$this->alt_option_name = 'widget_pods_testimonials'; | |
add_action( 'save_post', array($this, 'flush_widget_cache') ); | |
add_action( 'deleted_post', array($this, 'flush_widget_cache') ); | |
add_action( 'switch_theme', array($this, 'flush_widget_cache') ); | |
} |
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
var $messages = jQuery('#error-message-wrapper'); | |
jQuery.validate({ | |
form : '#eventsubmission', | |
modules : ' security', | |
onError : function() { | |
/*put fail message here */ | |
}, | |
modules : 'file', | |
decimalSeparator : '.' | |
}); |
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
<h1 class="day">Monday</h1> | |
<span class="weekdate">February 16th</span> | |
<article class="h-events"> | |
<span class="time dt-start" title="2015-01-15">12:00AM</span> | |
<h1 class="entry-title p-name"><a href="/events/play-at-alive-5/" rel="bookmark"> PLAY AT ALIVE @ 5</a></h1> | |
<span class="location p-location"><a href="http://localhost:8888/gdiary/location/wilton/" rel="tag">Wilton</a> </span> | |
<article> | |
<article class="h-events"> | |
<span class="time dt-start" title="2015-01-15">12:00AM</span> |
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
//this collects my errors | |
if(!$user) { | |
// if the user name doesn't exist | |
csc_errors()->add('empty_username', __('Invalid username'), 'login'); | |
} | |
if(!isset($_POST['csc_user_pass']) || $_POST['csc_user_pass'] == '') { | |
// if no password was entered | |
csc_errors()->add('empty_password', __('Please enter a password'), 'login'); | |
} |
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
//each call to the function has the form type in the function params | |
csc_show_error_messages('reg'); | |
csc_show_error_messages('login'); | |
csc_show_error_messages('forgot'); | |
//set $form_type as the param | |
function csc_show_error_messages($form_type) { | |
//how do I make it so that the errors only output on the function call that has the proper form type | |
if($codes = csc_errors()->get_error_codes()) { |
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 csc_forgot_password(){ | |
$username = trim($_POST['csc_forgot_login']); | |
$user_exists = false; | |
// First check by username | |
if ( username_exists( $username ) ){ | |
$user_exists = true; | |
$user = get_user_by('login', $username); | |
} | |
elseif(!username_exists($username)) { | |
// invalid username |
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
$prefix = 'custom_'; | |
$custom_meta_fields = array( | |
array( | |
'label' => 'Multi-Day', | |
'desc' => '', | |
'id' => $prefix.'multiday', | |
'type' => 'checkbox' | |
), | |
array( | |
'label' => 'Recurring', |