File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -1663,7 +1663,20 @@ public function feedzy_dismiss_wizard( $redirect_to_dashboard = true ) {
1663
1663
update_option ( 'feedzy_fresh_install ' , $ status );
1664
1664
delete_option ( 'feedzy_wizard_data ' );
1665
1665
if ( false !== $ redirect_to_dashboard ) {
1666
- wp_safe_redirect ( remove_query_arg ( array ( 'action ' , 'status ' ) ) );
1666
+
1667
+ $ cleaned_url = remove_query_arg ( array ( 'page ' , 'action ' , 'status ' ) );
1668
+ $ parsed_url = wp_parse_url ( $ cleaned_url );
1669
+
1670
+ // Default to dashboard if no page is set.
1671
+ if (
1672
+ isset ( $ parsed_url ['path ' ] ) &&
1673
+ strpos ( $ parsed_url ['path ' ], '/wp-admin/admin.php ' ) !== false &&
1674
+ empty ( $ parsed_url ['query ' ] )
1675
+ ) {
1676
+ $ cleaned_url = add_query_arg ( 'page ' , 'feedzy-support ' , $ cleaned_url );
1677
+ }
1678
+
1679
+ wp_safe_redirect ( $ cleaned_url );
1667
1680
exit ;
1668
1681
}
1669
1682
return true ;
Original file line number Diff line number Diff line change 5
5
* @package Feedzy_Rss_Feeds
6
6
*/
7
7
8
- $ dashboard_url = add_query_arg (
8
+ // Note: It will be redirect to dashboard by `feedzy_dismiss_wizard` action.
9
+ $ skip_onboarding_url_callback = add_query_arg (
9
10
array (
10
- 'page ' => 'feedzy-support ' ,
11
11
'action ' => 'feedzy_dismiss_wizard ' ,
12
12
'status ' => 0 ,
13
13
),
34
34
</div>
35
35
</div>
36
36
<div class="back-btn">
37
- <a href="<?php echo esc_url ( $ dashboard_url ); ?> " class="btn-link"><span class="dashicons dashicons-arrow-left-alt"></span> <?php esc_html_e ( 'Go to dashboard ' , 'feedzy-rss-feeds ' ); ?> </a>
37
+ <a href="<?php echo esc_url ( $ skip_onboarding_url_callback ); ?> " class="btn-link"><span class="dashicons dashicons-arrow-left-alt"></span> <?php esc_html_e ( 'Go to dashboard ' , 'feedzy-rss-feeds ' ); ?> </a>
38
38
</div>
39
39
</div>
40
40
</div>
You can’t perform that action at this time.
0 commit comments