Make WordPress Core


Ignore:
Timestamp:
09/13/2015 11:33:30 PM (9 years ago)
Author:
wonderboymusic
Message:

In edit_post_link(), add an argument for the class attribute that defaults to post-edit-link.

Props voldemortensen.
Fixes #30563.

File:
1 edited

Legend:

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

    r34088 r34098  
    12111211 * @param string $after  Optional. Display after edit link.
    12121212 * @param int    $id     Optional. Post ID.
    1213  */
    1214 function edit_post_link( $text = null, $before = '', $after = '', $id = 0 ) {
     1213 * @param string $class  Optional. Add custom class to link.
     1214 */
     1215function edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) {
    12151216    if ( ! $post = get_post( $id ) ) {
    12161217        return;
     
    12251226    }
    12261227
    1227     $link = '<a class="post-edit-link" href="' . $url . '">' . $text . '</a>';
     1228    $link = '<a class="' . $class . '" href="' . $url . '">' . $text . '</a>';
    12281229
    12291230    /**
Note: See TracChangeset for help on using the changeset viewer.