diff options
Diffstat (limited to 'plugins/jetpack/modules/videopress/class.jetpack-videopress.php')
-rw-r--r-- | plugins/jetpack/modules/videopress/class.jetpack-videopress.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/jetpack/modules/videopress/class.jetpack-videopress.php b/plugins/jetpack/modules/videopress/class.jetpack-videopress.php index a1073f05..5b73dde6 100644 --- a/plugins/jetpack/modules/videopress/class.jetpack-videopress.php +++ b/plugins/jetpack/modules/videopress/class.jetpack-videopress.php @@ -1,5 +1,7 @@ <?php +use Automattic\Jetpack\Assets; + /** * VideoPress in Jetpack */ @@ -76,7 +78,7 @@ class Jetpack_VideoPress { } // Connection owners are allowed to do all the things. - if ( $this->is_connection_owner( $user_id ) ) { + if ( Jetpack::connection()->is_connection_owner( $user_id ) ) { return true; } @@ -98,15 +100,15 @@ class Jetpack_VideoPress { /** * Returns true if the provided user is the Jetpack connection owner. + * + * @deprecated since 7.7 + * + * @param Integer|Boolean $user_id the user identifier. False for current user. + * @return bool Whether the current user is the connection owner. */ public function is_connection_owner( $user_id = false ) { - if ( ! $user_id ) { - $user_id = get_current_user_id(); - } - - $user_token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER ); - - return $user_token && is_object( $user_token ) && isset( $user_token->external_user_id ) && $user_id === $user_token->external_user_id; + _deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::is_connection_owner' ); + return Jetpack::connection()->is_connection_owner( $user_id ); } /** @@ -128,7 +130,7 @@ class Jetpack_VideoPress { if ( $this->should_override_media_uploader() ) { wp_enqueue_script( 'videopress-plupload', - Jetpack::get_file_url_for_environment( + Assets::get_file_url_for_environment( '_inc/build/videopress/js/videopress-plupload.min.js', 'modules/videopress/js/videopress-plupload.js' ), @@ -141,7 +143,7 @@ class Jetpack_VideoPress { wp_enqueue_script( 'videopress-uploader', - Jetpack::get_file_url_for_environment( + Assets::get_file_url_for_environment( '_inc/build/videopress/js/videopress-uploader.min.js', 'modules/videopress/js/videopress-uploader.js' ), @@ -153,7 +155,7 @@ class Jetpack_VideoPress { wp_enqueue_script( 'media-video-widget-extensions', - Jetpack::get_file_url_for_environment( + Assets::get_file_url_for_environment( '_inc/build/videopress/js/media-video-widget-extensions.min.js', 'modules/videopress/js/media-video-widget-extensions.js' ), |