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 | |
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
#! /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
@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
<?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
<?php | |
// Run this code on 'after_theme_setup', when plugins have already been loaded. | |
add_action('after_setup_theme', 'my_load_plugin'); | |
// This function loads the plugin. | |
function my_load_plugin() { | |
// Check to see if your plugin has already been loaded. This can be done in several | |
// ways - here are a few examples: |
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 | |
/** | |
* Include a specific file based on directory and filename | |
* | |
* @param string $dir Directory the file will be in | |
* @param string $file Filename | |
* @param array $data pass in data to be extracted for use by the template | |
* | |
**/ | |
function cfct_template_file($dir, $file, $data = 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
<?php | |
/* | |
Plugin Name: Formats as Categories | |
Plugin URI: http://alexking.org/projects/wordpress | |
Description: Have enabled post formats show up as categories for selection via XML-RPC clients (iPhone, Android, etc.). | |
Version: 1.0dev | |
Author: Crowd Favorite | |
Author URI: http://crowdfavorite.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 | |
// Show full content (with links, blockquotes, etc.) for link format posts | |
// put this file in excerpt/format-link.php in your child theme. | |
cfct_template_file('content', 'format-link.php'); |