Support

Account

Home Forums Feature Requests Code Field

Solving

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 🙂

  • me too!!!

  • 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.

    • tamara

    • April 1, 2014 at 12:34 pm

    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?

    Cheers!

  • 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…..

    • tdmphil

    • February 4, 2016 at 1:19 am

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

    http://www.advancedcustomfields.com/resources/creating-a-new-field-type/

    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.

    • trestian

    • February 26, 2016 at 12:21 pm

    @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.

    https://github.com/ptasker/acf-code-field

  • 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 WP.org plugin repo in the next day or 2 so stay tuned.

  • This reply has been marked as private.
  • Official plugin is up here: https://wordpress.org/plugins/acf-code-field/

    • lflier

    • July 15, 2016 at 2:23 am

    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!

    • ptasker

    • July 19, 2016 at 12:03 pm

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

    Props to Github user https://github.com/thegreyspot who submitted a pull request and got my butt in gear.

  • This is really great work , Thank you for sharing such a useful information here in the blog.As our world grows smarter with the phenomenal evolution of technology, it is time to upgrade to a smart lifestyle.

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.