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 | |
| /** | |
| * Clear oEmbed Cache on save | |
| * this is necessary in order to update the oembed output | |
| */ | |
| function nh_clear_oembed_caches($post_id) { | |
| if ( wp_is_post_revision( $post_id ) ) return; | |
| global $wp_embed; | |
| $wp_embed->delete_oembed_caches($post_id); | |
| } |
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
| function nh_trim_post_titles($format) { | |
| return '%s'; | |
| } | |
| add_filter('protected_title_format', 'nh_trim_post_titles' ); | |
| add_filter('private_title_format', 'nh_trim_post_titles' ); |
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
| ;(function($) { | |
| $.fn.extend({ | |
| stickyWidget: function(options) { | |
| // Exit if there are no elements to avoid errors: | |
| if (this.length === 0) { | |
| return this; | |
| } | |
| var settings = $.extend({ |
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 | |
| class FB_Like_Widget extends WP_Widget { | |
| private static $scripts_added; | |
| public function __construct() { | |
| parent::__construct( | |
| 'fb-like-box-widget', // ID | |
| 'Facebook Widget ', // Name | |
| 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 | |
| // Debug Custom Page Templates | |
| function custom_page_templates_page() { | |
| $templates = wp_get_theme()->get_page_templates(); | |
| $done = array(); | |
| $row = '<tr><td><a href="%s">%s</a></td><td width="60"><em>%s</em></td><td width="20"><a href="%s">edit</a></td></tr>'; | |
| $not_found = '<tr><td colspan="3"><em>No pages found using this template.</em></td></tr>'; | |
| echo '<div class="wrap"><div id="icon-tools" class="icon32"></div>'; | |
| echo '<h2>Custom Page Templates</h2>'; | |
| foreach ( $templates as $template_name => $template_filename ): |
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 | |
| // Extract the first gallery from a page/post | |
| function first_gallery_401($id = false, $echo = true) { | |
| global $post; | |
| if(!$id) $id = $post->ID; | |
| if ( $gallery = get_post_gallery() ) : | |
| add_filter( 'post_gallery', 'remove_the_first_gallery' ); | |
| if($echo): | |
| echo $gallery; | |
| else: |
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 | |
| class NH_Post_Type_Pages { | |
| private $pfpt, $post_types; | |
| function __construct() { | |
| $this->get_post_type_pages(); | |
| add_action( 'admin_init', array(&$this, 'reading_settings_section') ); | |
| if(!is_admin() || (defined('DOING_AJAX') && DOING_AJAX)): | |
| add_filter( 'pre_option_show_on_front', array(&$this, 'filter_show_on_front')); |
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 | |
| class NH_MailChimp_Archive { | |
| private $_args, $max_page, | |
| public function __construct($args = array()) { | |
| global $paged; | |
| $defaults = array( | |
| 'apikey' => false, | |
| 'start' => 0, | |
| 'limit' => 12, |
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 | |
| /** | |
| * Create a button that generates a shortcode to be added to TinyMCE. | |
| * | |
| * @todo Add an option to change the template file path. | |
| * Add the ability to specify what admin pages the button is displayed on. | |
| */ | |
| class NH_Shortcode_Generator { | |
| private $form_id = null; |
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
| jQuery(function($) { | |
| // Test for file API support. | |
| var fileApiSuport = !!(window.File && window.FileReader ); | |
| /** | |
| * Resize images that exceed the maximum size (in pixels) | |
| * @param {object} input The file input. | |
| * @param {Function} callback Callback function run after the image has been resized. | |
| * @return {null} | |
| */ |