Support

Account

Home Forums Add-ons Flexible Content Field How do I add rows to flexible content fields?

Solving

How do I add rows to flexible content fields?

  • Oh, I meant “programmatically”.

    I want to enter content in a textarea, and create new rows (add more layouts) based on that content, on create_post (i.e. once)

    I found how to populate fields, but I have no idea what happens when there’s no row created for that.

    How do I add rows programmatically? It could be with JS on the client as well.

  • Hi @sergiozambrano

    To clarify, what you want to do is add a new row from a flexible field to a post at first publish.

    Are you publishing this post from the front end? Otherwise, why do you need to do this?

  • I want to add new ROWS to an EMPTY flexible content field, based (e.g. exploded w/JS) from ANOTHER acf field (or the wp editor).

    For future visitors: I already made my importer processing the fields with a function hooked to acf/save_post wordpress hook.

    It parses a whole powerpoint presentation into slides, including base64 images, something I recommend you to add to your plugin, like “image elevator” ๐Ÿ™‚

    It seems that “update_field” is all I needed. I thought there would be some sort of “add row”โ€ฆ but since the whole thing is a acf fieldโ€ฆ

    The only problem I found is the last ticket I submitted. One sub-field doesn’t makes it to the DB but it doesn’t come out to the editor. Please take a look at it. I can send you my code, but really, I checked the field BEFORE update_field, and it was ok, as well as the data found in the DB. But no show.

    About image-elevator: One could just install it, and paste the images in a wysiwyg editor, but as it happened to me, my wordpress post ended up with two wysiwyg editors for each row, (apparently one many more than it was designed for) which made the browser twice as slow.

    And I had to modify their plugin to work from the back end, since currently theirs only works with ajax from the post editor. Anyway, allowing to “paste” an image I think it’d be a great addition ๐Ÿ™‚

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

You must be logged in to reply to this topic.