Skip to content

Instantly share code, notes, and snippets.

@barrykooij
Last active November 6, 2017 08:00
Show Gist options
  • Save barrykooij/2068e992598bc9a9ee4d8d525a09ad48 to your computer and use it in GitHub Desktop.
Save barrykooij/2068e992598bc9a9ee4d8d525a09ad48 to your computer and use it in GitHub Desktop.
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