Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#21343 closed defect (bug) (duplicate)

WP Codex: wp_link_pages() $args example has errors

Reported by: anointed's profile 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)

#1 @ocean90
12 years 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].

#2 follow-up: @anointed
12 years 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.

#3 @ocean90
12 years ago

  • Milestone Awaiting Review deleted

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

#4 in reply to: ↑ 2 @SergeyBiryukov
12 years 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.

#5 follow-up: @pavelevap
12 years 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

#6 @pavelevap
12 years ago

  • Cc pavelevap@… added

#7 in reply to: ↑ 5 @SergeyBiryukov
12 years 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.

#8 @SergeyBiryukov
11 years ago

  • Resolution changed from invalid to duplicate

Duplicate of #15232.

Note: See TracTickets for help on using tickets.