WordPress.org

Ready to get started?Download WordPress

Forums

Category Posts in Custom Menu
[resolved] Using ACF fields on the menu (7 posts)

  1. JosVelasco
    Member
    Posted 1 year ago #

    I want to grab a relationship field from the plugin ACF. When I use the wildcard %post_my_field it returns an array.

    Is there a way your plugin could support ACF or execute PHP?

    http://wordpress.org/extend/plugins/category-posts-in-custom-menu/

  2. Diana Koenraadt
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jos,

    thanks for your suggestion. I haven't looked into it yet but: I will not tightly couple my plugin with another or execute PHP from another source.

    What I can do is add support for arrays and flatten them to a comma-separated list of their values. I can't do anything right now, I've got a deadline in two weeks, but after that I'll install ACF and see what I can do.

    Thank you for posting.

    Kind regards,
    Diana

  3. Diana Koenraadt
    Member
    Plugin Author

    Posted 1 year ago #

    I've started working on this, sorry for the delay.

  4. Diana Koenraadt
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jos,

    getting back to you on this one: What is it you want to display? The array that is returned by ACF contains nothing but post IDs [1,2,3].

    What kind of information is it you want to display?

    I'm thinking about nesting the structure. If posts 1, 2, 3 have titles "Title1", "Title2", "Title3", %post_my_field("(", %post_title, ")") would result in the display of "(Title1, Title2, Title3)". You'd be able to use all properties for the nested posts, etcetera.

    Kind regards,
    Diana

  5. JosVelasco
    Member
    Posted 1 year ago #

    Diana:

    Post titles,that is exactly what I need.

    Greetings

  6. Diana Koenraadt
    Member
    Plugin Author

    Posted 12 months ago #

    Hi Jos,

    I've made a change which you can try out in the Development version, which you should be able to grab from

    http://plugins.svn.wordpress.org/category-posts-in-custom-menu/trunk/

    You will be able to use

    %post_my_field(%post_title) if my_field returns an array of post IDs.
    This returns "Title1, Title2" if my_field returns the ids for two posts with these titles.

    Furthermore, you can add brackets around it like so:

    (<yourbracketinghere>%post_my_field(%post_title)<yourbracketinghere>)

    which will yield
    "<yourbracketinghere>Title1, Title2<yourbracketinghere>" if there are posts.

    Important: You cannot use spaces in <yourbracketinghere>!

    This extension is asking a lot from the plugin, and to be honest I think it makes it less elegant and more prone to errors, so I'm not sure about including this in the stable version.

    I'd like to ask you to grab the Development version and test this, let me know if this solves your question and whether you encounter any problems.

    Kind regards,
    Diana

  7. Diana Koenraadt
    Member
    Plugin Author

    Posted 6 months ago #

    No further response received.
    ACF field integration will not be supported in future versions of the plugin.
    Closing topic.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.