Error With WP Debug Enabled (fix provided)
-
The plugin Seriously Simple Podcasting creates a custom post type Episodes. When WP Debug is enabled, the episodes show as 404 pages instead of displaying.
Turns out this is related to line 373 of class-custom_body_class.php:
$values = explode( ‘ ‘, $val );Here’s the code that resolved this issue for me (replacing lines 371-383):
if ( ! empty( $res ) ) {
foreach ( $res as $k => $val ) {
// Only accept strings; ignore null/arrays/etc.
if ( ! is_string( $val ) ) {
continue;
}
$val = trim( $val );
if ( $val === '' ) {
continue;
}
// Split on any whitespace, skip empties.
$values = preg_split( '/\s+/', $val, -1, PREG_SPLIT_NO_EMPTY );
foreach ( $values as $value ) {
if ( ! in_array( $value, $rezult, true ) ) {
$rezult[] = $value;
}
}
}
}
The topic ‘Error With WP Debug Enabled (fix provided)’ is closed to new replies.