Support » Theme: Hueman » Problem header menu after update

  • Resolved micheltam

    (@micheltam)


    Hi i have done a update 3.2.0 > 3.2.8 on my site test where i have only one menu at position top.
    With the update i have new header menu section (in section Header) with :
    “Use a default page menu if no menu has been assigned.” which is cheked by default.
    (and which have to precise “if no menu has been assigned in position header”

    It’s not really a problem with one site but i have a multisite with 447 blogs using Hueman, and there, there is a big problem. I really can’t do this update without a simple way to desactivate by defaut this setting. 🙁

    (Guillaume, dis moi si je n’ai pas ÊtÊ assez clair 😉 )

Viewing 7 replies - 1 through 7 (of 7 total)
  • Here’s a workaround you can try:
    Download the theme zip file
    Edit /functions/class-utils-settings-map.php
    Change function hu_header_menu_sec() array ‘default’ argument from 1 to 0

    /*-----------------------------------------------------------------------------------------------
    			        Header Menu SECTION
    ------------------------------------------------------------------------------------------------*/
    function hu_header_menu_sec() {
      return array(
        'default-menu-header' => array(
    	'default'   => 0,
    	'control'   => 'HU_controls',
    	'label'     => __("Use a default page menu if no menu has been assigned.", 'hueman'),
    	'section'   => 'header_menu_sec',
    	'type'      => 'checkbox'
        )
      );
    }
    Theme Author Nicolas

    (@nikeo)

    Ok understood. Thanks for reporting this. Yes this is a problem and this feature needs to be adapted for multisite in the future.

    A possible solution for the moment would be to use a “must use” plugin.
    https://codex.wordpress.org/Must_Use_Plugins

    Create a new must use plugin file if needed and write the following line of code in it :

    add_filter('hu_opt_default-menu-header', '__return_false');
    

    This will filter the option whenever it is called in the theme, assigning it to false.

    I would recommend this solution rather than modifying the theme itself which is always something to avoid if possible. In this specific case we can and should avoid a hard d’odes modification in the theme.

    Thanks for this feedback. The next release will disable this default page menu when multisite is detected.

    @nikeo wrote:

    I would recommend this solution rather than modifying the theme itself which is always something to avoid if possible.

    I agree with this. I was just providing a workaround for the time being; didn’t realize there was a filter available.

    Theme Author Nicolas

    (@nikeo)

    @bdbrown, yes your workaround is still valid and useful to solve the problem quickly !

    About this filter : it’s actually a filter for which the name is set dynamically. It is declared in functions/class-utils.

    
    apply_filters( "hu_opt_{$option_name}" , $_single_opt , $option_name , $option_group, $_default_val );
    

    It takes hu_opt_ as prefix and the name of the option (as defined in functions/class-utils-settings-map.php ) as suffix.

    What it does is each time an option is called, it captures the result and let us act on it.
    For boolean type options, typically checkboxes, this filter offers a very simple way to alter the option value with the __return_false and __return_true WordPress built-in callbacks functions.

    • This reply was modified 3 years, 9 months ago by Nicolas.

    Thanks Guillaume (dbdrown too). We have our homemade MU plugin. And we use often this plugin because of multisite 😉
    Thanks for the filter and to consider needs for multisite in the future =)

    Theme Author Nicolas

    (@nikeo)

    OK perfect then. thanks for the feedback.

    I got a problem with getting the menu to change when I made a change to the page. Its not updating if I changed the header, fex if had a course named. Food 1, and change the course name to food 2, it dont update. Is this the same problem as described here?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problem header menu after update’ is closed to new replies.