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
jQuery(document).ajaxSuccess(function(e, xhr, settings) { | |
var widget_id_base = 'mywidget'; | |
if(settings.data.search('action=save-widget') != -1 && settings.data.search('id_base=' + widget_id_base) != -1) { | |
alert('yay!'); | |
// do other stuff | |
} | |
}); |
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 /* This code filters the Categories archive widget to include the post count inside the link */ | |
add_filter('wp_list_categories', 'cat_count_span'); | |
function cat_count_span($links) { | |
$links = str_replace('</a> (', ' (', $links); | |
$links = str_replace(')', ')</a>', $links); | |
return $links; | |
} | |
/* This code filters the Archive widget to include the post count inside the link */ | |
add_filter('get_archives_link', 'archive_count_span'); | |
function archive_count_span($links) { |
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 | |
/** | |
* Loop through an array of shortcodes and check for their existence | |
* @author Gabe Shackle <gabe@hereswhatidid.com> | |
* @param array $shortcodes An array of shortcode strings | |
* @param boolean $match_all Whether to check for the existence of ALL the shortcodes, or just ANY of them | |
* @return mixed The results will either be an array of the found shortcodes or boolean false | |
*/ | |
function shortcodes_exist( $shortcodes = array(), $match_all = false ) { | |
$found_shortcodes = 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
function prefix_customizer_register( $wp_customize ) { | |
$wp_customize->add_panel( 'panel_id', array( | |
'priority' => 10, | |
'capability' => 'edit_theme_options', | |
'theme_supports' => '', | |
'title' => __( 'Example Panel', 'textdomain' ), | |
'description' => __( 'Description of what this panel does.', 'textdomain' ), | |
) ); |
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
/* | |
* Supposition v0.3a - an optional enhancer for Superfish jQuery menu widget | |
* | |
* Copyright (c) 2013 Joel Birch - based on work by Jesse Klaasse - credit goes largely to him. | |
* Special thanks to Karl Swedberg for valuable input. | |
* | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
*/ |
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
<a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></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
<?PHP | |
//functions that need to be in the functions.php | |
//for this to work | |
//more tag detection | |
function has_more() | |
{ | |
global $post; | |
if ( empty( $post ) ) return; |
OlderNewer