This file contains 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
#!/bin/env python | |
import os | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-q", "--quiet", dest="verbose", action="store_false", default=True, help="don't print status messages to stdout.") | |
parser.add_option("-p", "--path", dest="path", type="string", default="/Users/tballard/Sites/csod", help="The path to run the inspection on.") | |
parser.add_option("-t", "--text", dest="text", type="string", default="", help="The string to search for. Only 1 string at a time.") | |
parser.add_option("-o", "--output-file", dest="output_file", type="string", default="csodfind-report.txt", help="the output file to save to. default is non-us-report.txt") |
This file contains 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 | |
$total = 3270; | |
$perPage = 20; | |
$curPage = isset( $_REQUEST['page'] ) && ! empty( $_REQUEST['page'] ) ? intval( $_REQUEST['page'] ) : 1; | |
// set start position | |
$start = (($curPage * $perPage) - $perPage) + 1; | |
if( $start === 0 ) $start = 1; |
This file contains 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
<li class="testimonial"> | |
<div class="testimonial-gravatar">{{ gravatar }}</div> | |
<div class="testimonial-data"> | |
<p class="testimonial-content">{{ testimonial_excerpt }}</p> | |
<p class="testimonial-author">{{ author_prefix }}{{ author }}</p> | |
{% if company_url %} | |
<p class="testimonial-company"><a href="{{ company_url }}">{{ company_name }}</a></p> | |
{% endif %} | |
</div> | |
<div class="clear"></div> |
This file contains 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 | |
add_action( 'tbt_template_functions', 'add_tags_to_tbt' ); | |
/** | |
* add custom template tags to tbtestimonials plugin | |
* | |
* @param mixed $t - twig instance | |
*/ | |
function add_tags_to_tbt( $t ) |
This file contains 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: TBTestimonials Single Testimonial Widget | |
* author: Travis Ballard | |
* author uri: http://travisballard.com | |
* version: 1.0 | |
* description: Adds a slimmed down TBTestimonials widget that allows you to select a single testimonial | |
*/ | |
class TBTestimonialsSingleTestimonialWidget extends WP_Widget |
This file contains 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 | |
/** | |
* add discount to logged in users based on available capabilities | |
* | |
* @param mixed $cart | |
*/ | |
function vpm_apply_discount( $cart ) | |
{ | |
if( ! is_user_logged_in() ){ |
This file contains 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 | |
/** | |
* add meta box | |
* | |
*/ | |
add_action( 'add_meta_boxes', 'add_testimonial_location_metabox' ); | |
function add_testimonial_location_metabox() | |
{ | |
global $tbtestimonials; |
This file contains 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 | |
add_filter( 'tbtestimonials_shortcode', 'change_tbtestimonials_shortcode'); | |
function change_tbtestimonials_shortcode(){ | |
return 'tbtestimonial'; | |
} |
This file contains 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 | |
add_filter( 'test_shortcode_filter', 'change_test_shortcode'); | |
function change_test_shortcode(){ | |
return 'fooshortcode'; | |
} |
This file contains 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: test shortcode filter | |
* author: travis ballard | |
*/ | |
class ShortcodeFilter | |
{ | |
public $shortcode = 'testshortcode'; |
NewerOlder