Home Forums Feature Requests Code Field


Code Field

  • This request may be way out there, but it can’t hurt to ask. Put it in the “Would be cool to have” column.

    I’d love to see a code type field with color coding and line numbers. You could select if the code is HTML, JavaScript, CSS. Something with the tab key actually adding tabs to the textarea. I saw an editor like this once that worked along the same lines as tinyMCE but forget where.

    Maybe as an addon, I’d pay for it 🙂

  • Have you tried Advanced Custom Fields – Code Area Field?

    I have used it, and it worked great for what I needed it for! (A “Custom CSS”-option)

  • Didn’t even know it existed, I’ll give it a try.

    There do seem to be some limitations that’ll effect it’s use and from giving it a quick look it doesn’t seem to be supported at all.

  • The mentioned add-on is pretty great even if it has not been updated in a while. Having said that, I am hoping to fork that plugin and update it to acf v5 as well as add some tweaks I would love to see.
    If there is any interest, I can let you guys know when I am done with my plugin.

  • There’s definitely interest, I’m working on a plugin that will allwo HTML, CSS an JS to be entered. Mixed code would be something I’d like to see. As far as PHP goes though, I don’t let people do PHP through the admin, so not needed.

  • Hey guys, any news on this? I’ve seen the plugin you’ve mentioned and still no update – thinking of forking but has anyone made a start I can contribute to?


  • Not that I know of. It’s going to take someone that really needs it and wants to create a new version of the plugin. It appears that the author of the other add on has lost interest and it’s been abandoned.

    If I had time and a need for it, but right now I don’t really have either. I could actually think of many placed to use it if it existed but I can get away with using a simple textarea with formatting turned off so unless a client demands a code editor…..

  • This is pretty easy to sort out with the make your own field type instructions which can be found here:

    I knocked together one pretty quickly as a plugin using this and CodeMirror. I only created it for use with CSS and JS code types but it’s pretty easy to implement.

    Edit: I should probably point out that by quickly I mean it took less than 30 minutes.

  • @tdmphil would you mind sharing your code on Github or somewhere else? Thanks!

  • I’d be interested in this as well.

  • I have a version that works, on Github, going to get it in the .org repo shortly.

  • This is great news @ptasker, I’ll definitely give it a try the next time I need a code field, I’m actually working on a project right now that may have need of it. Hopefully you don’t tire of maintaining it because this is something that’s greatly needed. If you’re not going to sell it put up some information on where donations can be sent, I will be happy to support your work if I find it useful.

  • @hube2 I don’t plan on letting it rot, I’ll keep it up to date as long as I can. Going to push to the plugin repo in the next day or 2 so stay tuned.

  • This reply has been marked as private.
  • I just tried out ptasker’s plugin. What a pleasure to be able to use an HTML editor in ACF!

    There is an issue with flexible fields. The plugin works for stand-alone fields but the editor fails in flexible fields. In a recent reply in the support thread ptasker says he’s working on this. I’m looking forward to the update with great anticipation because that’s where I really want to use it.

    I left him a favorable review and bought him a cup of coffee (Starbucks or Tim Horton’s or whatever they have in the Great White North). If you’re using the plugin and want to see development continue, you should, too!

  • Just rolled out an update that handles flexible content fields. Everyone should get an upgrade notice shortly!

    Props to Github user who submitted a pull request and got my butt in gear.

Viewing 18 posts - 1 through 18 (of 18 total)

The topic ‘Code Field’ is closed to new replies.