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 | |
add_filter( 'request', 'my_request' ); | |
function my_request( $request ) { | |
$request['tag'] = 'my-tag-slug'; | |
return $request; | |
} |
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 | |
/** | |
* Plugin Name: Language Redirect | |
*/ | |
add_action( 'init', 'language_redirect_init' ) { | |
// Map language to blog id | |
$sites = array( | |
'default' => 1, | |
'en' => 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 | |
/** | |
* Plugin Name: My Plugin | |
* Plugin Description: Settings API Demo | |
*/ | |
add_action( 'admin_menu', 'my_admin_menu' ); | |
function my_admin_menu() { | |
add_options_page( 'My Plugin', 'My Plugin', 'manage_options', 'my-plugin', 'my_options_page' ); | |
} |
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 | |
/** | |
* Plugin Name: My Plugin | |
* Plugin Description: http://core.trac.wordpress.org/ticket/10702 | |
*/ | |
class My_Plugin_Test_10702 { | |
public $cycles = 1000; | |
function __construct() { |
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 | |
/** | |
* In theory should support the following subdir sites as port of a subdomain network: | |
* - subdomain.example.org/site1 | |
* - subdomain.example.org/site2 | |
*/ | |
function can_i_haz_subdomain_and_subdir() { | |
global $wpdb, $current_blog, $current_site, $blog_id, $site_id; | |
// Taken from ms-settings.php |
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 | |
/** | |
* Plugin Name: My Plugin 21689 | |
*/ | |
class My_Plugin_Test_21689 { | |
function __construct() { | |
add_action( 'init', array( $this, 'init' ) ); | |
} |
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 | |
/** | |
* Campaign Monitor Shortcode & Reversal | |
*/ | |
/** | |
* Embed Reversal | |
* | |
* Looks form a <form> that looks like a Campaign Monitor subscribe | |
* form during pre_kses, and converts it into a shortcode if possible. |
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 | |
/** | |
* Plugin Name: My Plugin | |
*/ | |
class My_Plugin_Test_AJAX_Scripts { | |
function __construct() { | |
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) ); | |
add_action( 'wp_head', array( $this, 'wp_head' ), 99 ); |
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
alert('foo!'); |
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
""" | |
I hate PayPal. When working with a full export it'll contain extra rows called | |
Shopping Cart Item. This script removes such rows and copies the Item Titles of | |
into the Item Title column of the original transaction row. | |
Usage: | |
# python paypal-combine-rows.py input_file.csv > output_file.csv | |
""" | |
import csv | |
import sys |