WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 14 months ago

#21343 closed defect (bug) (duplicate)

WP Codex: wp_link_pages() $args example has errors

Reported by: anointed Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: WordPress.org site Keywords:
Focuses: Cc:

Description

On this link:
http://codex.wordpress.org/Function_Reference/wp_link_pages

the example arguments are given as such:

$args = array(
    'before'           => '<p>' . __('Pages:'),
    'after'            => '</p>',
    'link_before'      => ,
    'link_after'       => ,
    'next_or_number'   => 'number',
    'nextpagelink'     => __('Next page'),
    'previouspagelink' => __('Previous page'),
    'pagelink'         => '%',
    'more_file'        => ,
    'echo'             => 1 );

It should read:

$args = array(
    'before'           => '<p>' . __('Pages:'),
    'after'            => '</p>',
    'link_before'      => '',
    'link_after'       => '',
    'next_or_number'   => 'number',
    'nextpagelink'     => __('Next page'),
    'previouspagelink' => __('Previous page'),
    'pagelink'         => '%',
    'more_file'        => '',
    'echo'             => 1 );

Basically the quote marks are missing on the args (link_before, link_after, and more_file) thus causing an error.

*Not even sure if this is where to report this type of issue, sorry if it's not.

Change History (8)

comment:1 ocean9021 months ago

  • Component changed from General to WordPress.org site

The Codex is a wiki, so any logged-in user can edit it. You want to give it a try?

BTW: more_file can be also removed. It's unused since [12105].

comment:2 follow-up: anointed21 months ago

  • Resolution set to invalid
  • Status changed from new to closed

Sorry about that. I had no idea I could edit it. I see someone already fixed the quotes (they show as fixed when I go into edit, but not live, prob not approved yet).

I made the more_file change you mentioned so I could try it out.

comment:3 ocean9021 months ago

  • Milestone Awaiting Review deleted

It's live, but it seems like the syntax highlighter doesn't display it.

comment:4 in reply to: ↑ 2 SergeyBiryukov21 months ago

Replying to anointed:

I see someone already fixed the quotes (they show as fixed when I go into edit, but not live, prob not approved yet).

No, they're not fixed yet. They're just interpreted as <i> tags on output. I've experimented with MediaWiki markup a bit, but couldn't find a way yet to suppress interpretation of wiki markup and keep syntax highlighting at the same time.

comment:5 follow-up: pavelevap21 months ago

I noticed similar problem with many other functions, for example http://codex.wordpress.org/Function_Reference/wp_nav_menu

It can be solved by wrapping the whole default usage code, for example http://codex.wordpress.org/Function_Reference/wp_list_pages

comment:6 pavelevap21 months ago

  • Cc pavelevap@… added

comment:7 in reply to: ↑ 5 SergeyBiryukov21 months ago

Replying to pavelevap:

It can be solved by wrapping the whole default usage code, for example http://codex.wordpress.org/Function_Reference/wp_list_pages

Thanks, fixed wp_link_pages(), wp_nav_menu() and wp_list_categories() examples.

comment:8 SergeyBiryukov14 months ago

  • Resolution changed from invalid to duplicate

Duplicate of #15232.

Note: See TracTickets for help on using tickets.