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 | |
require_once dirname( __FILE__ ) . '/wp-load.php'; | |
//$existing_image = 'http://guidevoyage.org.dev' . '/wp-content/uploads/2010/12/122010_0314_LamdinadeSo1.png'; | |
//Locate the attachment post's ID in the database based on the GUID. | |
function getIDfromGUID( $full_image_url ){ | |
global $wpdb; |
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 | |
//Locate the attachment post's ID in the database based on the GUID. | |
function getIDfromGUID( $existing_image ){ | |
global $wpdb; | |
return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=attachment AND guid=%s", $existing_image ) ); | |
} | |
$existing_image = "http://guidevoyage.org.dev/wp-content/uploads/2012/02/Fontaine-de-Trevi.jpg"; |
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 | |
/** | |
* Notes and things that I changed: | |
* -- fixed indentation and spacing for WP standards | |
* -- posts_per_page = -1 is dangerous, what happens if the site has 1000000 posts, the server will explode - find a high but sane limit | |
*/ | |
// loop through the sub-pages of your custom post type | |
$childpages = new WP_Query( array( |
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 | |
// Hide Email from Spam Bots | |
function cwc_mail_shortcode( $atts , $content = null ) { | |
if ( ! is_email( $content ) ) | |
return; | |
for ( $i = 0; $i < strlen( $content ); $i++ ) | |
$encodedmail .= "&#" . ord( $content[$i] ) . ';'; | |
return '<a href="' . esc_url( 'mailto:' . $encodedmail ) . '">Email</a>'; |
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
.gist { | |
color: #e4322e; | |
} | |
.gistdiv { | |
padding: 0; | |
margin: 0; | |
} | |
.gist .gist-file { |
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 | |
if ( !defined( 'MEDIAWIKI' ) ) { | |
die( 'This file is a MediaWiki extension, it is not a valid entry point' ); | |
} | |
$wgExtensionCredits['other'][] = array( | |
'path' => __FILE__, | |
'name' => 'Google Analytics Integration', | |
'version' => '2.0.2', | |
'author' => 'Tim Laqua', |
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: Optimizely | |
Description: Runs Optimizely experiments. | |
Author: koop, evansolomon | |
Version: 0.2 | |
*/ | |
class WPCOM_Optimizely { | |
public $version; |