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: Doejo NDN Shortcode | |
Description: Simple NDN Shortcode | |
Author: Rinat Khaziev, doejo | |
Version: 0.7.5 | |
Author URI: http://digitallyconscious.com | |
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/> |
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
{ | |
"suggest": { | |
"text": keyword, | |
"title-suggest": { | |
"term": { "field": "title" }, | |
"size": 3 | |
}, | |
} |
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 | |
/** | |
* ES Query args filter | |
*/ | |
add_filter( 'wpcom_elasticsearch_query_args', function( $args, $query ) { | |
// Modify sort query | |
$args['sort'] = array( | |
array( | |
'modified' => array( "order" => 'desc' ), | |
), |
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( 'acm_ad_tag_ids', 'my_acm_ad_tag_ids' ); | |
function my_acm_ad_tag_ids( $tag_ids ) { | |
$tag_ids[] = array( | |
'tag' => 'flex-leaderboard', // tag_id | |
'url_vars' => array( | |
'sizes' => array( | |
array( | |
'width' => '728', | |
'height' => '90' |
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 | |
/** | |
* Filter to put a placeholder in, when there's no thumbnail set for post (which is the case for a lot of legacy posts) | |
*/ | |
add_filter( 'post_thumbnail_html', function( $html, $post_id, $post_thumbnail_id, $size, $attr ) { | |
// We have a thumb, return it | |
if ( $html ) | |
return $html; | |
$placeholder_url = 'http://full.url.to/placeholder_image'; |
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 | |
// Whitelist default double click url | |
add_filter( 'acm_whitelisted_script_urls', 'rk_acm_whiltelisted_script_urls'); | |
function rk_acm_whiltelisted_script_urls( $whitelisted_urls ) { | |
$whitelisted_urls = array( 'ad.doubleclick.net' ); | |
return $whitelisted_urls; | |
} | |
// Tokenize url | |
add_filter( 'acm_default_url', 'rk_acm_default_url' ) ; |
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 | |
/** Use it as [google-cse id="your-google-cse-id"] | |
* Might need a little tweaking | |
*/ | |
add_shortcode( 'google-cse', 'localtv_google_cse_shortcode' ); | |
function localtv_google_cse_shortcode( $atts ) { | |
extract( | |
shortcode_atts( | |
array( |
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 | |
/** | |
* Easily get post meta value for Custom Metaboxes and Fields plugin | |
* | |
* @see https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress | |
* | |
* @param string $key to retrieve | |
* @param bool $echo if true then echo value | |
* @param string $sanitize_callback sanitize value with this callback | |
* @param string $cmb_prefix prefix of post meta |
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 | |
/** | |
* Additional setup for our freshly baked Ad Code Manager v0.2 | |
* Not tested with v0.1 | |
* | |
* Quick config for DFP JS API | |
* | |
*/ | |
// Add additional output tokens |
OlderNewer