From b2ff2cf407f0fc05236dbbfce95b02eb6c7a5989 Mon Sep 17 00:00:00 2001 From: Codetipi Date: Fri, 12 Apr 2019 17:33:15 +0100 Subject: [PATCH] New: Filter to allow themes to load custom stylesheet Useful for themes that want to implement custom styles to Merlin pages. --- class-merlin.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/class-merlin.php b/class-merlin.php index a62423e..a5fc120 100755 --- a/class-merlin.php +++ b/class-merlin.php @@ -446,6 +446,12 @@ public function admin_page() { // Enqueue styles. wp_enqueue_style( 'merlin', trailingslashit( $this->base_url ) . $this->directory . '/assets/css/merlin' . $suffix . '.css', array( 'wp-admin' ), MERLIN_VERSION ); + // Optional custom stylesheet loader + $custom_stylesheet = apply_filters( 'merlin_custom_stylesheet', '' ); + if ( ! empty( $custom_stylesheet ) ) { + wp_enqueue_style( 'merlin-additional', $custom_stylesheet, array( 'wp-admin', 'merlin' ), MERLIN_VERSION ); + } + // Enqueue javascript. wp_enqueue_script( 'merlin', trailingslashit( $this->base_url ) . $this->directory . '/assets/js/merlin' . $suffix . '.js', array( 'jquery-core' ), MERLIN_VERSION );