array( 'id' => 'name', 'label' => __( 'Name', 'thrive-dash' ), ), 1 => array( 'id' => 'phone', 'label' => __( 'Phone', 'thrive-dash' ), ), ); if ( ! empty( $action_data ) ) { if ( is_string( $action_data ) ) { $api = $action_data; } else if ( property_exists( $action_data, 'autoresponder' ) ) { $api = $action_data->autoresponder->value; } } if ( ! empty( $api ) ) { $api_instance = \Thrive_Dash_List_Manager::connection_instance( $api ); if ( $api_instance && $api_instance->is_connected() && $api_instance->has_custom_fields() ) { $mailing_list = empty( $action_data->autoresponder->subfield->mailing_list->value ) ? '' : $action_data->autoresponder->subfield->mailing_list->value; $custom_fields = $api_instance->get_custom_fields_by_list( $mailing_list ); foreach ( $custom_fields as $key => $field ) { array_push( $values, array( 'id' => $field['id'], 'label' => $field['label'] ?: $field['name'], ) ); } } } return array_reverse( $values, true ); } public static function get_validators() { return array( 'key_value_pair' ); } public static function allow_dynamic_data() { return true; } }