Changeset 229816 in webkit


Ignore:
Timestamp:
Mar 21, 2018 11:44:35 AM (6 years ago)
Author:
Jon Davis
Message:

Add support for an overridable byline in blog posts
https://bugs.webkit.org/show_bug.cgi?id=183799

Reviewed by Timothy Hatcher.

  • wp-content/themes/webkit/functions.php:
Location:
trunk/Websites/webkit.org
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/webkit.org/ChangeLog

    r228820 r229816  
     12018-03-21  Jon Davis  <jond@apple.com>
     2
     3        Add support for an overridable byline in blog posts
     4        https://bugs.webkit.org/show_bug.cgi?id=183799
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * wp-content/themes/webkit/functions.php:
     9
    1102018-02-20  Jon Davis  <jond@apple.com>
    211
  • trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php

    r224757 r229816  
    103103    if ( is_admin() ) return $title;
    104104    if ( is_feed() ) return $title;
    105    
     105
    106106    $title = str_replace(": ", ": <br>", $title);
    107107
     
    115115        $title = str_replace(trim($token), $nobreak, $title);
    116116    }
    117    
     117
    118118    return $title;
    119119});
     
    169169    $post->post_content = '<div class="foreword">' . $foreword . '</div>' . $content;
    170170    $pages = array($post->post_content);
     171});
     172
     173add_filter('the_author', function($display_name) {
     174    $post = get_post();
     175    if (!(is_single() || is_page())) return;
     176    $byline = get_post_meta(get_the_ID(), 'byline', true);
     177    return empty($byline) ? $display_name : $byline;
    171178});
    172179
     
    554561            update_option(self::DATA_SETTING_NAME, $score);
    555562        }
    556        
     563
    557564        $httponly = false;
    558565        $secure = false;
Note: See TracChangeset for help on using the changeset viewer.