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
# Files are physically in `wp` subfolder but we'd like to serve requests / | |
# Goes inside server { } block | |
if (!-e $request_filename) { | |
# Add trailing slash to */wp-admin requests. | |
rewrite /wp-admin$ $scheme://$host$request_uri/ permanent; | |
# WordPress in a subdirectory rewrite rules | |
rewrite ^/([_0-9a-zA-Z-]+/)?(wp-.*|xmlrpc.php) /wp/$2 break; | |
} |
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 | |
/** | |
* List terms (categories) with the same name for each of the blog with a sticker. | |
* | |
* This is a one-off, but could be easily abstracted to be more versatile. | |
* | |
* @subcommand list-multiple-terms-with-the-same-name | |
* @synopsis [--taxonomy=<category>] | |
*/ | |
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( 'the_content', 'make_donald_drumpf_again', 666 ); | |
add_filter( 'the_title', 'make_donald_drumpf_again', 666 ); | |
add_filter( 'comment_text', 'make_donald_drumpf_again', 666 ); | |
function make_donald_drumpf_again( $content ) { | |
return str_replace( 'Trump', 'Drumpf', $content ); | |
} |
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 | |
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 | |
/** | |
* 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
{ | |
"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 | |
/* | |
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
<?php | |
class Doubleclick_For_Publishers_Async_ACM_Provider extends ACM_Provider { | |
public $crawler_user_agent = 'Mediapartners-Google'; | |
function filter_output_html( $output_html, $tag_id ) { | |
// .. omitted | |
$targeting_params_array = apply_filters( 'acm_targeting_params', array( 'kw' => 'testkeyword' ), $tag_id ); | |
$targeting_string = $this->format_targeting_string( $targeting_params_array ); |
NewerOlder