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: Test Plugin Update | |
Plugin URI: http://clark-technet.com | |
Description: Test plugin updates | |
Version: 0.9 | |
Author: Jeremy Clark | |
Author URI: http://clark-technet.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 | |
/** | |
* Stores a value and calls any existing function with this value. | |
*/ | |
class Filter_Storage | |
{ | |
/** | |
* Filled by __construct(). Used by __call(). | |
* | |
* @type mixed Any type you need. |
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 | |
/** | |
* Example of use. Create array with auth tokens from application created from https://dev.twitter.com/apps/new | |
* | |
*/ | |
$twitter_auth = array( | |
'consumer_key' => 'pHUfo9zXAtCVjXrsfaetatA', | |
'consumer_secret' => '0oddga08872ptXqajjpqld6iVbHziaBHKLTzdq1o18c', |
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: Helpful 404 Page | |
Plugin URI: http://clark-technet.com/ | |
Description: Displays helpful list of post/pages releated to the url on a 404 page. Simply edit 404 page and use echo helpful_404(). | |
Author: Jeremy Clark | |
Author URI: http://clark-technet.com | |
Version: 1.0 | |
Author URI: | |
*/ |
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
add_filter( 'infinite_scroll_credit', 'your_footer_text' ); | |
function your_footer_text() { | |
return '<a href="http://link_to_site">Credit Link</a>'; | |
} |
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
/** | |
* Front End Customizer | |
* | |
* WordPress 3.4 Required | |
* | |
* Search and replace theme_slug with your own theme slug. | |
* | |
*/ | |
add_action( 'customize_register', 'theme_slug_customizer_register' ); |
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
define( 'PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); | |
//Template fallback | |
add_filter( "template_include", 'ps_theme_redirect' ); | |
function ps_theme_redirect( $template ) { | |
//cpt is the slug of the custom post type registered | |
if ( get_post_type() == 'cpt' ) { | |
if ( is_single() ) { | |
//looks in the current theme directory for the template if so it is returned otherwise the template from the plugin directory is returned. |
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 | |
/** | |
* Simple twitter feed | |
* | |
* @param string $user user of twitter feed to retrieve. | |
* | |
* @return string of formatted API data | |
*/ | |
function twitter_followers($user = 'clarktechnet'){ |
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 | |
/** | |
* Simple WordPress Twitter feed | |
* | |
* | |
* @param string $user user of twitter feed to retrieve. | |
* @param string $count number of tweets to retrive. | |
* | |
* Inspiration for code: | |
* Chip Bennet's oenology theme https://github.com/chipbennett/oenology |
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 | |
$theme_data; | |
if (function_exists('wp_get_theme')){ | |
$theme_data = wp_get_theme('theme-name'); | |
$theme_uri = $theme_data->ThemeURI; | |
$author_uri = $theme_data->Author_URI; | |
} else { | |
$theme_data = (object) get_theme_data(get_template_directory() . '/style.css'); | |
$theme_uri = $theme_data->URI; | |
$author_uri = $theme_data->AuthorURI; |
NewerOlder