Compare commits

...

1 commit
0.3.6 ... main

Author SHA1 Message Date
Andy Fragen
3e2c694ca8 add test for install to theme 2023-05-30 14:45:15 -07:00
2 changed files with 9 additions and 1 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "afragen/wp-dismiss-notice", "name": "afragen/wp-dismiss-notice",
"description": "Library for time dismissible WordPress admin notices.", "description": "Library for time dismissible WordPress admin notices.",
"version": "0.3.6", "version": "0.3.7",
"type": "library", "type": "library",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [

View file

@ -39,6 +39,14 @@ class WP_Dismiss_Notice {
*/ */
$vendor_dir = apply_filters( 'dismiss_notice_vendor_dir', '/vendor' ); $vendor_dir = apply_filters( 'dismiss_notice_vendor_dir', '/vendor' );
$composer_js_path = untrailingslashit( $vendor_dir ) . '/afragen/wp-dismiss-notice/js/dismiss-notice.js'; $composer_js_path = untrailingslashit( $vendor_dir ) . '/afragen/wp-dismiss-notice/js/dismiss-notice.js';

$theme_js_url = get_theme_file_uri( $composer_js_path );
$theme_js_file = parse_url( $theme_js_url, PHP_URL_PATH );

if ( file_exists( ABSPATH . $theme_js_file ) ) {
$js_url = $theme_js_url;
}

if ( '/vendor' !== $vendor_dir ) { if ( '/vendor' !== $vendor_dir ) {
$js_url = home_url( $composer_js_path ); $js_url = home_url( $composer_js_path );
} }