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 | |
// return a value from the options table if it exists, | |
// or return a default value | |
my_plugin_get_option($key) { | |
$defaults = array( | |
'foo' => 'some string', | |
'bar' => true, | |
'baz' => 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
@media only screen and (min-width: 1009px) { | |
/* let's try a larger right-side gutter in desktop view */ | |
.entry-content { | |
margin-right: 30px; | |
width: 480px; | |
} | |
/* except for gallery posts */ | |
.format-gallery .entry-content { | |
margin-right: 0; | |
width: 510px; |
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 | |
# | |
# Script to deploy from Github to WordPress.org Plugin Repository | |
#prompt for plugin slug | |
echo -e "Plugin Slug: \c" | |
read PLUGINSLUG | |
# main config, set off of plugin slug | |
CURRENTDIR=`pwd` |
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 | |
foreach (file('/tweet-ids.txt') as $tweet_id) { | |
$tweet_id = trim($tweet_id); | |
$url = home_url('index.php').'?'.http_build_query(array( | |
'aktt_action' => 'import_tweet', | |
'tweet_id' => $tweet_id, | |
'social_api_key' => Social::option('system_cron_api_key') | |
), null, '&'); | |
// error_log('Importing tweet '.$tweet_id.' '.$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 | |
// check for a term and insert it if it doesn't exist | |
if (!get_term_by('slug', $term_slug, $taxonomy)) { | |
wp_insert_term(__($term_name, 'localization-key'), $taxonomy, array( | |
'slug' => $term_slug | |
)); | |
} |
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 | |
/** | |
* @group post | |
* @group slashes | |
*/ | |
class Tests_Post_Slashes extends WP_UnitTestCase { | |
function setUp() { | |
parent::setUp(); | |
$this->author_id = $this->factory->user->create( array( 'role' => 'editor' ) ); |
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 | |
/** | |
* @group meta | |
* @group slashes | |
* @ticket 21767 | |
*/ | |
class Tests_Meta_Slashes extends WP_UnitTestCase { | |
function setUp() { | |
parent::setUp(); |
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 | |
/** | |
* @group comment | |
* @group slashes | |
*/ | |
class Tests_Comment_Slashes extends WP_UnitTestCase { | |
function setUp() { | |
parent::setUp(); | |
// we need an admin user to bypass comment flood protection |
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
$thumbnails = get_theme_support('post-thumbnails'); | |
if (is_array($thumbnails)) { | |
add_theme_support('post-thumbnails', array_merge($thumbnails[0], array(self::$post_type))); | |
} | |
else if (!$thumbnails) { | |
add_theme_support('post-thumbnails', array(self::$post_type)); | |
} | |
// else already enabled for all post types |