' . esc_html__( 'You are not allowed to do this! Please contact the web administrator.', 'wp-product-feed-manager' ) . ''; } /** * Custom function to allow & but sanitize other unwanted characters. * * @param string $string the string to sanitize. * * @since 3.11.0. * @return string the sanitized string. */ protected function sanitize_string_with_ampersand( $string ) { return preg_replace( '/[^a-zA-Z0-9\s&,]/', '', $string ); } /** * Custom function allows spaces, hyphens, underscores and periods & but sanitize other unwanted characters. Specially meant for titles. * * @param string $string the string to sanitize. * * @since 3.11.0. * @return string the sanitized string. */ protected function sanitize_title_string( $string ) { return preg_replace( '/[^a-zA-Z0-9\s_.-]/', '', $string ); } /** * Custom function that only allows a true or false string. * * @param string $string the string to sanitize. * * @since 3.11.0. * @return string the sanitized string. */ protected function sanitize_true_false_string( $string ) { return 'true' === $string ? 'true' : 'false'; } /** * Custom function that allows a string with normal characters, comma's and percent characters. * * @param string $string the string to sanitize. * * @since 3.11.0. * @return string the sanitized string. */ protected function sanitize_third_party_attributes_string( $string ) { return preg_replace( '/[^a-zA-Z0-9\s,%_-]/', '', $string ); } } // end of WPPFM_Ajax_Calls class endif;