Make WordPress Core

Changeset 9202


Ignore:
Timestamp:
10/16/2008 07:13:30 PM (16 years ago)
Author:
ryan
Message:

link_before and link_after from thee17. fixes #5652

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/bookmark-template.php

    r9139 r9202  
    3333 * 'after' - Default is '</li>' (string). The html or text to append to each
    3434 *      bookmarks.
     35 * 'link_before' - Default is '' (string). The html or text to prepend to each
     36 *      bookmarks inside the <a> tag.
     37 * 'link_after' - Default is '' (string). The html or text to append to each
     38 *      bookmarks inside the <a> tag.
    3539 * 'between' - Default is '\n' (string). The string for use in between the link,
    3640 *      description, and image.
     
    5054        'show_images' => 1, 'show_name' => 1,
    5155        'before' => '<li>', 'after' => '</li>', 'between' => "\n",
    52         'show_rating' => 0
     56        'show_rating' => 0, 'link_before' => '', 'link_after' => ''
    5357    );
    5458
     
    9498
    9599        $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
     100       
     101        $output .= $link_before;
    96102
    97103        if ( $bookmark->link_image != null && $show_images ) {
     
    104110        if ($show_name) $output .= $name;
    105111
     112        $output .= $link_after;
     113       
    106114        $output .= '</a>';
    107115
  • trunk/wp-includes/post-template.php

    r9138 r9202  
    378378
    379379/**
    380  * {@internal Missing Short Description}}
    381  *
    382  * {@internal Missing Long Description}}
     380 * Page Template Functions for usage in Themes
     381 *
     382 * @package WordPress
     383 * @subpackage Template
     384 */
     385
     386/**
     387 * The formatted output of a list of Pages.
     388 *
     389 * Displays page-links for paginated posts (i.e. includes the <!--nextpage-->  Quicktag one or
     390 * more times). This works in much the same way as link_pages(), the difference being that
     391 * arguments are given in query string format. This tag must be within The_Loop.
     392 *
     393 * The defaults for overwriting are:
     394 * 'next_or_number' - Default is 'number' (string). Indicates whether page numbers should be
     395 *      used. Valid values are number and next.
     396 * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page.
     397 *      of the bookmark.
     398 * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to previous page.
     399 *      available.
     400 * 'pagelink' - Default is '%' (String).Format string for page numbers. The  %  in the
     401 *      parameter string will be replaced with the page number, so Page % generates
     402 *      "Page 1", "Page 2", etc. Defaults to %, just the page number.
     403 * 'before' - Default is '<p> Pages:' (string). The html or text to prepend to each
     404 *      bookmarks.
     405 * 'after' - Default is '</p>' (string). The html or text to append to each
     406 *      bookmarks.
     407 * 'more_file' - Default is '' (string) Page the links should point to. Defaults to
     408 *      the current page.
     409 * 'link_before' - Default is '' (string). The html or text to prepend to each
     410 *      Pages link inside the <a> tag.
     411 * 'link_after' - Default is '' (string). The html or text to append to each
     412 *      Pages link inside the <a> tag.
    383413 *
    384414 * @since 1.2.0
    385  *
    386  * @param unknown_type $args
    387  * @return unknown
     415 * @access private
     416 *
     417 * @param array $bookmarks List of bookmarks to traverse
     418 * @param string|array $args Optional. Overwrite the defaults.
     419 * @return string Formatted output in HTML
    388420 */
    389421function wp_link_pages($args = '') {
    390422    $defaults = array(
    391423        'before' => '<p>' . __('Pages:'), 'after' => '</p>',
     424        'link_before' => '', 'link_after' => '',
    392425        'next_or_number' => 'number', 'nextpagelink' => __('Next page'),
    393426        'previouspagelink' => __('Previous page'), 'pagelink' => '%',
     
    420453                            $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
    421454                    }
     455                   
    422456                }
     457                $output .= $link_before;
    423458                $output .= $j;
     459                $output .= $link_after;
    424460                if ( ($i != $page) || ((!$more) && ($page==1)) )
    425461                    $output .= '</a>';
     
    432468                if ( $i && $more ) {
    433469                    if ( 1 == $i ) {
    434                         $output .= '<a href="' . get_permalink() . '">' . $previouspagelink . '</a>';
     470                        $output .= '<a href="' . get_permalink() . '">' . $link_before. $previouspagelink . $link_after . '</a>';
    435471                    } else {
    436472                        if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
    437                             $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $previouspagelink . '</a>';
     473                            $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $link_before. $previouspagelink . $link_after . '</a>';
    438474                        else
    439                             $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $previouspagelink . '</a>';
     475                            $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $previouspagelink . $link_after . '</a>';
    440476                    }
    441477                }
     
    443479                if ( $i <= $numpages && $more ) {
    444480                    if ( 1 == $i ) {
    445                         $output .= '<a href="' . get_permalink() . '">' . $nextpagelink . '</a>';
     481                        $output .= '<a href="' . get_permalink() . '">' . $link_before. $nextpagelink . $link_after . '</a>';
    446482                    } else {
    447483                        if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
    448                             $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $nextpagelink . '</a>';
     484                            $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $link_before. $nextpagelink . $link_after . '</a>';
    449485                        else
    450                             $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $nextpagelink . '</a>';
     486                            $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $nextpagelink . $link_after . '</a>';
    451487                    }
    452488                }
Note: See TracChangeset for help on using the changeset viewer.