Last active
November 6, 2017 08:00
-
-
Save barrykooij/2068e992598bc9a9ee4d8d525a09ad48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rp4wp_styling_on_all() { | |
global $post; | |
// Check if the post type is installed | |
$pt_manager = new RP4WP_Post_Type_Manager(); | |
if ( $pt_manager->is_post_type_installed( $post->post_type ) ) { | |
// get component related css | |
$component_manager = new RP4WP_Manager_Component(); | |
$css = $component_manager->get_component_css(); | |
// output css | |
if ( '' != $css ) { | |
echo "<style type='text/css'>" . $css . "</style>" . PHP_EOL; | |
} | |
} | |
} | |
add_action( 'wp_head', 'rp4wp_styling_on_all' ); | |
add_filter( 'rp4wp_disable_css', '__return_true' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment