Advanced Custom Fields
Dynamic checkbox (1 post)

  1. mathew70
    Posted 4 years ago #

    I need to insert in a custom post a checkbox field. This checkbox must show a list of title of another custom post so I cannot insert the values in the "Choices" filed, I need a function to compile it dynamically.
    I've partially solved the problem with "Export Field Groups to PHP". In the function.php I have a query that compile an array with the title of the custom post I need, the in the array() of the checbox I put a list of variable:

    array (
          'label' => 'Name of Field',
          'choices' =>
          array (

    But the number of the values[] in the arry() are fixed, so if you insert a new post in the custom post this is not show in the checkbox.

    Any idea?
    Many thanks!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic