Open Seamate opened 5 years ago
Hey @Seamate ,
I'm not really sure what could be going on, can you email me an example, like a page where the issue is happening?
I could make wild assumptions about Sensei LMS plugin handling content output and blame them but lets try a few things first :)
Can you try adding this to your functions.php file
// Allow Shortcodes in the Excerpt field
add_filter('the_excerpt', 'do_shortcode');
add_filter('get_the_excerpt', 'do_shortcode');
Thinking about this some more, this could be a bigger problem than it seems though... The excerpt has a maximum content length, the table plugin will generate a lot of text which could exceed the limits of excerpt text length. If the except cuts off the table content text that is generated, the table would never be able to work because it would be incomplete and broken.. Im not sure.. I will investigate.
I added the filter to functions.php and it seemed to work, but it also shows two boxes above the actual table. The first box contains the raw code that displays the table I guess. I have sent you the page via email. Thank you
Any update, John?
Im still looking into this, sorry for the delay.
Okay bro. Thanks
Hey, so after looking at this a few times, I've started to thing its not a problem with my JTRT plugin. The snippets I gave you:
add_filter('the_excerpt', 'do_shortcode');
add_filter('get_the_excerpt', 'do_shortcode');
adding these two to my functions.php in my theme seemed to fix the issue for me.. However, I'm not using that same Sensei LMS plugin... Thinking that its a plugin designed specifically to hide content, I think they probably have some sort of hooks to hide content within the except.
Have you tried creating a bug ticket for Sensei LMS?
Also, looking through the code of Sensei,
// @since 1.9.0
// lesson custom excerpts
add_filter( 'get_the_excerpt', array( 'Sensei_Lesson', 'alter_the_lesson_excerpt' ) );
public static function lesson_excerpt( $lesson = null, $add_p_tags = true ) {
$html = '';
if ( is_a( $lesson, 'WP_Post' ) && 'lesson' == $lesson->post_type ) {
$excerpt = $lesson->post_excerpt;
// if $add_p_tags true wrap with <p> else return the excerpt as is
$html = $add_p_tags ? wp_kses_post( wpautop( $excerpt ) ) : esc_html( $excerpt );
}
return apply_filters( 'sensei_lesson_excerpt', $html );
} // End lesson_excerpt()
so try this
add_filter('sensei_lesson_excerpt', 'do_shortcode');
Let me know if that helps. If not, I think the best thing to do would be to contact Sensei support and see what they think..
P.S make sure add_p_tags is false (im not sure if its a setting you can set) because having <table>
inside of <p>
is invalid.
I tried the code in my functions.php file but it didn't work. Thanks for taking the time to look into this.
Hello John,
I experienced an issue with your plugin when I used it in an excerpt on a page which requires log in to have access. The page shows an excerpt to logged out users, but tables are not parsed. It only shows the shortcode.
It might be a conflict with the Sensei LMS since it was in lessons I used the tables in an excerpt.
I will be expecting a response from you, and possibly a fix.
Thank you