How to set dynamic value to filtering by custom field?

With Content Views Pro, you can set value for filtered custom field easily. But what’s if you want to get dynamic value from URL parameters, or other resources.
To do that, please add this code to file functions.php of your active theme:

// Content Views Pro - set value of custom field dynamically
add_filter( 'pt_cv_query_ctf_value', 'cvp_theme_query_ctf_value', 100, 2 );
function cvp_theme_query_ctf_value( $args, $key ) {
	if ( $key === 'NAME_OF_CUSTOM_FIELD' ) {
		if ( PT_CV_Functions::setting_value( PT_CV_PREFIX . 'enable-pagination' ) ) {
			global $pt_cv_id;
			$trans_key = 'cvp_ctf_value_' . $key . $pt_cv_id;

			if ( !defined( 'PT_CV_DOING_PAGINATION' ) ) {
				// YOUR_CODE_HERE
				// for example:
				// $value = esc_sql( $_GET[ 'parameter_1' ] );

				set_transient( $trans_key, $value, 1 * HOUR_IN_SECONDS );
			} else {
				$value = get_transient( $trans_key );
			}
		} else {
			// YOUR_CODE_HERE
			// for example:
			// $value = esc_sql( $_GET[ 'parameter_1' ] );
		}

		$args = $value;
	}

	return $args;
}

Please replace NAME_OF_CUSTOM_FIELD with name of the custom field. And supply the code to set dynamic value for custom field.

Notice: This task requires coding skill. So please ensure that you know what to do.

Best regards,