Custom Fields
Support General Add Select Values from Other Custom Fields

  • Creator
  • #12512
    Resolved Pete Wlodkowski

    Hi, I have a few custom number fields, created in Advanced Custom Fields and assigned to my custom post type.

    I want to populate a Meta Box select field on the same custom post type from these values.

    So, I have the following number / text fields, each with a single value, ex: 40


    I want to use these as the value options / select options for my meta box select field.

    How might I achieve this?

Viewing 3 replies - 11 through 13 (of 13 total)
  • Author
  • #12689
    Pete Wlodkowski

    Anh Tran, you are awesome my friend. I send a lot of gratitude and karma your way! You deserve it. Thank you for helping me on this. Happy Holiday.

    Pete Wlodkowski

    Hi Anh,

    Quick question. I've set up individual groups for multiple years (2006 - 2019), but it is very slow:

    2006 - 20019 year grouping

    Here is my working code for the multi years, wondering if there is a better way to write it so it is quicker. Like I said, this is slow. It's taking forever to load the edit Tournament (edit post).

    Thought maybe the multi year functions could be grouped... just wasn't sure. Thought I'd send you a message. Thank you!

    Anh Tran

    I have optimized your code to make it much shorter here: As all the year has a same meta box, it can be wrapped in a function.

    However, the speed is slow maybe because of the post field. Each post field make a query to the database to get all posts. As you have 14 post fields for 14 years, there are 14 queries. That might be the cause.

    Update: I have updated the plugin on Github that has an improvement for the post field. Now it runs only 1 query instead of 14. Please download from Github and try it.

Viewing 3 replies - 11 through 13 (of 13 total)
  • You must be logged in to reply to this topic.