Examples

Make value url safe

This example makes the value url save by using the php function urlsafe for any value with the key “file_name”

add_filter( "wr_template_replace_value", "make_filename_urlsafe", 10, 2 );

public function make_filename_urlsafe( $value, $key ) {
	if ( $key == "file_name" ) {
		$value = urlencode( $value );
	}
	return $value;
}

Usage

add_filter('wr_template_replace_value', "your_custom_function", 10, 2)

Parameters

  • $value 
  • $key