{"action":"created","comment":{"url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/comments/153213948","pull_request_review_id":79171527,"id":153213948,"diff_hunk":"@@ -51,9 +51,71 @@\n \t\treturn productDescription;\n \t}\n \n+\t/**\n+\t * Gets the taxonomy name from categories.\n+\t * The logic of this function is inspired by: http://viralpatel.net/blogs/jquery-get-text-element-without-child-element/\n+\t *\n+\t * @param {Object} checkbox The checkbox to parse to retrieve the label.\n+\t * @returns {string} The category name.\n+\t */\n+\tfunction extractBrandName( checkbox ) {\n+\t\t// Take the parent of checkbox with type label and clone it.\n+\t\tvar clonedLabel = checkbox.parent( \"label\" ).clone();\n+\n+\t\t// Finds child elements and removes them so we only get the label's text left.\n+\t\tclonedLabel.children().remove();\n+\n+\t\t// Returns the trimmed text value,\n+\t\treturn clonedLabel.text().trim();\n+\t}\n+\n+\t/**\n+\t * Finds the brand element. First it looks to an primary term. If nothing found it gets the first checked\n+\t * term.\n+\t *\n+\t * @param {jQuery} brandContainer The metabox container to look in.\n+\t * @returns {jQuery|null} The element if found, otherwise null.\n+\t */\n+\tfunction findPrimaryBrand( brandContainer ) {\n+\t\tvar primaryBrand = brandContainer.find( 'li.wpseo-primary-term input:checked' );\n+\t\tif ( primaryBrand.length > 0 ) {","path":"js/src/yoastseo-woo-replacevars.js","position":81,"original_position":31,"commit_id":"1ac6aa51fce41e3bba492adf2fabd1f615ce6ee7","original_commit_id":"fc98e0004c08ec5a8864a4af8508687fe8c4c5aa","user":{"login":"jcomack","id":4181340,"avatar_url":"https://avatars2.githubusercontent.com/u/4181340?v=4","gravatar_id":"","url":"https://api.github.com/users/jcomack","html_url":"https://github.com/jcomack","followers_url":"https://api.github.com/users/jcomack/followers","following_url":"https://api.github.com/users/jcomack/following{/other_user}","gists_url":"https://api.github.com/users/jcomack/gists{/gist_id}","starred_url":"https://api.github.com/users/jcomack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcomack/subscriptions","organizations_url":"https://api.github.com/users/jcomack/orgs","repos_url":"https://api.github.com/users/jcomack/repos","events_url":"https://api.github.com/users/jcomack/events{/privacy}","received_events_url":"https://api.github.com/users/jcomack/received_events","type":"User","site_admin":false},"body":"Missing whitespace above this line. ","created_at":"2017-11-27T14:40:51Z","updated_at":"2017-11-27T14:44:37Z","html_url":"https://github.com/Yoast/wpseo-woocommerce/pull/159#discussion_r153213948","pull_request_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/comments/153213948"},"html":{"href":"https://github.com/Yoast/wpseo-woocommerce/pull/159#discussion_r153213948"},"pull_request":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159"}}},"pull_request":{"url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159","id":129573056,"html_url":"https://github.com/Yoast/wpseo-woocommerce/pull/159","diff_url":"https://github.com/Yoast/wpseo-woocommerce/pull/159.diff","patch_url":"https://github.com/Yoast/wpseo-woocommerce/pull/159.patch","issue_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/159","number":159,"state":"open","locked":false,"title":"Add replacement variables","user":{"login":"jdevalk","id":487629,"avatar_url":"https://avatars0.githubusercontent.com/u/487629?v=4","gravatar_id":"","url":"https://api.github.com/users/jdevalk","html_url":"https://github.com/jdevalk","followers_url":"https://api.github.com/users/jdevalk/followers","following_url":"https://api.github.com/users/jdevalk/following{/other_user}","gists_url":"https://api.github.com/users/jdevalk/gists{/gist_id}","starred_url":"https://api.github.com/users/jdevalk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdevalk/subscriptions","organizations_url":"https://api.github.com/users/jdevalk/orgs","repos_url":"https://api.github.com/users/jdevalk/repos","events_url":"https://api.github.com/users/jdevalk/events{/privacy}","received_events_url":"https://api.github.com/users/jdevalk/received_events","type":"User","site_admin":false},"body":"## Summary\r\n\r\nThis PR can be summarized in the following changelog entry:\r\n\r\n* Adds `%%wc_price%%`, `%%wc_sku%%`, `%%wc_shortdesc%%` and `%%wc_brand%%` replacement variables for titles and meta description.\r\n\r\n## Relevant technical choices:\r\n\r\n* Removed duplicate short desc function.\r\n\r\n## Test instructions\r\n\r\nThis PR can be tested by following these steps:\r\n\r\n* Add the above variables to title or meta description template and test output.  The brand one works with the official WooCommerce brands extension or [this one](https://wordpress.org/plugins/perfect-woocommerce-brands/).\r\n\r\nFixes #158","created_at":"2017-07-09T18:21:36Z","updated_at":"2017-11-27T14:44:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8e46c2c99f22fe41c706d5cbbaca328823c393e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159/commits","review_comments_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159/comments","review_comment_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/159/comments","statuses_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/statuses/1ac6aa51fce41e3bba492adf2fabd1f615ce6ee7","head":{"label":"Yoast:jdv/replacements","ref":"jdv/replacements","sha":"1ac6aa51fce41e3bba492adf2fabd1f615ce6ee7","user":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars0.githubusercontent.com/u/4690436?v=4","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"repo":{"id":9305438,"name":"wpseo-woocommerce","full_name":"Yoast/wpseo-woocommerce","owner":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars0.githubusercontent.com/u/4690436?v=4","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yoast/wpseo-woocommerce","description":"This extension to WooCommerce and Yoast SEO makes sure there's perfect communication between the two plugins.","fork":false,"url":"https://api.github.com/repos/Yoast/wpseo-woocommerce","forks_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/forks","keys_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/teams","hooks_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/hooks","issue_events_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/events{/number}","events_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/events","assignees_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/assignees{/user}","branches_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/branches{/branch}","tags_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/tags","blobs_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/languages","stargazers_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/stargazers","contributors_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/contributors","subscribers_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/subscribers","subscription_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/subscription","commits_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/contents/{+path}","compare_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/merges","archive_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/downloads","issues_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues{/number}","pulls_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/labels{/name}","releases_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/releases{/id}","deployments_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/deployments","created_at":"2013-04-08T19:56:25Z","updated_at":"2017-11-25T12:01:47Z","pushed_at":"2017-11-27T13:10:00Z","git_url":"git://github.com/Yoast/wpseo-woocommerce.git","ssh_url":"git@github.com:Yoast/wpseo-woocommerce.git","clone_url":"https://github.com/Yoast/wpseo-woocommerce.git","svn_url":"https://github.com/Yoast/wpseo-woocommerce","homepage":"https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/","size":838,"stargazers_count":40,"watchers_count":40,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":41,"forks":10,"open_issues":41,"watchers":40,"default_branch":"trunk"}},"base":{"label":"Yoast:trunk","ref":"trunk","sha":"51b23ba4bb5798565934eaa336eb4166f822041b","user":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars0.githubusercontent.com/u/4690436?v=4","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"repo":{"id":9305438,"name":"wpseo-woocommerce","full_name":"Yoast/wpseo-woocommerce","owner":{"login":"Yoast","id":4690436,"avatar_url":"https://avatars0.githubusercontent.com/u/4690436?v=4","gravatar_id":"","url":"https://api.github.com/users/Yoast","html_url":"https://github.com/Yoast","followers_url":"https://api.github.com/users/Yoast/followers","following_url":"https://api.github.com/users/Yoast/following{/other_user}","gists_url":"https://api.github.com/users/Yoast/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoast/subscriptions","organizations_url":"https://api.github.com/users/Yoast/orgs","repos_url":"https://api.github.com/users/Yoast/repos","events_url":"https://api.github.com/users/Yoast/events{/privacy}","received_events_url":"https://api.github.com/users/Yoast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yoast/wpseo-woocommerce","description":"This extension to WooCommerce and Yoast SEO makes sure there's perfect communication between the two plugins.","fork":false,"url":"https://api.github.com/repos/Yoast/wpseo-woocommerce","forks_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/forks","keys_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/teams","hooks_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/hooks","issue_events_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/events{/number}","events_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/events","assignees_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/assignees{/user}","branches_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/branches{/branch}","tags_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/tags","blobs_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/languages","stargazers_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/stargazers","contributors_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/contributors","subscribers_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/subscribers","subscription_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/subscription","commits_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/contents/{+path}","compare_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/merges","archive_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/downloads","issues_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues{/number}","pulls_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/labels{/name}","releases_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/releases{/id}","deployments_url":"https://api.github.com/repos/Yoast/wpseo-woocommerce/deployments","created_at":"2013-04-08T19:56:25Z","updated_at":"2017-11-25T12:01:47Z","pushed_at":"2017-11-27T13:10:00Z","git_url":"git://github.com/Yoast/wpseo-woocommerce.git","ssh_url":"git@github.com:Yoast/wpseo-woocommerce.git","clone_url":"https://github.com/Yoast/wpseo-woocommerce.git","svn_url":"https://github.com/Yoast/wpseo-woocommerce","homepage":"https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/","size":838,"stargazers_count":40,"watchers_count":40,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":41,"forks":10,"open_issues":41,"watchers":40,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159"},"html":{"href":"https://github.com/Yoast/wpseo-woocommerce/pull/159"},"issue":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/159"},"comments":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/issues/159/comments"},"review_comments":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159/comments"},"review_comment":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/pulls/159/commits"},"statuses":{"href":"https://api.github.com/repos/Yoast/wpseo-woocommerce/statuses/1ac6aa51fce41e3bba492adf2fabd1f615ce6ee7"}},"author_association":"OWNER"}}
{"actor":{"display_login":"jcomack"}}