Title: [198557] trunk/Websites/webkit.org
Revision
198557
Author
[email protected]
Date
2016-03-22 15:05:27 -0700 (Tue, 22 Mar 2016)

Log Message

Allow the use of custom styles and scripts for blog posts
https://bugs.webkit.org/show_bug.cgi?id=155768

Reviewed by Timothy Hatcher.

* wp-content/themes/webkit/functions.php:

Modified Paths

Diff

Modified: trunk/Websites/webkit.org/ChangeLog (198556 => 198557)


--- trunk/Websites/webkit.org/ChangeLog	2016-03-22 21:49:45 UTC (rev 198556)
+++ trunk/Websites/webkit.org/ChangeLog	2016-03-22 22:05:27 UTC (rev 198557)
@@ -1,3 +1,12 @@
+2016-03-22  Jonathan Davis  <[email protected]>
+
+        Allow the use of custom styles and scripts for blog posts
+        https://bugs.webkit.org/show_bug.cgi?id=155768
+
+        Reviewed by Timothy Hatcher.
+
+        * wp-content/themes/webkit/functions.php:
+
 2016-03-09  Jonathan Davis  <[email protected]>
 
         For RSS feeds, convert image and link relative URIs to absolute URIs

Modified: trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php (198556 => 198557)


--- trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php	2016-03-22 21:49:45 UTC (rev 198556)
+++ trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php	2016-03-22 22:05:27 UTC (rev 198557)
@@ -60,6 +60,18 @@
     return $content;
 });
 
+add_action('wp_head', function () {
+    if (!is_single()) return;
+
+    $style = get_post_meta(get_the_ID(), 'style', true);
+    if (!empty($style))
+        echo '<style type="text/css">' . $style . '</style>';
+
+    $script = get_post_meta(get_the_ID(), 'script', true);
+    if (!empty($script))
+        echo '<script type="text/_javascript_">' . $script . '</script>';
+});
+
 // Hide category 41: Legacy from archives
 add_filter('pre_get_posts', function ($query) {
     if ( $query->is_home() )
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to