Skip to content

Commit 0b0b37f

Browse files
committed
update settings url, remove script after execution
1 parent ce9f933 commit 0b0b37f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function register_block_editor_assets() {
345345
'devMode' => defined( 'WP_ENV' ) ? WP_ENV === 'development' : false,
346346
'cdnUrl' => STACKABLE_DESIGN_LIBRARY_URL,
347347
'currentTheme' => esc_html( get_template() ),
348-
'settingsUrl' => admin_url( 'options-general.php?page=stackable' ),
348+
'settingsUrl' => admin_url( 'admin.php?page=stackable-settings' ),
349349
'version' => array_shift( $version_parts ),
350350
'wpVersion' => ! empty( $wp_version ) ? preg_replace( '/-.*/', '', $wp_version ) : $wp_version, // Ensure semver, strip out after dash
351351
'adminUrl' => admin_url(),

src/welcome/index.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,17 @@ public function redirect_to_docs() {
355355

356356
public function redirect_to_docs_newtab() {
357357
?>
358-
<script>
358+
<script id='stk-documentation-set-target'>
359359
document.addEventListener('DOMContentLoaded', function() {
360360
const link = document.querySelector('a[href="admin.php?page=stackable-documentation"]');
361361
if (link) link.setAttribute('target', '_blank');
362362
});
363+
364+
// Remove this script from the DOM after execution to clean up
365+
const currentScript = document.getElementById('stk-documentation-set-target');
366+
if (currentScript) {
367+
currentScript.parentNode.removeChild(currentScript);
368+
}
363369
</script>
364370
<?php
365371
}
@@ -375,7 +381,7 @@ public function add_settings_link( $links ) {
375381
// Settings link.
376382
if ( current_user_can( 'manage_options' ) ) {
377383
$settings_link = sprintf( '<a href="%s">%s</a>',
378-
admin_url( 'options-general.php?page=stackable' ),
384+
admin_url( 'admin.php?page=stackable-settings' ),
379385
__( 'Settings', STACKABLE_I18N )
380386
);
381387

0 commit comments

Comments
 (0)