| @@ -101,30 +101,12 @@ | ||
| 101 | 101 | Jetpack::enable_module_configurable( __FILE__ ); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | add_filter( 'jetpack_module_configuration_url_likes', array( $this, 'jetpack_likes_configuration_url' ) ); |
| 105 | - add_action( 'admin_print_scripts-settings_page_sharing', array( $this, 'load_jp_css' ) ); | |
| 106 | - add_filter( 'sharing_show_buttons_on_row_start', array( $this, 'configuration_target_area' ) ); | |
| 107 | 105 | |
| 108 | - $publicize_active = Jetpack::is_module_active( 'publicize' ); | |
| 109 | 106 | $sharedaddy_active = Jetpack::is_module_active( 'sharedaddy' ); |
| 110 | 107 | |
| 111 | - if ( $this->settings->needs_own_sharing_menu( $sharedaddy_active ) ) { | |
| 112 | - /* | |
| 113 | - * Sharedaddy is what registers Settings > Sharing, and it is off, so we | |
| 114 | - * register that screen ourselves; our settings are displayed on it. | |
| 115 | - */ | |
| 116 | - add_action( 'admin_menu', array( $this->settings, 'sharing_menu' ) ); | |
| 117 | - } elseif ( $publicize_active && ! $sharedaddy_active ) { | |
| 118 | - // we have a sharing page but not the global options area. | |
| 119 | - add_action( 'pre_admin_screen_sharing', array( $this->settings, 'sharing_block' ), 20 ); | |
| 120 | - add_action( 'pre_admin_screen_sharing', array( $this->settings, 'updated_message' ), -10 ); | |
| 121 | - } | |
| 122 | - | |
| 123 | 108 | if ( ! $sharedaddy_active ) { |
| 124 | - add_action( 'admin_init', array( $this->settings, 'process_update_requests_if_sharedaddy_not_loaded' ) ); | |
| 125 | - add_action( 'sharing_global_options', array( $this->settings, 'admin_settings_showbuttonon_init' ), 19 ); | |
| 126 | - add_action( 'sharing_admin_update', array( $this->settings, 'admin_settings_showbuttonon_callback' ), 19 ); | |
| 127 | 109 | add_action( 'admin_init', array( $this->settings, 'add_meta_box' ) ); |
| 128 | 110 | } else { |
| 129 | 111 | add_filter( 'sharing_meta_box_title', array( $this->settings, 'add_likes_to_sharing_meta_box_title' ) ); |
| 130 | 112 | add_action( 'start_sharing_meta_box_content', array( $this->settings, 'meta_box_content' ) ); |
| @@ -135,10 +117,8 @@ | ||
| 135 | 117 | add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_register_scripts' ) ); |
| 136 | 118 | |
| 137 | 119 | add_action( 'save_post', array( $this->settings, 'meta_box_save' ) ); |
| 138 | 120 | add_action( 'edit_attachment', array( $this->settings, 'meta_box_save' ) ); |
| 139 | - add_action( 'sharing_global_options', array( $this->settings, 'admin_settings_init' ), 20 ); | |
| 140 | - add_action( 'sharing_admin_update', array( $this->settings, 'admin_settings_callback' ), 20 ); | |
| 141 | 121 | } |
| 142 | 122 | |
| 143 | 123 | /** |
| 144 | 124 | * Set the social_notifications_like option to `on` when the Likes module is activated. |
| @@ -169,17 +149,31 @@ | ||
| 169 | 149 | } |
| 170 | 150 | |
| 171 | 151 | /** |
| 172 | 152 | * Loads Jetpack's CSS on the sharing page so we can use .jetpack-targetable |
| 153 | + * | |
| 154 | + * @deprecated 16.3 Settings > Sharing is a plain WordPress settings screen now. | |
| 155 | + * | |
| 156 | + * @return void | |
| 173 | 157 | */ |
| 174 | 158 | public function load_jp_css() { |
| 175 | - /** | |
| 176 | - * Do we really need `admin_styles`? With the new admin UI, it's breaking some bits. | |
| 177 | - * Jetpack::init()->admin_styles(); | |
| 178 | - */ | |
| 159 | + _deprecated_function( __METHOD__, 'jetpack-16.3' ); | |
| 179 | 160 | } |
| 180 | 161 | |
| 181 | 162 | /** |
| 163 | + * Adds in the jetpack-targetable class so when we visit sharing#likes our like settings get highlighted by a yellow box | |
| 164 | + * | |
| 165 | + * @deprecated 16.3 The Likes settings have a section of their own on Settings > Sharing. | |
| 166 | + * | |
| 167 | + * @param string $html row heading for the sharedaddy "which page" setting. | |
| 168 | + * @return string The unchanged $html. | |
| 169 | + */ | |
| 170 | + public function configuration_target_area( $html = '' ) { | |
| 171 | + _deprecated_function( __METHOD__, 'jetpack-16.3' ); | |
| 172 | + return $html; | |
| 173 | + } | |
| 174 | + | |
| 175 | + /** | |
| 182 | 176 | * Load scripts and styles for front end. |
| 183 | 177 | */ |
| 184 | 178 | public function load_styles_register_scripts() { |
| 185 | 179 | // Likes are only rendered on pages that display post content. |
| @@ -211,20 +205,9 @@ | ||
| 211 | 205 | ); |
| 212 | 206 | } |
| 213 | 207 | |
| 214 | 208 | /** |
| 215 | - * Adds in the jetpack-targetable class so when we visit sharing#likes our like settings get highlighted by a yellow box | |
| 216 | - * | |
| 217 | - * @param string $html row heading for the sharedaddy "which page" setting. | |
| 218 | - * @return string $html with the jetpack-targetable class and likes id. tbody gets closed after the like settings | |
| 219 | - */ | |
| 220 | - public function configuration_target_area( $html = '' ) { | |
| 221 | - $html = "<tbody id='likes' class='jetpack-targetable'>" . $html; | |
| 222 | - return $html; | |
| 223 | - } | |
| 224 | - | |
| 225 | - /** | |
| 226 | - * Options to be added to the discussion page (see also admin_settings_init, etc below for Sharing settings page) | |
| 209 | + * Options to be added to the discussion page. The Sharing settings live in Sharing_Likes\Settings\Likes_Section. | |
| 227 | 210 | */ |
| 228 | 211 | public function admin_discussion_likes_settings_init() { |
| 229 | 212 | // Add a temporary section, until we can move the setting out of there and with the rest of the email notification settings. |
| 230 | 213 | add_settings_section( 'likes-notifications', __( 'Likes Notifications', 'jetpack' ), array( $this, 'admin_discussion_likes_settings_section' ), 'discussion' ); |