Created
December 25, 2023 06:41
-
-
Save obiPlabon/1a63de1f63da12226d495a960799e2eb to your computer and use it in GitHub Desktop.
Fix dRestaurant feature list field sanitization issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function drestaurant_sanitize_listing_form_meta_fields( $meta_data, $posted_data ) { | |
$feature_list = directorist_get_listing_form_field( $posted_data['directory_id'], 'drestaurant_feature_list' ); | |
if ( empty( $feature_list ) ) { | |
return $meta_data; | |
} | |
if ( ! isset( $feature_list['field_key'] ) || ! isset( $posted_data[ $feature_list['field_key'] ] ) ) { | |
return $meta_data; | |
} | |
$meta_data['_' . $feature_list['field_key'] ] = sanitize_textarea_field( $posted_data[ $feature_list['field_key'] ] ); | |
return $meta_data; | |
} | |
add_filter( 'atbdp_ultimate_listing_meta_user_submission', __NAMESPACE__ . '\drestaurant_sanitize_listing_form_meta_fields', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment