Description
The gravityflow_enqueue_frontend_scripts action allows developers to enqueue additional scripts and styles needed for custom functionality when Gravity Flow frontend components are present.
Usage
add_action( 'gravityflow_enqueue_frontend_scripts', 'my_custom_frontend_scripts', 10 );
Parameters
This action does not pass any parameters to the callback function.
Examples
add_action( 'gravityflow_enqueue_frontend_scripts', 'gfw_custom_frontend_scripts' );
function gfw_custom_frontend_scripts() {
// Example: Enqueue custom JavaScript for Gravity Flow frontend
wp_enqueue_script(
'my-gravityflow-custom',
get_template_directory_uri() . '/js/gravityflow-custom.js',
array( 'jquery' ),
'1.0.0'
);
// Example: Enqueue custom CSS for Gravity Flow frontend styling
wp_enqueue_style(
'my-gravityflow-custom',
get_template_directory_uri() . '/css/gravityflow-custom.css',
array(),
'1.0.0'
);
// Example: Localize script with custom data
wp_localize_script( 'my-gravityflow-custom', 'myGravityFlowVars', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'my_custom_nonce' )
) );
}
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 action is located in class-gravity-flow.php