Shortcodes being expanded in bw_geshi

This example of bw_geshi contains a shortcode that should not have expanded.


[wp]
[bw_plug option=active_plugins]
 

When the NextGen plugin is active, the shortcodes ignored by the bw_geshi shortcode would get expanded by NextGen. This was unwanted behaviour, which has now been fixed with version 0.5 of the oik-css plugin.

Problem report

When nextgen is active and the [bw_geshi] shortcode contains shortcode examples then the shortcode examples get unexpectedly expanded.

Problem analysis

The problem is created by NextGen’s filter function for “the_content”.


function parse_content($content) {
  $this->_runlevel--;
  $this->activate_all();
  $content = do_shortcode($content);
  $content = apply_filters('ngg_content', $content);
  return $content;
}
 
  • The filter function is added with the highest priority possible (i.e. last).
  • It invokes do_shortcode() directly against the already formatted content.
  • This cause the shortcode’s that bw_geshi left untouched to be expanded.

Workarounds

  • De-activate NextGen

Solutions

  • Change bw_geshi to convert ‘[‘ to [

A change like this has now been implemented in oik-css v0.5.

See also

Plugin name and description Plugin links Version, total downloads, last update, tested
WordPress Gallery Plugin – NextGEN Gallery
The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 30 million downloads.
3.4.7
30,719,530
November 25, 2020
5.6.0
oik-css
Allows internal CSS styling to be included in the content of the page.
1.1.0
1,980
September 4, 2020
5.5.3
Share

Published by Herb

Herb Miller is the web designer, web developer at Rowlands Castle Web Design - a Bobbing Wide company.