Description
The gravityflow_sanitize_instructions
filter allows developers to control whether step instructions displayed on the Gravity Flow entry detail page are sanitized using WordPress’s wp_kses_post() function.
Usage
1 | add_filter( 'gravityflow_sanitize_instructions' , 'your_callback_function' , 10, 1 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$sanitize_instructions | bool | Whether to sanitize the instructions. Default is false (do not sanitize) |
Example
Enable sanitization for all step instructions
1 | add_filter( 'gravityflow_sanitize_instructions' , '__return_true' ); |
Conditionally enable sanitization
1 2 3 4 | add_filter( 'gravityflow_sanitize_instructions' , function ( $sanitize ) { // Only sanitize for non-admin users return ! current_user_can( 'manage_options' ); }); |
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in includes/pages/class-entry-detail.php