WordPress.org

Support

Support » Plugins and Hacks » ALO EasyMail Newsletter » Add "select" custom field

Add "select" custom field

Viewing 1 replies (of 1 total)
  • Plugin Author eventualo

    @eventualo

    Inside the plugin (mu-plugins/alo-easymail_custom-fields.php) you can find this sample that adds a “Favourie music” dropdown to subscription form:

    function custom_easymail_set_my_custom_fields ( $fields ) {
    	// Custom field: Fovourite music
    	$fields['cf_music'] = array(
    		'humans_name'		=> __("Favourite music", "alo-easymail"),
    		'sql_attr' 			=> "VARCHAR(100) DEFAULT NULL",
    		'sql_key' 			=> true,
    		'input_type' 		=> "select",
    		'input_options' 	=> array(
    			"" 			=> '',
    			"rock" 		=> __("Rock / Metal", "alo-easymail"),
    			"jazz" 		=> __("Jazz", "alo-easymail"),
    			"classic" 	=> __("Classic", "alo-easymail"),
    			"country" 	=> __("Country / Folk", "alo-easymail"),
    			"other" 	=> __("Other", "alo-easymail")
    		),
    		'input_mandatory' 	=> false,
    		'input_validation' 	=> false,
    		'input_attr'		=> "style=\"color: #f00\""
    	);
    	return $fields;
    }
    add_filter ( 'alo_easymail_newsletter_set_custom_fields', 'custom_easymail_set_my_custom_fields' );

Viewing 1 replies (of 1 total)
  • The topic ‘Add "select" custom field’ is closed to new replies.
Skip to toolbar