Changeset 202012 in webkit


Ignore:
Timestamp:
Jun 13, 2016 3:53:57 PM (8 years ago)
Author:
Jon Davis
Message:

Adds support for foreword custom meta and display styles on blog posts.
https://bugs.webkit.org/show_bug.cgi?id=158707.

Reviewed by Timothy Hatcher.

  • wp-content/themes/webkit/functions.php:
  • wp-content/themes/webkit/style.css:

(article .foreword):

Location:
trunk/Websites/webkit.org
Files:
3 edited

Legend:

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

    r201625 r202012  
     12016-06-13  Jon Davis  <jond@apple.com>
     2
     3        Adds support for foreword custom meta and display styles on blog posts.
     4        https://bugs.webkit.org/show_bug.cgi?id=158707.
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * wp-content/themes/webkit/functions.php:
     9        * wp-content/themes/webkit/style.css:
     10        (article .foreword):
     11
    1122016-06-02  Dean Jackson  <dino@apple.com>
    213
  • trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php

    r198816 r202012  
    136136});
    137137
     138add_action('the_post', function($post) {
     139    global $pages;
     140
     141    if (!(is_single() || is_page())) return;
     142
     143    $foreword = get_post_meta(get_the_ID(), 'foreword', true);
     144    if ( ! $foreword ) return;
     145
     146    $content = $post->post_content;
     147    // Transform Markdown
     148    $Markdown = WPCom_Markdown::get_instance();
     149    $foreword = wp_unslash( $Markdown->transform($foreword) );
     150   
     151    $post->post_content = '<div class="foreword">' . $foreword . '</div>' . $content;
     152    $pages = array($post->post_content);
     153});
     154
    138155function before_the_title() {
    139156    $post = get_post();
  • trunk/Websites/webkit.org/wp-content/themes/webkit/style.css

    r199488 r202012  
    10121012}
    10131013
     1014article .foreword {
     1015    padding: 3rem;
     1016    background-color: #f0f0f0;
     1017    border: 1px solid #e6e6e6;
     1018    color: #8E8E93;
     1019    border-radius: 3px;
     1020    margin-bottom: 3rem;
     1021    box-sizing: normal;
     1022    font-size: 1.6rem;
     1023    font-style: italic;
     1024}
     1025
    10141026article .two-columns {
    10151027    columns: 2;
Note: See TracChangeset for help on using the changeset viewer.