Nico Danneberg
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Wiki Tooltip] Show tooltip only once per wordHi jennyenr!
I think it’s better to use
preg_replace
function here! Here you can not only limit the number of matches but you spare the loop over the array, too. The code could look like this:function add_wikitips($content) { if( is_single() && is_main_query() ) { $patterns = array( 'ice cream', 'sugar', 'cola' ); $replacements = array( '[wiki]ice cream[/wiki]', '[wiki]sugar[/wiki]', '[wiki]cola[/wiki]' ); $content = preg_replace( $patterns, $replacements, $content, 1 ); } return $content; }
Finally, I like the idea behind. I will think about a new feature of my plugin ??
Have fun!
Forum: Plugins
In reply to: [WP Wiki Tooltip] Tooltip not showing in blog pageHi salam,
I think this issue is a duplicate of https://www.ads-software.com/support/topic/shortcode-excerpt/
As you will see there it is a standard behavior of WordPress that shortcodes are removed in excerpts. So, the plugin has no chance to display the tooltips. And has no chance to manipulate this behavior, too!
- This reply was modified 4 years, 5 months ago by Nico Danneberg.
- This reply was modified 4 years, 5 months ago by Nico Danneberg.
Forum: Plugins
In reply to: [WP Wiki Tooltip] Content controlThank you for this great idea(s)! I try to invest some time for it asap ??
Forum: Plugins
In reply to: [WP Wiki Tooltip] Shortcode & ExcerptThanks for the new info! I reviewed the code of WP core and found the reason of your problem! In https://core.trac.www.ads-software.com/browser/tags/5.3/src/wp-includes/shortcodes.php#L260 you can see that all content between the shortcode tags is removed, too!
So, I will try to find a special option setting to steer the behavior in ecxerpt! But until this I will close this thread…
Forum: Plugins
In reply to: [WP Wiki Tooltip] Undefined index: own-error-titleI just published a new version with a minor update to fix this issue ??
Forum: Plugins
In reply to: [WP Wiki Tooltip] Shortcode & ExcerptOK, I will wait for answers to your posts at Stackoverflow an Github!
Forum: Plugins
In reply to: [WP Wiki Tooltip] Shortcode & ExcerptAre you able to modify my plugin on your server?
If yes please look for the file
class.wp-wiki-tooltip.php
and add this line of code at line 18:add_filter( 'get_the_excerpt', 'do_shortcode' );
Please tell me if this leads to the right result!
Forum: Plugins
In reply to: [WP Wiki Tooltip] GutenbergWhat do you mean with “gutenberg menu in the editor”? Do you mean an own Gutenberg block?
Forum: Plugins
In reply to: [WP Wiki Tooltip] Shortcode & ExcerptIt’s a pitty that it doesn’t work!
I will hold my eyes open to perhaps see a solution later…
Forum: Plugins
In reply to: [WP Wiki Tooltip] Shortcode & ExcerptI made this small setup that works with 2020 really fine:
1) I created a post with a shortcode within the first 100 characters.
2) I created a page where I used the “Latest Posts”-Gutenberg Block with option “show excerpt” enabled.
3) If I visited this page online everything looks good!
All this is done with 2020! So, I do not see the problem :/
Forum: Plugins
In reply to: [WP Wiki Tooltip] Shortcode & ExcerptOk, I just tested this scenario in my local deveopment setup once with “Twenty Twenty” and once with “Blocksy”. I found out that your problem is caused by the theme!
In “Twenty Twenty” everything work fine. All shortcodes are displayed even in excerpts pretty well. But if I switched to Blocksy the shortcodes were filtered out! And if I used the extra excerpt-field of a post that the shortcode was printed out as plain-text (the [] are shown).
So, my plugin has no chance to steer the behavior of the theme! I think the only solution is override the get_excerpt-function of the theme…
Forum: Plugins
In reply to: [WP Wiki Tooltip] Shortcode & ExcerptI am not sure if this is not a bug of the plugin but a standard behavior of WordPress. I will figure out and coming back soon!
Forum: Plugins
In reply to: [WP Wiki Tooltip] Undefined index: own-error-titleThank you for this hint ?? I will try to fix this asap!
Forum: Reviews
In reply to: [WP Wiki Tooltip] Work like a charmI thank you very much!
Forum: Plugins
In reply to: [WP Wiki Tooltip] Number of paragraphs to be shownThank you belzemut for this great idea!
I have to check, how to put such an option into my plugin, but I will invest some time for it ??