Description
The gravityflow_page_load_logic_setting filter enables the page load vs dynamic conditional logic option to be customized in general or per step type within Gravity Flow.
Any custom steps which use the Editable_Fields trait will also have a step type named version of this filter run (example: gravityflow_page_load_logic_setting_custom_type)
Parameters
Parameter | Type | Details |
---|---|---|
$do_display | Boolean | Whether or not to display the “page load” vs. “dynamic” option for the conditional logic setting. |
$step | Step | The current step. |
Usage
1 2 3 | add_filter( 'gravityflow_page_load_logic_setting' , 'jo_gravityflow_page_load_general_example' , 10, 2 ); add_filter( 'gravityflow_page_load_logic_setting_user_input' , 'jo_gravityflow_page_load_ui_example' , 10, 2 ); add_filter( 'gravityflow_page_load_logic_setting_approval' , 'jo_gravityflow_page_load_approval_example' , 10, 2 ); |
Examples
Modify the logic option for specific step IDs
1 2 3 4 5 6 7 8 | add_filter( 'gravityflow_page_load_logic_setting' , 'jo_gravityflow_page_load_specific_step' , 10, 2 ); function jo_gravityflow_page_load_specific_step( $editable_fields , $step ) { if ( $step && $step ->get_id() == 91 ) { return true; } else { return false; } } |
Modify the logic for a custom step type and specific step ID
1 2 3 4 5 6 7 8 | add_filter( 'gravityflow_page_load_logic_setting_apples' , 'jo_gravityflow_page_load_specific_step_apples' , 10, 2 ); function jo_gravityflow_page_load_specific_step_apples( $do_display , $step ) { if ( $step && $step ->get_id() == 91 ) { return true; } else { return false; } } |
Since
- Version 2.9.1 – Added the step type to filter definition so that step type specific versions can be hooked.
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?