• It’s intensely frustrating working within WP as regards function name parameters and trying to remember what to use. Some use an underscore others a hyphen why on earth not stick with one or the other instead. it’s a mishmash of naming conventions!! Is there any guidance or is it up to one’s whims?

    add_theme_support('title-tag');
    $query->set('orderby', 'meta_value_num');
Viewing 1 replies (of 1 total)
  • Pretty much, the things that are named the same as functions or variables (whether in PHP or SQL or JS) will have underscores because a “minus” or “dash” is an operator in the language, so can’t be used in a name. The rest of the names typically use a “dash” (CSS classes or IDs or just names like in the theme support for ‘title-tag’), sort of indicating that it’s not a function or variable name.

Viewing 1 replies (of 1 total)

The topic ‘parameter names naming conventions’ is closed to new replies.