| @@ -318,14 +318,25 @@ | ||
| 318 | 318 | 'requires_connection' => false, |
| 319 | 319 | 'module' => 'sharing-block', |
| 320 | 320 | 'sort' => '13', |
| 321 | 321 | 'learn_more_button' => Redirect::get_url( 'jetpack-support-sharing-block' ), |
| 322 | - 'configure_url' => admin_url( 'site-editor.php?path=%2Fwp_template' ), | |
| 322 | + 'configure_url' => $this->get_sharing_block_editor_url(), | |
| 323 | 323 | ), |
| 324 | 324 | ); |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /** |
| 328 | + * Site Editor URL for the template the Sharing Buttons block goes in. | |
| 329 | + * | |
| 330 | + * @return string | |
| 331 | + */ | |
| 332 | + private function get_sharing_block_editor_url() { | |
| 333 | + return admin_url( | |
| 334 | + 'site-editor.php?p=' . rawurlencode( '/wp_template/' . get_stylesheet() . '//single' ) . '&canvas=edit' | |
| 335 | + ); | |
| 336 | + } | |
| 337 | + | |
| 338 | + /** | |
| 328 | 339 | * Intercept the plugins API response and add in an appropriate card for Jetpack |
| 329 | 340 | * |
| 330 | 341 | * @param object $result Plugin search results. |
| 331 | 342 | * @param string $action unused. |
| @@ -566,9 +577,9 @@ | ||
| 566 | 577 | if ( 'sharing-block' === $plugin['module'] ) { |
| 567 | 578 | $links['jp_get_started'] = '<a |
| 568 | 579 | id="plugin-select-settings" |
| 569 | 580 | class="jetpack-plugin-search__primary jetpack-plugin-search__get-started button" |
| 570 | - href="' . esc_url( admin_url( 'site-editor.php?path=%2Fwp_template' ) ) . '" | |
| 581 | + href="' . esc_url( $this->get_sharing_block_editor_url() ) . '" | |
| 571 | 582 | data-module="' . esc_attr( $plugin['module'] ) . '" |
| 572 | 583 | data-track="get_started" |
| 573 | 584 | >' . esc_html__( 'Add block', 'jetpack' ) . '</a>'; |
| 574 | 585 | } elseif ( 'akismet' === $plugin['module'] || 'vaultpress' === $plugin['module'] ) { |