Taxonomy breaks the plugin
-
Hello,
While using your plugin with WOOCOMMERCE, there seems to be an issue that I cannot seem to get resolved. With newly created attribute items and using these as custom pages the code:
if ( preg_match_all( ‘/%%ct_desc_([^%]+)?%%/u’, $string, $matches, PREG_SET_ORDER ) ) {
global $post;
foreach ( $matches as $match ) {
$terms = get_the_terms( $post->ID, $match[1] );
$string = str_replace( $match[0], get_term_field( ‘description’, $terms[0]->term_id, $match[1] ), $string );
}
}Kills the page – and stops processing (only renders until your plugin starts writing).
Ironically, commenting out $terms and $string lines result in the page to render completely and also show the ‘description’ for the particular attribute item.Any ideas?
- The topic ‘Taxonomy breaks the plugin’ is closed to new replies.