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 | |
/** | |
* Google Contacts Syncer | |
* by Alex Mills (http://www.viper007bond.com/) | |
* | |
* This script copies all contacts from Google account A to | |
* Google account B, wiping out all existing contacts in | |
* account B's account in the process. | |
* |
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: WordPress.com Watermark Image Uploads | |
* Author: Alex Mills | |
* Author URI: http://automattic.com/ | |
*/ | |
class WPcom_Watermark_Uploads { | |
public $watermark; |
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 Your_Media_List_Table extends WP_Media_List_Table { | |
/* some stuff here */ | |
// Adds a WHERE modify filter, calls parent version of prepare_items(), then removes filter | |
function prepare_items() { | |
add_filter( 'posts_where', array( &$this, 'modify_post_status_to_private' ) ); |
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 | |
# See bigdawggi's comment below for a good combined example | |
// Pre-3.3 | |
function cf_google_search_kill_wp_search( $where, $query ) { | |
global $wp_the_query; | |
if( ! is_admin() && $query->is_search() && $query === $wp_the_query ) { | |
$where = ' AND 1=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 | |
add_action( 'pre_get_posts', 'oomskaap_price_range_limiter' ); | |
function oomskaap_price_range_limiter( $query ) { | |
// Only do something if both the start and end values are set in the URL | |
if ( empty( $_GET['pricestart'] ) || empty( $_GET['priceend'] ) ) | |
return; | |
// Only modify the main query |
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 | |
/** | |
* Fetching all posts from the database would suck up a lot of memory. | |
* So instead this code processes 25 posts at a time. | |
*/ | |
$posts_at_a_time = 25; | |
$query_args = 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
// File Settings - User | |
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"font_face": "Consolas", // Windows, you'll likely want default or something else | |
"font_size": 10, | |
//"spell_check": true, |
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 | |
# Stick this file in your wp-content folder | |
define( 'WP_INSTALLING', true ); | |
require_once( dirname( __FILE__ ) . '/../wp-load.php' ); | |
timer_start(); | |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
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 | |
/** | |
* Takes posts that are in category A and also adds them to category B | |
*/ | |
// Uncomment this to proceed | |
exit( "You need to edit the file and enter the hostname and category IDs.\n" ); | |
// What blog? Asking for both for safety reasons. |
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( 'pre_get_posts', 'localtv_posts_and_pages_for_search' ); | |
function localtv_posts_and_pages_for_search( $query ) { | |
if ( $query->is_main_query() && $query->is_search() ) | |
$query->set( 'post_type', array( 'post', 'page' ) ); | |
} |
OlderNewer