publicize = $publicize = new Publicize; add_action( 'init', array( $this, 'init' ) ); } function init() { // Show only to users with the capability required to manage their Publicize connections. if ( ! current_user_can( 'publish_posts' ) ) { return; } // assets (css, js) 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, 'management_page' ) ); } /** * Management page to load if Sharedaddy is not active so the 'pre_admin_screen_sharing' action exists. */ function management_page() { ?>