gravityflow_print_styles

Use this filter to add custom stylesheets to the print entry screen. Return an array of script handles.

Parameters

$value boolean
Defaults to false.

$form Form Object
Current form.

Examples

Example 1

This example adds the custom stylesheet print_entry.css which is located in the current theme directory to the print entry page when the form id is 1.

add_filter( 'gravityflow_print_styles', 'add_styles', 10, 2 ); 
function add_styles( $value, $form ) {      
    if ( $form['id'] != 1 ) {         
        return $value;    
    }      
    wp_register_style( 'print_entry', get_stylesheet_directory_uri() . '/print_entry.css' );      
    return array( 'print_entry' ); 
}

Example 2

This example adds the custom stylesheet print_entry.css to the print entry page when the form id is 1 or 6.

add_filter( 'gravityflow_print_styles', 'add_styles', 10, 2 ); 
function add_styles( $value, $form ) {    
    $forms = array( '1', '6' );     
    if ( ! in_array( $form['id'], $forms ) ) {
         return $value;    
    }     
    wp_register_style( 'print_entry', get_stylesheet_directory_uri() . '/print_entry.css' );      
    return array( 'print_entry' ); 
}

Placement

This code should be placed in the functions.php file of your active theme.

Still need help? Contact Support Contact Support