Thanks for the example.
To explain the result:
WordPress passes the whole content inside the shortcode to the registered shortcode handler and the result of the shortcode handler will be used without without applying any filters at all.
Therefore Timed Content needs to apply a number of filters on the content. Otherwise it would not be possible to embed other shortcodes or more complex content as content (galleries etc.).
These filters are:
- wptexturize
- convert_smilies
- convert_chars
- wpautop
- prepend_attachment
- do_shortcode
The result is, that you can show or hide whole page sections with Timed Content even if these sections other shortcodes like Galleries – but on the other hand it is not possible to show or hide just simple text inside a line or paragraph.
I tried to remove the wpautop filter inside Timed Content and so far it looks OK, but I have to do further testing.
If you want to try this out – comment out line 1502 in timed-content.php
:
Before:
add_filter('timed_content_filter', 'wpautop');
After:
// add_filter('timed_content_filter', 'wpautop');
This will remove the wpautop filter from the Timed Content handler and you should not get any extra p
elements where you don’t expect them.
Even though the results looks promising, I still have to do more tests before I’ll publish an update.