Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter bigwolk

    (@bigwolk)

    HI bcworkz, thanks for your reply. I didn`t found any signs that this is outdated method. The codex said only that this is new version of register_sidebar_widget. But You have right with this new angle. I resolved this problem in this way:

    $nav_name = 'Menu name';
    $nav_menu_id = wp_create_nav_menu($nav_name);
    $registered_widgets = get_option('wiget_nav_menu');
    $registered_widgets[] = array('title'=>'widget title', 'nav_menu'=>$nav_menu_id);
    update_option('widget_nav_menu',$registered_widgets);

    This creates widget which we can enable in sidebar. Cheers.

Viewing 1 replies (of 1 total)