gravityflow_print_styles
Use this filter to add custom stylesheets to the print entry screen. Return an array of script handles.
Parameters
$value array
Defaults to false.
$entry_ids Form Object
An array of entry ID(s) that are selected for print.
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 for one of the selected entry(ies) is 13.
add_filter( 'gravityflow_print_styles', 'add_styles', 10, 2 ); function add_styles( $value, $entry_ids ) { $customize = false; if ( ! empty( $entry_ids ) ) { foreach ( $entry_ids as $entry_id ) { $entry = GFAPI::get_entry( $entry_id ); //If you want to check for multiple form IDs use: if ( ! in_array( $form['id'], array( '13', '7', '12') ) ) { if ( $entry['form_id'] == '13' ) { $customize = true; } } } if ( $customize ) { wp_register_style( 'print_entry', get_stylesheet_directory_uri() . '/print_entry.css' ); return array( 'print_entry' ); } return $value; }
Placement
This code should be placed in the functions.php file of your active theme.