@@ -527,7 +527,8 @@ function require_jetpack_authentication() {
527
527
* Load language files
528
528
*/
529
529
public static function plugin_textdomain () {
530
- load_plugin_textdomain ( 'jetpack ' , false , dirname ( plugin_basename ( __FILE__ ) ) . '/languages/ ' );
530
+ // Note to self, the third argument must not be hardcoded, to account for relocated folders.
531
+ load_plugin_textdomain ( 'jetpack ' , false , dirname ( plugin_basename ( JETPACK__PLUGIN_FILE ) ) . '/languages/ ' );
531
532
}
532
533
533
534
/**
@@ -538,14 +539,17 @@ public static function plugin_textdomain() {
538
539
* @return null
539
540
*/
540
541
public function register_assets () {
541
- if ( ! wp_script_is ( 'spin ' , 'registered ' ) )
542
- wp_register_script ( 'spin ' , plugins_url ( '_inc/spin.js ' , __FILE__ ), false , '1.3 ' );
542
+ if ( ! wp_script_is ( 'spin ' , 'registered ' ) ) {
543
+ wp_register_script ( 'spin ' , plugins_url ( '_inc/spin.js ' , JETPACK__PLUGIN_FILE ), false , '1.3 ' );
544
+ }
543
545
544
- if ( ! wp_script_is ( 'jquery.spin ' , 'registered ' ) )
545
- wp_register_script ( 'jquery.spin ' , plugins_url ( '_inc/jquery.spin.js ' , __FILE__ ) , array ( 'jquery ' , 'spin ' ), '1.3 ' );
546
+ if ( ! wp_script_is ( 'jquery.spin ' , 'registered ' ) ) {
547
+ wp_register_script ( 'jquery.spin ' , plugins_url ( '_inc/jquery.spin.js ' , JETPACK__PLUGIN_FILE ) , array ( 'jquery ' , 'spin ' ), '1.3 ' );
548
+ }
546
549
547
- if ( ! wp_script_is ( 'jetpack-gallery-settings ' , 'registered ' ) )
548
- wp_register_script ( 'jetpack-gallery-settings ' , plugins_url ( '_inc/gallery-settings.js ' , __FILE__ ), array ( 'media-views ' ), '20121225 ' );
550
+ if ( ! wp_script_is ( 'jetpack-gallery-settings ' , 'registered ' ) ) {
551
+ wp_register_script ( 'jetpack-gallery-settings ' , plugins_url ( '_inc/gallery-settings.js ' , JETPACK__PLUGIN_FILE ), array ( 'media-views ' ), '20121225 ' );
552
+ }
549
553
550
554
/**
551
555
* As jetpack_register_genericons is by default fired off a hook,
@@ -555,8 +559,9 @@ public function register_assets() {
555
559
require_once ( JETPACK__PLUGIN_DIR . '_inc/genericons.php ' );
556
560
jetpack_register_genericons ();
557
561
558
- if ( ! wp_style_is ( 'jetpack-icons ' , 'registered ' ) )
559
- wp_register_style ( 'jetpack-icons ' , plugins_url ( '_inc/jetpack-icons.min.css ' , __FILE__ ), false , JETPACK__VERSION );
562
+ if ( ! wp_style_is ( 'jetpack-icons ' , 'registered ' ) ) {
563
+ wp_register_style ( 'jetpack-icons ' , plugins_url ( '_inc/jetpack-icons.min.css ' , JETPACK__PLUGIN_FILE ), false , JETPACK__VERSION );
564
+ }
560
565
}
561
566
562
567
/**
@@ -2136,12 +2141,12 @@ function admin_banner_styles() {
2136
2141
2137
2142
$ min = ( defined ( 'SCRIPT_DEBUG ' ) && SCRIPT_DEBUG ) ? '' : '.min ' ;
2138
2143
2139
- wp_enqueue_style ( 'jetpack ' , plugins_url ( "_inc/jetpack-banners {$ min }.css " , __FILE__ ), false , JETPACK__VERSION . '-20121016 ' );
2144
+ wp_enqueue_style ( 'jetpack ' , plugins_url ( "_inc/jetpack-banners {$ min }.css " , JETPACK__PLUGIN_FILE ), false , JETPACK__VERSION . '-20121016 ' );
2140
2145
$ wp_styles ->add_data ( 'jetpack ' , 'rtl ' , true );
2141
2146
}
2142
2147
2143
2148
function admin_scripts () {
2144
- wp_enqueue_script ( 'jetpack-js ' , plugins_url ( '_inc/jp.js ' , __FILE__ ), array ( 'jquery ' , 'wp-util ' ), JETPACK__VERSION . '-20121111 ' );
2149
+ wp_enqueue_script ( 'jetpack-js ' , plugins_url ( '_inc/jp.js ' , JETPACK__PLUGIN_FILE ), array ( 'jquery ' , 'wp-util ' ), JETPACK__VERSION . '-20121111 ' );
2145
2150
wp_localize_script (
2146
2151
'jetpack-js ' ,
2147
2152
'jetpackL10n ' ,
@@ -3144,7 +3149,7 @@ function admin_page() {
3144
3149
</div>
3145
3150
3146
3151
<div id="jetpack-configuration" style="display:none;">
3147
- <p><img width="16" src="<?php echo esc_url ( plugins_url ( '_inc/images/wpspin_light-2x.gif ' , __FILE__ ) ); ?> " alt="Loading ..." /></p>
3152
+ <p><img width="16" src="<?php echo esc_url ( plugins_url ( '_inc/images/wpspin_light-2x.gif ' , JETPACK__PLUGIN_FILE ) ); ?> " alt="Loading ..." /></p>
3148
3153
</div>
3149
3154
</div>
3150
3155
<?php
0 commit comments