| @@ -152,15 +152,16 @@ | ||
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * Add link to sharing settings in the Plugins screen. |
| 155 | 155 | * |
| 156 | + * @deprecated 16.3 Sharing has not shipped as a standalone plugin for years. | |
| 157 | + * | |
| 156 | 158 | * @param array $links An array of plugin action links. |
| 157 | 159 | * |
| 158 | - * @return array | |
| 160 | + * @return array The unchanged $links. | |
| 159 | 161 | */ |
| 160 | 162 | function sharing_plugin_settings( $links ) { |
| 161 | - $settings_link = '<a href="options-general.php?page=sharing.php">' . __( 'Settings', 'jetpack' ) . '</a>'; | |
| 162 | - array_unshift( $links, $settings_link ); | |
| 163 | + _deprecated_function( __FUNCTION__, 'jetpack-16.3' ); | |
| 163 | 164 | return $links; |
| 164 | 165 | } |
| 165 | 166 | |
| 166 | 167 | /** |
| @@ -165,19 +166,17 @@ | ||
| 165 | 166 | |
| 166 | 167 | /** |
| 167 | 168 | * Add links to settings and support in the plugin row. |
| 168 | 169 | * |
| 170 | + * @deprecated 16.3 Sharing has not shipped as a standalone plugin for years. | |
| 171 | + * | |
| 169 | 172 | * @param array $links An array of the plugin's metadata, including the version, author, author URI, and plugin URI. |
| 170 | 173 | * @param string $file Path to the plugin file relative to the plugins directory. |
| 171 | 174 | * |
| 172 | - * @return array | |
| 175 | + * @return array The unchanged $links. | |
| 173 | 176 | */ |
| 174 | -function sharing_add_plugin_settings( $links, $file ) { | |
| 175 | - if ( $file === basename( __DIR__ ) . '/' . basename( __FILE__ ) ) { | |
| 176 | - $links[] = '<a href="options-general.php?page=sharing.php">' . __( 'Settings', 'jetpack' ) . '</a>'; | |
| 177 | - $links[] = '<a href="https://support.wordpress.com/sharing/" rel="noopener noreferrer" target="_blank">' . __( 'Support', 'jetpack' ) . '</a>'; | |
| 178 | - } | |
| 179 | - | |
| 177 | +function sharing_add_plugin_settings( $links, $file ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable | |
| 178 | + _deprecated_function( __FUNCTION__, 'jetpack-16.3' ); | |
| 180 | 179 | return $links; |
| 181 | 180 | } |
| 182 | 181 | |
| 183 | 182 | /** |
| @@ -194,35 +193,25 @@ | ||
| 194 | 193 | |
| 195 | 194 | /** |
| 196 | 195 | * Add settings to disable CSS and JS normally enqueued by our feature. |
| 197 | 196 | * |
| 197 | + * @deprecated 16.3 Settings > Sharing renders the field itself. | |
| 198 | + * | |
| 198 | 199 | * @return void |
| 199 | 200 | */ |
| 200 | 201 | function sharing_global_resources() { |
| 201 | - $disable = get_option( 'sharedaddy_disable_resources' ); | |
| 202 | - ?> | |
| 203 | -<tr valign="top"> | |
| 204 | - <th scope="row"><label for="disable_css"><?php esc_html_e( 'Disable CSS and JS', 'jetpack' ); ?></label></th> | |
| 205 | - <td> | |
| 206 | - <?php | |
| 207 | - printf( | |
| 208 | - '<input id="disable_css" type="checkbox" name="disable_resources"%1$s /> <small><em>%2$s</em></small>', | |
| 209 | - ( 1 == $disable ) ? ' checked="checked"' : '', // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual | |
| 210 | - esc_html__( 'Advanced. If this option is checked, you must include these files in your theme manually for the sharing links to work.', 'jetpack' ) | |
| 211 | - ); | |
| 212 | - ?> | |
| 213 | - </td> | |
| 214 | -</tr> | |
| 215 | - <?php | |
| 202 | + _deprecated_function( __FUNCTION__, 'jetpack-16.3', 'Automattic\Jetpack\Sharing_Likes\Settings\Sharing_Resources::render' ); | |
| 216 | 203 | } |
| 217 | 204 | |
| 218 | 205 | /** |
| 219 | 206 | * Save settings to disable CSS and JS normally enqueued by our feature. |
| 220 | 207 | * |
| 208 | + * @deprecated 16.3 Settings > Sharing saves the field itself. | |
| 209 | + * | |
| 221 | 210 | * @return void |
| 222 | 211 | */ |
| 223 | 212 | function sharing_global_resources_save() { |
| 224 | - update_option( 'sharedaddy_disable_resources', isset( $_POST['disable_resources'] ) ? 1 : 0 ); // phpcs:ignore WordPress.Security.NonceVerification.Missing -- nonce handling is handled for all elements at once. | |
| 213 | + _deprecated_function( __FUNCTION__, 'jetpack-16.3', 'Automattic\Jetpack\Sharing_Likes\Settings\Sharing_Resources::save' ); | |
| 225 | 214 | } |
| 226 | 215 | |
| 227 | 216 | add_action( 'init', 'sharing_init' ); |
| 228 | 217 | add_action( 'add_meta_boxes', 'sharing_add_meta_box' ); |
| @@ -227,8 +216,4 @@ | ||
| 227 | 216 | add_action( 'init', 'sharing_init' ); |
| 228 | 217 | add_action( 'add_meta_boxes', 'sharing_add_meta_box' ); |
| 229 | 218 | add_action( 'save_post', 'sharing_meta_box_save' ); |
| 230 | 219 | add_action( 'edit_attachment', 'sharing_meta_box_save' ); |
| 231 | -add_action( 'sharing_global_options', 'sharing_global_resources', 30 ); | |
| 232 | -add_action( 'sharing_admin_update', 'sharing_global_resources_save' ); | |
| 233 | -add_action( 'plugin_action_links_' . basename( __DIR__ ) . '/' . basename( __FILE__ ), 'sharing_plugin_settings', 10, 4 ); | |
| 234 | -add_filter( 'plugin_row_meta', 'sharing_add_plugin_settings', 10, 2 ); | |