10
10
use Automattic \Jetpack \Sync \Sender ;
11
11
use Automattic \Jetpack \Sync \Users ;
12
12
use Automattic \Jetpack \Tracking ;
13
+ use Automattic \Jetpack \Assets ;
13
14
14
15
/*
15
16
Options:
@@ -1086,7 +1087,7 @@ public function register_assets() {
1086
1087
if ( ! wp_script_is ( 'spin ' , 'registered ' ) ) {
1087
1088
wp_register_script (
1088
1089
'spin ' ,
1089
- self ::get_file_url_for_environment ( '_inc/build/spin.min.js ' , '_inc/spin.js ' ),
1090
+ Assets ::get_file_url_for_environment ( '_inc/build/spin.min.js ' , '_inc/spin.js ' ),
1090
1091
false ,
1091
1092
'1.3 '
1092
1093
);
@@ -1095,7 +1096,7 @@ public function register_assets() {
1095
1096
if ( ! wp_script_is ( 'jquery.spin ' , 'registered ' ) ) {
1096
1097
wp_register_script (
1097
1098
'jquery.spin ' ,
1098
- self ::get_file_url_for_environment ( '_inc/build/jquery.spin.min.js ' , '_inc/jquery.spin.js ' ),
1099
+ Assets ::get_file_url_for_environment ( '_inc/build/jquery.spin.min.js ' , '_inc/jquery.spin.js ' ),
1099
1100
array ( 'jquery ' , 'spin ' ),
1100
1101
'1.3 '
1101
1102
);
@@ -1104,7 +1105,7 @@ public function register_assets() {
1104
1105
if ( ! wp_script_is ( 'jetpack-gallery-settings ' , 'registered ' ) ) {
1105
1106
wp_register_script (
1106
1107
'jetpack-gallery-settings ' ,
1107
- self ::get_file_url_for_environment ( '_inc/build/gallery-settings.min.js ' , '_inc/gallery-settings.js ' ),
1108
+ Assets ::get_file_url_for_environment ( '_inc/build/gallery-settings.min.js ' , '_inc/gallery-settings.js ' ),
1108
1109
array ( 'media-views ' ),
1109
1110
'20121225 '
1110
1111
);
@@ -1113,7 +1114,7 @@ public function register_assets() {
1113
1114
if ( ! wp_script_is ( 'jetpack-twitter-timeline ' , 'registered ' ) ) {
1114
1115
wp_register_script (
1115
1116
'jetpack-twitter-timeline ' ,
1116
- self ::get_file_url_for_environment ( '_inc/build/twitter-timeline.min.js ' , '_inc/twitter-timeline.js ' ),
1117
+ Assets ::get_file_url_for_environment ( '_inc/build/twitter-timeline.min.js ' , '_inc/twitter-timeline.js ' ),
1117
1118
array ( 'jquery ' ),
1118
1119
'4.0.0 ' ,
1119
1120
true
@@ -1123,7 +1124,7 @@ public function register_assets() {
1123
1124
if ( ! wp_script_is ( 'jetpack-facebook-embed ' , 'registered ' ) ) {
1124
1125
wp_register_script (
1125
1126
'jetpack-facebook-embed ' ,
1126
- self ::get_file_url_for_environment ( '_inc/build/facebook-embed.min.js ' , '_inc/facebook-embed.js ' ),
1127
+ Assets ::get_file_url_for_environment ( '_inc/build/facebook-embed.min.js ' , '_inc/facebook-embed.js ' ),
1127
1128
array ( 'jquery ' ),
1128
1129
null ,
1129
1130
true
@@ -6993,11 +6994,7 @@ public static function is_function_in_backtrace( $names ) {
6993
6994
* @return string The URL to the file
6994
6995
*/
6995
6996
public static function get_file_url_for_environment ( $ min_path , $ non_min_path ) {
6996
- $ path = ( Constants::is_defined ( 'SCRIPT_DEBUG ' ) && Constants::get_constant ( 'SCRIPT_DEBUG ' ) )
6997
- ? $ non_min_path
6998
- : $ min_path ;
6999
-
7000
- return plugins_url ( $ path , JETPACK__PLUGIN_FILE );
6997
+ return Assets::get_file_url_for_environment ( $ min_path , $ non_min_path );
7001
6998
}
7002
6999
7003
7000
/**
0 commit comments