[webkit-reviews] review granted: [Bug 206327] Add support for categories and custom post types to the social meta plugin : [Attachment 387874] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 15 17:26:38 PST 2020


Devin Rousso <drousso at apple.com> has granted Jon Davis <jond at apple.com>'s
request for review:
Bug 206327: Add support for categories and custom post types to the social meta
plugin
https://bugs.webkit.org/show_bug.cgi?id=206327

Attachment 387874: Patch

https://bugs.webkit.org/attachment.cgi?id=387874&action=review




--- Comment #2 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 387874
  --> https://bugs.webkit.org/attachment.cgi?id=387874
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387874&action=review

r=me

> Websites/webkit.org/wp-content/plugins/social-meta.php:35
> +	   $description = get_bloginfo('name') . " blog archive.";

NIT: should we use "category" instead of `is_category()`?

> Websites/webkit.org/wp-content/plugins/social-meta.php:42
> +	       $url = get_category_link($category_term_id);

Should we only override `$url` if `get_category_link(...)` returns a non-empty
string (which indicates an error)?

> Websites/webkit.org/wp-content/plugins/social-meta.php:49
> +	   $post_type_obj = get_post_type_object( $post_type );

Style: extra spacing around `(` and `)`

> Websites/webkit.org/wp-content/plugins/social-meta.php:50
> +

Style: unnecessary newline

> Websites/webkit.org/wp-content/plugins/social-meta.php:51
> +	   if ( isset( $post_type_obj->description ) )

Ditto (49)

Also, should we null-check `$post_type_obj` too in case there was an error?

> Websites/webkit.org/wp-content/plugins/social-meta.php:54
> +	   $url = get_post_type_archive_link($post_type);

Ditto (42)


More information about the webkit-reviews mailing list