WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
Feature Request - Array data for select and radios (1 post)

  1. ederlima
    Member
    Posted 1 year ago #

    Hi!

    Can you include an option to use an array as data source for select fields and other multiple choices?

    Instead of type in the values for options, can you create a field where i type the name of a custom function that returns an array with data, and use the function as source for the field (select)?

    e.g:

    //in functions.php
    
    function my_custom_data()
    {
    return array(
    array('label'=>'my_label_1', 'value', 'my_value_1' ),
    array('label'=>'my_label_2', 'value', 'my_value_2' ),
    );
    }

    Type: Select
    Data: my_custom_data

    thank you!

    http://wordpress.org/extend/plugins/advanced-custom-fields/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.