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 | |
class AllHipHop_Complex_Ads { | |
public function __construct() { | |
add_action( 'wp_head', array( $this, 'wp_head' ) ); | |
add_filter( 'acm_default_url', 'acm_default_url' ); | |
add_filter( 'acm_output_html', 'acm_output_html' ); | |
add_filter( 'acm_output_tokens', 'acm_output_tokens', 10, 3 ); | |
add_filter( 'acm_ad_tag_ids', 'acm_ad_tag_ids' ); |
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 | |
public function event_content_relationship_meta_box( $post ) { | |
wp_nonce_field( 'tc_event_relationship_noncename', 'tc_event_relationship_nonce' ); | |
$current_term = array(); | |
if ( $current_relationship = get_post_meta( $post->ID, '_tc_event_relationship', true ) ) { | |
if ( $event_type = get_the_terms( (int) $current_relationship, 'tc_event_type_taxonomy' ) ) | |
$current_term = get_term( $event_type[0]->term_id, 'tc_event_type_taxonomy' ); | |
} |
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 | |
public function save_post( $post_id, $post ) { | |
// don't update on autosave (all our post types currently use page-based permissions) | |
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) | |
return; | |
// static variable prevents infinite loop when calling menu order update | |
static $skip_me = false; | |
if ( $skip_me ) return; |
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 | |
class AllHipHop_Complex_Ads { | |
public function __construct() { | |
add_action( 'wp_head', array( $this, 'wp_head' ) ); | |
add_action( 'body_open', array( $this, 'body_open' ) ); | |
add_action( 'wp_foot', array( $this, 'wp_foot' ) ); | |
add_filter( 'acm_default_url', array( $this, 'acm_default_url' ) ); | |
add_filter( 'acm_output_html', array( $this, 'acm_output_html' ), 10, 2 ); |
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 | |
/** | |
* Complex Media Network Ad Provider for Ad Code manager | |
* | |
* @since 0.2.x | |
*/ | |
class Complex_Media_Network_ACM_Provider extends ACM_Provider { | |
function __construct() { | |
// Default output HTML | |
$this->output_html = '<!-- cmnUNT | Begin ad tag --><script type="text/javascript">cmnUNT(\'%size_type%\', tile_num++);</script><!-- cmnUNT | End ad tag -->'; |
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 plugin_trim_by_characters_with_html( $text, $length = 400, $append = ' …', $allowable_tags = '<b><em><a>' ) { | |
$length = (int) $length; | |
$text = trim( strip_tags( $text, $allowable_tags ) ); | |
$in_quote = false; | |
// if the length without tags is less than our target we are done | |
if ( strlen( strip_tags( $text ) ) <= $length ) | |
return $text; | |
// count forward to find the $length character in unstripped $text not counting tags | |
for ($i = 0, $j = 0, $l = strlen( $text ), $in_tag = false; $i < $l && ( $in_tag || $j < $length ); $i++) : | |
switch ( $text[$i] ) : |
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 | |
class Plugin_Config_Page { | |
function plugin_config() { // switch to construct | |
add_action( 'admin_init', array( $this, 'admin_init' ) ); | |
add_action( 'admin_menu', array( $this, 'admin_menu' ) ); | |
add_action( 'wp_ajax_plugin_refresh', array( $this, 'ajax_plugin_refresh' ) ); | |
add_action( 'wp_ajax_plugin_toggle_schedule', array( $this, 'ajax_plugin_toggle_schedule' ) ); | |
} |
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 | |
/** | |
* A small, quick class to make Custom Post Types and Taxonomies easier | |
*/ | |
class CPT_Builder { | |
static $plural = array( '/(quiz)$/i' => "$1zes", | |
'/^(ox)$/i' => "$1en", '/([m|l])ouse$/i' => "$1ice", | |
'/(matr|vert|ind)ix|ex$/i' => "$1ices", '/(x|ch|ss|sh)$/i' => "$1es", | |
'/([^aeiouy]|qu)y$/i' => "$1ies", '/(hive)$/i' => "$1s", |
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
/* bind to variable */ | |
jQuery(document).ready(function() { | |
// register a filter and override the functions | |
jQuery('body').bind('myTrig', function(event, obj) { | |
obj.valueOf=obj.toSource=obj.toString=function(){return "blue"}; | |
}); | |
// create a variable as an object and pass it to any filters that have been registered | |
var o = Object('green'); |
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_dashboard_setup() { | |
wp_add_dashboard_widget( 'plugin_analytics_link', 'Analytics Link', array($this, 'wp_add_dashboard_widget_callback' ), array($this, 'wp_add_dashboard_widget_control_callback' ) ); | |
} | |
function wp_add_dashboard_widget_callback() { | |
if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) | |
$widget_options = array(); | |
if ( !isset($widget_options['plugin_analytics_link']) ) | |
$widget_options['plugin_analytics_link'] = array( 'label' => '', 'link' => '' ); |
OlderNewer