Formatting ?

You either need to add such code via the HTML editor (and not switch back to the Visual editor), or else you will need to pass a custom configuration to the Visual editor. I have similar needs, and here’s what I use (in functions.php): // http://tinymce.moxiecode.com/wiki.php/Configuration function cbnet_tinymce_config( $init ) { // Change code cleanup/content … Read more

Format content value from DB outside of WordPress filters

There are a few filters and actions here that run. You’d need to look at the code and figure out what/how to utilize these. https://codex.wordpress.org/Function_Reference/wpautop https://codex.wordpress.org/Function_Reference/wptexturize https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content https://developer.wordpress.org/reference/functions/do_shortcode/ https://developer.wordpress.org/reference/functions/unescape_invalid_shortcodes/ https://developer.wordpress.org/reference/functions/get_shortcode_regex/

wpautop() when shortcode attributes are on new lines break args array

Ok, I’ve never seen a shortcode done in this way so I threw together a bit of code to test your scenario. And I get the same results with code that works just fine with the standard shortcode format. Standard Shortcode Format [shortcode name1=”value1″ name2=”value2″] I don’t believe this is a result of wpautop(), but … Read more

Creating a table from shortcode avoiding wpautop for each row

The extra space comes from wpautop(), which inserts <br /> on every line break. You have to strip these out before calling do_shortcode(). Additionally, use add_filter( ‘the_content’, ‘shortcode_unautop’ );. From my experience, you need both. Probably a bug. See my shortcode plugin for an example. It has shortcodes for tables too. Aside: Shortcodes should never … Read more

Shortcode from a widget is wrapped in unwanted element

There actually are several ways to handle the WordPress editor wrapping shortcodes in <p> tags. This code shows probably the simplest way to do it…just a simple and short function you need to drop into your functions.php file. Once you do, no more tags around your shortcodes that are on their own line! function wpex_clean_shortcodes($content){ … Read more

How to enable the tag in WordPress posts and pages

First things first, modifying core files is extremely frowned upon you will have to make these changes with every upgrade and they can lead to security and other problems. I’m pretty sure there is a plugin that will allow this. I did a simple search and here are a few to try: http://wordpress.org/extend/plugins/preserved-html-editor-markup/ http://wordpress.org/extend/plugins/ultimate-tinymce/

Numbering sections and block-level elements in wpautop(); WordPress as CMS for long-form writing;

You could probably achieve this with a filter of some sort on the_content. Here’s a quick and dirty example that finds all instances of <p> and inserts a named anchor, then adds a list of links to each anchor at the top of the content. Check out the Shortcode API as well, which could similarly … Read more