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
### Keybase proof | |
I hereby claim: | |
* I am davekellam on github. | |
* I am davekellam (https://keybase.io/davekellam) on keybase. | |
* I have a public key whose fingerprint is A1D3 5AFC 79AD F7F7 AA8E E70A D7FE F2CA B372 1884 | |
To claim this, I am signing this object: |
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
-----BEGIN PGP MESSAGE----- | |
Version: Keybase OpenPGP v0.1.12 | |
Comment: https://keybase.io/crypto | |
wcFMA/ota0i80rHmAQ/+K8BN0jPlrfT5b0SVWyzUpJrIgIAKe/qO/TZoUkrquh6K | |
Wl4eAxTSJnix5n/bL+7rfJjQ0WNLJt79DfiS1QAMzZWMtW0OZotXuVx2GohcrMPM | |
9ZTjXmIjsjTvLQCs03y5qCKA4dWP8nq7iBLubgBVauhPndu60HgDW4Gd+ogJqFou | |
tZc2ugvdnusiaGROHndrRry2qfRAKg7ueEXZl0pAVQNE5eYkboM1TFoBMvValv/9 | |
8V/qA28fJBm8Rjjhe0qWG2eh5I2miC8wRZnGEoocsTobiwyd6HlcR5bx7N01Gt+a | |
er/wVHrNjqWjNnXY0Zac3zAvGdgzoeQ+RbKJLICiV9NZh8HB1uNeG6lSGnS+MhZ+ |
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 | |
/* | |
Script for converting a Yahoo Pipe's homepage URL into something more sensible | |
Requires cURL to be enabled | |
*/ | |
// CHANGE THESE VARIABLES | |
// In the link http://pipes.yahoo.com/pipes/pipe.run?_id=uCxBbzww3hGB9ClS6ycw5g&_render=php | |
// the pipe ID is uCxBbzww3hGB9ClS6ycw5g (everything after _id= and before &_render | |
$pipe_id = ''; |
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 | |
function remove_cssjs_ver( $src ) { | |
if( strpos( $src, '?ver=' ) ) | |
$src = remove_query_arg( 'ver', $src ); | |
return $src; | |
} | |
add_filter( 'style_loader_src', 'remove_cssjs_ver', 1000 ); | |
add_filter( 'script_loader_src', 'remove_cssjs_ver', 1000 ); |
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 | |
/** | |
* Save debug info to log | |
* | |
* @param int $post_id ID of the post to save | |
*/ | |
function dk_debug_save_post( $post_id ) { | |
global $wpdb; | |
error_log( print_r( $wpdb->queries, 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 | |
/** | |
* Modify Jetpack's Open Graph Output | |
*/ | |
function ef_og_tweaks( $tags ) { | |
if ( is_home() ) { | |
// Remove the blank image | |
unset( $tags['og:image'] ); | |
$ef_og_home_img = 'YOUR_IMAGE_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 | |
/** | |
* Generate a post title and slug from the content | |
*/ | |
function dk_generate_title_and_slug( $data ) { | |
if( 'post' == $data['post_type'] && empty( $data['post_title'] ) ) { | |
// Quick way to strip media (could do something like use media type to inform title) | |
$title = wp_trim_excerpt( $data['post_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
#!/bin/bash | |
FILES=/path/to/files/* | |
for file in $FILES | |
do | |
echo "Processing $file..." | |
wp import $file --authors=skip | |
done |