WordPress.org

Support

Support » Alpha/Beta » wp_parse_args

wp_parse_args

  • [links moderated]
    Small example to reproduce the bug:

    Open your sidebar.php and add this:
    <?php wp_list_categories(‘title_li=<h2>Pages&Categories</h2>’); ?>
    or
    <?php wp_list_categories(‘title_li=<h2>Pages & Categories</h2>’); ?>
    or
    <?php wp_list_categories(‘title_li=<h2>Pages & Categories</h2>’); ?>

    As result “Categories</h2>” part will disappear.

    origin of bug : “Categories</h2>” is considered by wp_parse_args as an unkown argument (because of the “&”).

Viewing 1 replies (of 1 total)
  • when you use url-query style arguments you can’t have complex strings like that, all the values have to be simple strings without spaces (slugs).

    If you want to pass in complex strings you should use an array definition instead like this:

    wp_list_categories(array('title_li'=>"<h2>Pages & Categories</h2>"));

    Codex Article about wp_parse_args()

Viewing 1 replies (of 1 total)
  • The topic ‘wp_parse_args’ is closed to new replies.
Skip to toolbar