Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Yes, there is an action for this in classes/fields/pick.php.

    For example:

    <?php
    
    add_action(
    	'pods_form_ui_field_pick_related_objects_predefined',
    	function(){
    		PodsField_Pick::$related_objects['pokemon'] = array(
    			'label'         => __( 'Pokémon', 'pods' ),
    			'group'         => __( 'Predefined Lists', 'pods' ),
    			'simple'        => true,
    			'data_callback' => 'predefined_list_pokemon_data',
    		);
    	}
    );
    
    function predefined_list_pokemon_data( $name = null, $value = null, $options = null, $pod = null, $id = null ){
    	return [
    		'Bulbasoar',
    		'Charmander',
    		'Squirtle',
    		'Mew',
    		'Mewtwo',
    	];
    }
    Thread Starter jordiwordpress

    (@jordiwordpress)

    Thanks a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create a predefined lists’ is closed to new replies.