View gist:3028827
Index: plugin/class-facet-taxonomy.php | |
=================================================================== | |
--- plugin/class-facet-taxonomy.php (revision 566010) | |
+++ plugin/class-facet-taxonomy.php (working copy) | |
@@ -89,7 +89,7 @@ | |
$cache_key = md5( serialize( $matching_post_ids )); | |
- if( ! $this->facets->_matching_tax_facets = wp_cache_get( $cache_key , 'scrib-facet-taxonomy' )) | |
+ if( ! empty( $matching_post_ids ) && ! $this->facets->_matching_tax_facets = wp_cache_get( $cache_key , 'scrib-facet-taxonomy' )) |
View gist:3090584
$recTitle = $record['title']; | |
$encoding = mb_detect_encoding( $recTitle, 'UTF-8', true ); | |
if ( empty( $encoding ) ) { | |
$recTitle = mb_convert_encoding( $recTitle, 'UTF-8' ); | |
} |
View realurl.php
<?php | |
$TYPO3_CONF_VARS['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment,tx_realurl_exclude,tx_realurl_pathoverride,alias,nav_title,title'; | |
// @ref http://www.slideshare.net/jweiland/why-realurl-sucks-and-how-to-fix-it | |
$realurlConfig = array( | |
'init' => array( | |
'adminJumpToBackend' => true, | |
'appendMissingSlash' => 'ifNotFile,redirect[301]', | |
'emptyUrlReturnValue' => '/', |
View constants.txt
config { | |
# cat=basic/links; type=string; label=Absolute Reference Prefix: Used to convert relative paths to absolute paths. Use absolute URL like "http://www.example.com" to set. If empty, config.baseURL is used. If 0, config.absRefPrefix is unset. | |
absRefPrefix = | |
} |
View gist:4025107
<?php | |
function add_attachment_caption( $meta, $attachment_id ) { | |
if ( ! empty( $meta['image_meta']['caption'] ) ) { | |
$data = array( | |
'ID' => $attachment_id, | |
// remove wrongly imported caption as description field | |
'post_content' => '', | |
'post_excerpt' => $meta['image_meta']['caption'], | |
); |
View gist:4025132
function register_attachment_taxonomy() { | |
add_post_type_support('attachment', 'post_tag'); | |
register_taxonomy_for_object_type('post_tag', 'attachment'); | |
} | |
add_action('admin_init', 'register_attachment_taxonomy'); | |
// add_filter('wp_read_image_metadata', 'read_all_image_metadata', '', 3); | |
function add_attachment_post_tags( $meta, $attachment_id ) { |
View debug.php
<?php | |
/** | |
* WordPress debug helpers | |
* | |
* @author Michael Cannon <mc@aihr.us> | |
*/ | |
function wtfami( $uk = null ) { | |
if ( ! is_null( $uk ) ) echo $uk . " is…\n<br />"; |
View filter.php
<?php | |
add_filter( 'testimonials_widget_testimonial_html', 'my_testimonials_widget_testimonial_html', 10, 6 ); | |
// this function is a copy of Testimonials_Widget::get_testimonial_html and completely ignores what's in $content | |
function my_testimonials_widget_testimonial_html( $content, $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) { | |
$atts = wp_parse_args( $atts, Testimonials_Widget::get_defaults( true ) ); | |
$atts = Testimonials_Widget_Settings::validate_settings( $atts ); | |
// display attributes |
View purge-wp-transients.php
<?php | |
/* | |
Plugin Name: Purge Transients | |
Description: Purge old transients | |
Version: 0.1 | |
Author: Seebz | |
*/ | |
View testimonials-widget.css
.testimonialswidget_testimonials { | |
/* testimonials wrapper */ | |
} | |
.testimonialswidget_testimonials .testimonialswidget_active { | |
/* active testimonials */ | |
display: block; | |
} | |
.testimonialswidget_testimonials .testimonialswidget_display_none { |
OlderNewer