Skip to content

Commit

Permalink
Use connection package instead of Jetpack class
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed May 3, 2024
1 parent 66b0aa6 commit 0e773f1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Automattic\Jetpack\Publicize\Jetpack_Social_Settings;

use Automattic\Jetpack\Connection\Manager;
use Automattic\Jetpack\Modules;
use Automattic\Jetpack\Publicize\Publicize;
use Automattic\Jetpack\Publicize\Social_Image_Generator\Templates;
Expand Down Expand Up @@ -185,7 +186,9 @@ public function get_initial_state() {

$settings['is_publicize_enabled'] = false;

if ( ( new Modules() )->is_active( 'publicize' ) && \Jetpack::connection()->has_connected_user() ) {
$connection = new Manager();

if ( ( new Modules() )->is_active( 'publicize' ) && $connection->has_connected_user() ) {
$settings['connectionData'] = array(
'connections' => $publicize->get_all_connections_for_user(),
'adminUrl' => esc_url_raw( $publicize->publicize_connections_url( 'jetpack-social-connections-admin-page' ) ),
Expand Down

0 comments on commit 0e773f1

Please sign in to comment.