There was an error while loading. Please reload this page.
1 parent 11c3d9b commit 024932aCopy full SHA for 024932a
1 file changed
entries/sidebar/index.php
@@ -22,17 +22,26 @@ function wp_seo_register_sidebar_scripts() {
22
/**
23
* Asset file to automatically load dependencies and version.
24
*
25
+ * Dependencies are script handles, which are never empty strings.
26
+ *
27
* @var array{
- * dependencies: string[],
28
+ * dependencies: non-empty-string[],
29
* version: string,
30
* } $asset_file
31
* */
32
$asset_file = include __DIR__ . '/index.asset.php';
33
34
+ $src = plugins_url( 'index.js', __FILE__ );
35
+
36
+ // Nothing to register without a URL to register it from.
37
+ if ( '' === $src ) {
38
+ return;
39
+ }
40
41
// Register the sidebar script.
42
wp_register_script(
43
'wp-seo-sidebar',
- plugins_url( 'index.js', __FILE__ ),
44
+ $src,
45
$asset_file['dependencies'],
46
$asset_file['version'],
47
true
0 commit comments