-
-
Save joshuafredrickson/dc1b469f34908a8b7da1 to your computer and use it in GitHub Desktop.
Revisions
-
joshuafredrickson renamed this gist
Jul 19, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
joshuafredrickson revised this gist
Jul 19, 2015 . 1 changed file with 12 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,14 @@ // Remove empty p tags for custom shortcodes add_filter('the_content', 'op_content_filter'); function op_content_filter($content) { // array of custom shortcodes requiring the fix $block = join('|',array('shortcode1')); // opening tag $rep = preg_replace("/(<p>)?\[($block)(\s[^\]]+)?\](<\/p>|<br \/>)?/","[$2$3]",$content); // closing tag $rep = preg_replace("/(<p>)?\[\/($block)](<\/p>|<br \/>)?/","[/$2]",$rep); return $rep; } -
bitfade revised this gist
Jan 17, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <?php add_filter("the_content", "the_content_filter"); function the_content_filter($content) { -
bitfade revised this gist
Jan 17, 2013 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ <?php add_filter("the_content", "the_content_filter)); function the_content_filter($content) { -
bitfade created this gist
Jan 17, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ add_filter("the_content", "the_content_filter)); function the_content_filter($content) { // array of custom shortcodes requiring the fix $block = join("|",array("col","shortcode2","shortcode3")); // opening tag $rep = preg_replace("/(<p>)?\[($block)(\s[^\]]+)?\](<\/p>|<br \/>)?/","[$2$3]",$content); // closing tag $rep = preg_replace("/(<p>)?\[\/($block)](<\/p>|<br \/>)?/","[/$2]",$rep); return $rep; }