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 | |
wp_oembed_add_provider( 'http://instagram.com/p/*', 'http://api.instagram.com/oembed' ); | |
add_shortcode( 'instagram', 'shortcode_instagram' ); | |
function shortcode_instagram( $atts ) { | |
global $wp_embed; | |
return $wp_embed->shortcode( $atts, $atts['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 | |
$items = implode( | |
', ', | |
array_merge( | |
wp_list_pluck( (array) get_the_tags(), 'name' ), | |
wp_list_pluck( (array) get_the_category(), 'slug' ) | |
) | |
); | |
if ( $items ) { |
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 | |
* Description: Applies a watermark image of your choosing to all uploaded images. | |
* Author: Alex Mills | |
* Author URI: http://automattic.com/ | |
*/ | |
class WPcom_Watermark_Uploads { |
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 Tests_WP_Query_Date_Base extends WP_UnitTestCase { | |
public $q; | |
public function setUp() { | |
parent::setUp(); | |
// Be careful modifying this. Tests are coded to expect this exact sample data. |
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 | |
require_once( 'wp-load.php' ); | |
$data = array( | |
'posts' => wp_count_posts( 'post' )->publish, | |
'pages' => wp_count_posts( 'page' )->publish, | |
'categories' => wp_count_terms( 'category' ), | |
'tags' => wp_count_terms( 'post_tag' ), | |
'comments' => wp_count_comments()->approved, |
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: Sticky Custom Post Types | |
Plugin URI: http://superann.com/sticky-custom-post-types/ | |
Description: Enables support for sticky custom post types. Set options in Settings → Reading. | |
Version: 1.2.2 | |
Author: Ann Oyama | |
Author URI: http://superann.com | |
License: GPL2 |
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: Sticky Custom Post Types | |
Plugin URI: http://superann.com/sticky-custom-post-types/ | |
Description: Enables support for sticky custom post types. Set options in Settings → Reading. | |
Version: 1.2.2 | |
Author: Ann Oyama | |
Author URI: http://superann.com | |
License: GPL2 |
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: Custom Post Password Cookie Expiry Time | |
Description: WordPress doesn't allow you to customize how long a post password cookie lasts. This plugin allows you to customize that value; | |
Version: 1.0.0 | |
Author: Alex Mills (Viper007Bond) | |
Author URI: http://www.viper007bond.com/ |
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: Generate Thumbnails On The Fly | |
Description: When a thumbnail image is requested of a specific width/height (rather than by name), generate it if it doesn't exist. | |
Version: 1.0.0 | |
Author: Alex Mills (Viper007Bond) | |
Author URI: http://www.viper007bond.com/ |
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 sunset_has_gravatar( $email ) { | |
$hash = md5( strtolower( trim( $email ) ) ); | |
// If not in the cache, check again | |
if ( false === $has_gravatar = wp_cache_get( $hash, 'sunset_has_gravatar' ) ) { | |
$request = wp_remote_head( 'http://0.gravatar.com/avatar/' . $hash . '?d=404' ); |