Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | n/a |
0 / 0 |
|
| Automattic\Jetpack_Boost\Compatibility\Breakdance\exclude_breakdance_custom_post_types | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Compatibility for Breakdance |
| 4 | * |
| 5 | * @package automattic/jetpack-boost |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack_Boost\Compatibility\Breakdance; |
| 9 | |
| 10 | /** |
| 11 | * Exclude Breakdance custom post types from list of posts to generate critical CSS for. |
| 12 | * |
| 13 | * @param array $post_types Post types. |
| 14 | */ |
| 15 | function exclude_breakdance_custom_post_types( $post_types ) { |
| 16 | if ( defined( 'BREAKDANCE_ALL_EDITABLE_POST_TYPES' ) ) { |
| 17 | foreach ( BREAKDANCE_ALL_EDITABLE_POST_TYPES as $post_type ) { |
| 18 | unset( $post_types[ $post_type ] ); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | return $post_types; |
| 23 | } |
| 24 | |
| 25 | add_filter( 'jetpack_boost_critical_css_post_types_singular', __NAMESPACE__ . '\exclude_breakdance_custom_post_types' ); |
| 26 | add_filter( 'jetpack_boost_critical_css_post_types_archives', __NAMESPACE__ . '\exclude_breakdance_custom_post_types' ); |