Modifying ACF to Allow Use of the "Read More" Tag in WordPress

After struggling with finding a straight answer from the plugin author's own documents and several Google searches later, I was stuck. Eventually, I figured out how to handle what seems like a straightforward issue (that shouldn't be an issue). I wanted to add "read more" functionality for ACF's WYSIWYG editor field. I wanted to use the built-in <!--more--> tag rather than building a shortcode or something similar to handle it. It would be less code with the user being comfortable with the existing interface. I also do not have to provide special instructions. This would bloat the admin even further.

I got the <!--more--> tag within the WordPress generated WYSIWYG editor was cooperating properly. My client was using the popular custom field plugin Advanced Custom Fields. Using the same functionality should render the same output. Although, ACF decided to use their own filter for their WYSIWYG editor. This caused my code for WordPress' editor to be moot. I had to built a separate function to hook into ACF's filter instead.

Cut to the Solution; "Read More" Functionality Working in ACF Fields

So if you are banging your head against the wall as much as I was with this silly issue, here's the solution. Your welcome. Also, plugin author - if you are reading this, you really should update your documentation to include this because it was not clear until I dove into the plugin's core files directly!

What I used for WordPress' WYSIWYG editor's "read more" tag

Categories: WordPress

Christina Gleason has over a decade of professional experience in web development. She is a full stack developer working within the LAMP stack environment, with side projects in MEAN stacks.

Christina Gleason
Replies to “Modifying ACF to Allow Use of the "Read More" Tag in WordPress”
  1. Lindsay says:

    Hi Christina, I am looking for this solution, too, but your post does not include the filter you added. Can you share what code worked for you? Thank you!

    1. Ah, I see the post borked a bit. I'll reply again to this comment when I update the post with the solution.

Leave a Reply

Your email address will not be published. Required fields are marked *