publicize = $publicize = new Publicize; add_action( 'init', array( $this, 'init' ) ); } function init() { $this->publicize_settings_url = apply_filters_deprecated( 'jetpack_override_publicize_settings_url', array( admin_url( 'options-general.php?page=sharing' ) ), '6.7', false, __( 'This filter will be removed in a future version of Jetpack', 'jetpack' ) ); // Show only to users with the capability required to manage their Publicize connections. if ( ! $this->publicize->current_user_can_access_publicize_data() ) { return; } // assets (css, js) if ( $this->in_jetpack ) { add_action( 'load-settings_page_sharing', array( $this, 'load_assets' ) ); } add_action( 'admin_head-post.php', array( $this, 'post_page_metabox_assets' ) ); add_action( 'admin_head-post-new.php', array( $this, 'post_page_metabox_assets' ) ); // management of publicize (sharing screen, ajax/lightbox popup, and metabox on post screen) add_action( 'pre_admin_screen_sharing', array( $this, 'admin_page' ) ); add_action( 'post_submitbox_misc_actions', array( $this, 'post_page_metabox' ) ); } /** * If the ShareDaddy plugin is not active we need to add the sharing settings page to the menu still */ function sharing_menu() { add_submenu_page( 'options-general.php', __( 'Sharing Settings', 'jetpack' ), __( 'Sharing', 'jetpack' ), 'publish_posts', 'sharing', array( $this, 'wrapper_admin_page' ) ); } function wrapper_admin_page() { Jetpack_Admin_Page::wrap_ui( array( $this, 'management_page' ), array( 'is-wide' => true ) ); } /** * Management page to load if Sharedaddy is not active so the 'pre_admin_screen_sharing' action exists. */ function management_page() { ?>