Title: autop in code
Last modified: February 3, 2017

---

# autop in code

 *  Resolved [Nikodemsky](https://wordpress.org/support/users/nikodemsky/)
 * (@nikodemsky)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/autop-in-code/)
 * So i’m having rather weird kind of issue, i’m trying to post code:
 *     ```
       <div class="box-przyklad">
       <p class="title"><?php get_field('tytul_boxa')?></p>
   
       <p><?php get_field('slogan_boxa')?></p>
       </div>
       ```
   
 * and output looks like this:
 *     ```
       <div class="box-przyklad">
       <?php get_field('tytul_boxa')?>
       <?php get_field('slogan_boxa')?>
       </div>
       ```
   
 * – by default p tags are consumed and are not visible in the output, but if i 
   change “WpAutoP” Filter Priority to 12, then same code as above looks like that:
 *     ```
       </p>
       <div class="box-przyklad">
       <p class="title"><?php get_field('tytul_boxa')?></p>
       <p><?php get_field('slogan_boxa')?></p>
       </div>
       <p>
       ```
   
 * – which is still wrong. I’m using text editor and Legacy Processor(Enlighter 
   processor doesn’t work, probably because i’m using this plugin:[https://pl.wordpress.org/plugins/php-code-for-posts/](https://pl.wordpress.org/plugins/php-code-for-posts/)(
   yes, i have changed php shortcode in it for something else). Plus shortcodes(`[
   php]` for example).
 * Would appreciate any help in that matter.
    -  This topic was modified 9 years, 4 months ago by [Nikodemsky](https://wordpress.org/support/users/nikodemsky/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/autop-in-code/#post-8737872)
 * Dear Nikodemsky,
 * the wpAutoP filter setting as well as the related filter functions are a workaround
   to fix the wpautop issue in major cases….posting html code is one of the edge
   cases where it might not work as expected. Therefore i recommend the Visual Editor
   Integration without shortcodes.
 * To avoid shortocdes issues with i have implemented the “Enlighter Shortcode Processor”
   which is executed before any other shortcode or content filters got applied (
   it is independent from the WordPress shortcodes!). Generally it should work if
   you remove the **[php]** shortcode from [LanguageManager](https://github.com/AndiDittrich/WordPress.Enlighter/blob/master/class/LanguageManager.php)
 * I will add an additional filter hook to the next release which allows users to
   alter the shortcode list.
 * —
 * I’ve also tried to reproduce your issue (wpautop filter prio 12, legacy shortcode
   mode) but the result look as expected:
 *     ```
       [html]
       <div class="box-przyklad">
       <p class="title"><?php get_field('tytul_boxa')?></p>
   
       <p><?php get_field('slogan_boxa')?></p>
       </div>
       [/html]
       ```
   
 * did you tried to disable other plugins – maybe it is also a incompatibility
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/autop-in-code/#post-8737897)
 * btw. there is already a filter available 🙂 [enlighter_languages](https://github.com/AndiDittrich/WordPress.Enlighter/blob/master/docs/FilterHooks.md#filterenlighter_languages)
 * you can remove the PHP shortcode by using the following code (e.g. within your
   functions.php)
 *     ```
       function mm_ejs_languages($langs){
           unset $langs['PHP'];
           return $langs;
       }
   
       // add a custom filter to modify the language list
       add_filter('enlighter_languages', 'mm_ejs_languages');
       ```
   
 *  Thread Starter [Nikodemsky](https://wordpress.org/support/users/nikodemsky/)
 * (@nikodemsky)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/autop-in-code/#post-8738528)
 * I’m rather not into using visual editor 🙂
 * > I will add an additional filter hook to the next release which allows users
   > to alter the shortcode list.
 * That would be lovely! I know, that it’s rather extreme approach to a problem,
   but i think some people will appreciate it. Including me, because sometimes i’m
   using plugins, that by default may interfere with Enlighter and some authors 
   doesn’t really want to rewrite those plugins or give oppurtunity to change it.
 * > did you tried to disable other plugins – maybe it is also a incompatibility.
 * I think it’s issue with theme i’m using([fashion agency](https://www.templatemonster.com/free-wordpress-fashion-agency-theme.html)–
   old bootstrap, lots of outdated functions, etc. so it might be it, who knows)–
   regarding using Enlighter processor. As for “eating” tags inside code box it’s
   [PHP Code For Posts](https://pl.wordpress.org/plugins/php-code-for-posts/) plugin,
   I just confirmed it. I even changed shortcode name inside it from php to something
   else, but it’s still messing up with Enlighter. I won’t ask you to look into 
   it – because i understand, that’s not of your concern, but maybe someone in the
   future will have similiar problem 🙂
 * As for now as as alternative i’m using special markers in code:
    [http://pastebin.com/aKkpUP7j](http://pastebin.com/aKkpUP7j)–
   which are printed correctly.
 * As for filter you mentioned – it concerns not only php shortcode, but html also,
   but as i said _PHP Code for posts_ plugin was the culprit.
 * Thank you very much for taking your time to answer my question and know, that
   i’m really appreciate work on this plugin.
 * Cheers,
    Niko.
    -  This reply was modified 9 years, 4 months ago by [Nikodemsky](https://wordpress.org/support/users/nikodemsky/).
    -  This reply was modified 9 years, 4 months ago by [Nikodemsky](https://wordpress.org/support/users/nikodemsky/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘autop in code’ is closed to new replies.

 * ![](https://ps.w.org/enlighter/assets/icon-256x256.png?rev=1215872)
 * [Enlighter - Customizable Syntax Highlighter](https://wordpress.org/plugins/enlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/enlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enlighter/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Nikodemsky](https://wordpress.org/support/users/nikodemsky/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/autop-in-code/#post-8738528)
 * Status: resolved