WordPress.org

Ready to get started?Download WordPress

Forums

theme_location is a poor naming convention (1 post)

  1. 2stripes
    Member
    Posted 1 year ago #

    I have studied the nav menu concepts for several days now and one idea that is conflicting the naming conventions guide line of wordpress is theme_location. This parameter of the function wp_nav_menu in fact has no association with any page location other than what a designer might choose by naming the theme_location with the name of a page location described by the designer.

    The whole code will not collapse if the theme_location is named anything other than a/any actual location. theme_location can be named by any set of descriptors. The location itself of a menu is determined by hard coding the location within the HTML; and, theme_location does nothing to benefit a dynamic layout of the page.

    Again, registering a theme_location is not guaranteeing that the location will become associated with any particular part of any page. Registering theme_location only allows the menu to become selectable by the user and again has nothing to do with an actual location. I suggest that theme_location become a more conventional standard adaptation appropriate of wordpress such as menu_selected!

    $theme_location
    (string) (optional) The location in the theme to be used--must be registered with register_nav_menu() in order to be selectable by the user

    Default: None

    should read:

    $menu_selected
    (string) (optional) The selected menu in the theme to be used--must be registered with register_nav_menu() in order to be selectable by the user

    Default: None

Topic Closed

This topic has been closed to new replies.

About this Topic