Commit 77cf09f madalingorbanescu
committed
1 parent 4c526d6 commit 77cf09f Copy full SHA for 77cf09f
File tree 3 files changed +33
-2
lines changed
3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,13 @@ function novablocks_register_packages_scripts() {
186
186
'novablocks_core_frontend_stylesheet ' => novablocks_get_plugin_url () . '/build/core/style.css ' ,
187
187
'novablocks_components_frontend_stylesheet ' => novablocks_get_plugin_url () . '/build/components/style.css ' ,
188
188
'novablocks_opentable_frontend_stylesheet ' => novablocks_get_plugin_url () . '/build/block-library/blocks/opentable/style.css ' ,
189
- 'novablocks_opentable_editor_stylesheet ' => novablocks_get_plugin_url () . '/build/block-library/blocks/opentable/editor-styles.css '
189
+ 'novablocks_opentable_editor_stylesheet ' => novablocks_get_plugin_url () . '/build/block-library/blocks/opentable/editor-styles.css ' ,
190
+ 'novablocks_customizer_header_link ' => novablocks_get_customizer_link (false ,
191
+ array (
192
+ "autofocus[panel] " => "theme_options_panel " ,
193
+ "autofocus[section] " => "rosa2_options[header_section] "
194
+ )
195
+ )
190
196
) );
191
197
192
198
wp_set_script_translations ( 'novablocks-core ' , '__plugin_txtd ' , novablocks_get_plugin_path () . 'languages ' );
Original file line number Diff line number Diff line change @@ -1614,3 +1614,26 @@ function novablocks_get_localize_to_window_script( $object_name, $l10n ) {
1614
1614
1615
1615
return $ script ;
1616
1616
}
1617
+
1618
+ function novablocks_get_customizer_link ( $ return_url = false , $ extra_query_args = array () ) {
1619
+ global $ wp ;
1620
+
1621
+
1622
+ if ( empty ( $ return_url ) ) {
1623
+ // Get the current frontend URL.
1624
+ $ return_url = home_url ( add_query_arg ( array (), $ wp ->request ) );
1625
+ }
1626
+
1627
+ // Now get the Customizer URL.
1628
+ $ link = wp_customize_url ();
1629
+
1630
+ $ link = add_query_arg ( 'return_url ' , rawurlencode ( $ return_url ), $ link );
1631
+
1632
+ if ( ! empty ( $ extra_query_args ) && is_array ( $ extra_query_args ) && ! wp_is_numeric_array ( $ extra_query_args ) ) {
1633
+ foreach ( $ extra_query_args as $ key => $ value ) {
1634
+ $ link = add_query_arg ( rawurlencode ( $ key ), rawurlencode ( utf8_uri_encode ( $ value ) ), $ link );
1635
+ }
1636
+ }
1637
+
1638
+ return $ link ;
1639
+ }
Original file line number Diff line number Diff line change @@ -38,13 +38,15 @@ const HeaderInspectorControls = ( props ) => {
38
38
39
39
const [ lastStickyRowId , setLastStickyRowId ] = useState ( stickyRow ?. clientId ) ;
40
40
41
+ const customizerHeaderLink = novablocks_urls . novablocks_customizer_header_link ;
42
+
41
43
return (
42
44
< ControlsSection label = { __ ( 'Layout' ) } >
43
45
< ControlsTab label = { __ ( 'Settings' ) } >
44
46
< Notice
45
47
key = { 'header-position-quick-start' }
46
48
id = { 'novablocks-header-position-quick-start' }
47
- content = { < p > < strong > Quick start:</ strong > Set up your header layout using the options below and go to < a href = "#" > Customizer</ a > to change the logo and menu content, or fine-tune styling details. </ p > }
49
+ content = { < p > < strong > Quick start:</ strong > Set up your header layout using the options below and go to < a href = { customizerHeaderLink } > Customizer</ a > to change the logo and menu content, or fine-tune styling details. </ p > }
48
50
/>
49
51
50
52
< RadioControl
You can’t perform that action at this time.
0 commit comments