Title: [254639] trunk/Websites/webkit.org
Revision
254639
Author
j...@apple.com
Date
2020-01-15 14:23:31 -0800 (Wed, 15 Jan 2020)

Log Message

Add Web Inspector Reference notice to Web Inspector blog posts
https://bugs.webkit.org/show_bug.cgi?id=206308

Reviewed by Devin Rousso.

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

Modified Paths

Diff

Modified: trunk/Websites/webkit.org/ChangeLog (254638 => 254639)


--- trunk/Websites/webkit.org/ChangeLog	2020-01-15 22:15:43 UTC (rev 254638)
+++ trunk/Websites/webkit.org/ChangeLog	2020-01-15 22:23:31 UTC (rev 254639)
@@ -1,3 +1,12 @@
+2020-01-15  Jon Davis  <j...@apple.com>
+
+        Add Web Inspector Reference notice to Web Inspector blog posts
+        https://bugs.webkit.org/show_bug.cgi?id=206308
+
+        Reviewed by Devin Rousso.
+
+        * wp-content/themes/webkit/functions.php:
+
 2020-01-15  Devin Rousso  <drou...@apple.com>
 
         Web Inspector Reference: the meta info at the end of the article should always be on its own line

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


--- trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php	2020-01-15 22:15:43 UTC (rev 254638)
+++ trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php	2020-01-15 22:23:31 UTC (rev 254639)
@@ -141,6 +141,22 @@
     return $content;
 });
 
+// Add Web Inspector Reference notice to Web Inspector blog posts
+add_filter('the_content', function($content) {
+    if (!has_term('web-inspector', 'category', get_post()))
+        return $content;
+
+    $note = '<div class="note">Note: Learn more about Web Inspector from the <a href="" Inspector Reference</a> documentation.</div>';
+    $position = get_post_meta(get_the_ID(), 'web-inspector-reference-note', true);
+
+    if ($position === 'before')
+        $content = $note . $content;
+    else
+        $content .= $note;
+
+    return $content;
+});
+
 add_action('wp_head', function () {
     if (!is_single()) return;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to