WordPress.org

Make WordPress Core

Ticket #30563: 30563.diff

File 30563.diff, 1017 bytes (added by voldemortensen, 7 years ago)
  • src/wp-includes/link-template.php

     
    12021202 * @param string $before Optional. Display before edit link.
    12031203 * @param string $after Optional. Display after edit link.
    12041204 * @param int $id Optional. Post ID.
     1205 * @param string $class Optional. Add custom class to link.
    12051206 */
    1206 function edit_post_link( $text = null, $before = '', $after = '', $id = 0 ) {
     1207function edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = '' ) {
    12071208        if ( ! $post = get_post( $id ) ) {
    12081209                return;
    12091210        }
     
    12161217                $text = __( 'Edit This' );
    12171218        }
    12181219
    1219         $link = '<a class="post-edit-link" href="' . $url . '">' . $text . '</a>';
     1220        if ( '' === $class ) {
     1221                $class="post-edit-link";
     1222        }
    12201223
     1224        $link = '<a class="' . $class . '"  href="' . $url . '">' . $text . '</a>';
     1225
    12211226        /**
    12221227         * Filter the post edit link anchor tag.
    12231228         *