Skip to content

Commit

Permalink
Fixed issue with 'Open Code Chest' link on a sub site redirecting bac…
Browse files Browse the repository at this point in the history
…k to the main site.
  • Loading branch information
saifsultanc committed Mar 6, 2024
1 parent d53c23b commit b9d696a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions class-gwiz-gf-code-chest.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,15 +648,16 @@ public function replace_custom_js_setting( $form_settings, $form ) {
'name' => 'code_chest_js',
'type' => 'editor_js',
'callback' => function ( $setting ) use ( $form ) {
$form_id = $form['id'];
$form_id = $form['id'];
$url_path = parse_url( RGFormsModel::get_current_page_url(), PHP_URL_PATH );
$markup_pieces = array(
'<div id="gform_setting_code_chest_js_overridden_warning" class="gform-settings-field gform-settings-field__html">',
'<div class="gform-settings-field"><b>',
__( 'GF Code Chest replaces GF Custom JavaScript.', 'gf-code-chest' ),
'</b>',
__( 'Code Chest is now managing your existing Custom JavaScript scripts. You can safely deactivate the Custom JavaScript plugin immediately.', 'gf-code-chest' ),
'</div>',
"<a href=\"/wp-admin/admin.php?subview=gf-code-chest&page=gf_edit_forms&id={$form_id}&view=settings\" class=\"gform-button gform-button--white\">",
"<a href=\"{$url_path}?subview=gf-code-chest&page=gf_edit_forms&id={$form_id}&view=settings\" class=\"gform-button gform-button--white\">",
__( 'Open Code Chest', 'gf-code-chest' ),
'</a>',
'</div>',
Expand Down

0 comments on commit b9d696a

Please sign in to comment.