{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/114182046","pull_request_review_id":35627666,"id":114182046,"diff_hunk":"@@ -0,0 +1,82 @@\n+<?php\n+\n+class Jetpack_Sync_Module_Menus extends Jetpack_Sync_Module {\n+\tprivate $nav_items_just_added = array();\n+\n+\tfunction name() {\n+\t\treturn 'menus';\n+\t}\n+\n+\tpublic function init_listeners( $callable ) {\n+\t\tadd_action( 'wp_create_nav_menu', $callable, 10, 2 );\n+\t\tadd_action( 'wp_update_nav_menu', array( $this, 'update_nav_menu' ), 10, 2 );\n+\t\tadd_action( 'wp_add_nav_menu_item', array( $this, 'update_nav_menu_add_item' ), 10, 3 );\n+\t\tadd_action( 'wp_update_nav_menu_item', array( $this, 'update_nav_menu_update_item' ), 10, 3 );\n+\t\tadd_action( 'post_updated', array( $this, 'remove_just_added_menu_item' ), 10, 2 );\n+\n+\t\tadd_action( 'jetpack_sync_updated_nav_menu', $callable, 10, 2 );\n+\t\tadd_action( 'jetpack_sync_updated_nav_menu_add_item', $callable, 10, 4 );\n+\t\tadd_action( 'jetpack_sync_updated_nav_menu_update_item', $callable, 10, 4 );\n+\t\tadd_action( 'delete_nav_menu', $callable, 10, 3 );\n+\n+\t}\n+\t\n+\tpublic function update_nav_menu( $menu_id, $menu_data = array() ) {\n+\t\tif ( empty( $menu_data ) ) {\n+\t\t\treturn;\n+\t\t}\n+\t\t/**\n+\t\t * Helps sync log that a nav menu was updated.\n+\t\t *\n+\t\t * Helps Sync log that a got cleared from inactive.","path":"sync/class.jetpack-sync-module-menus.php","position":31,"original_position":31,"commit_id":"48abe130401b2cd80a18668af98cdf1c0627190b","original_commit_id":"48abe130401b2cd80a18668af98cdf1c0627190b","user":{"login":"gititon","id":3246867,"avatar_url":"https://avatars1.githubusercontent.com/u/3246867?v=3","gravatar_id":"","url":"https://api.github.com/users/gititon","html_url":"https://github.com/gititon","followers_url":"https://api.github.com/users/gititon/followers","following_url":"https://api.github.com/users/gititon/following{/other_user}","gists_url":"https://api.github.com/users/gititon/gists{/gist_id}","starred_url":"https://api.github.com/users/gititon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gititon/subscriptions","organizations_url":"https://api.github.com/users/gititon/orgs","repos_url":"https://api.github.com/users/gititon/repos","events_url":"https://api.github.com/users/gititon/events{/privacy}","received_events_url":"https://api.github.com/users/gititon/received_events","type":"User","site_admin":false},"body":"Actually, do you mean to have this line in the comment at all since it is beneath one that says the call is to \"Helps sync log that a nav menu was updated.\"?","created_at":"2017-05-01T19:22:06Z","updated_at":"2017-05-01T19:22:06Z","html_url":"https://github.com/Automattic/jetpack/pull/7014#discussion_r114182046","pull_request_url":"https://api.github.com/repos/Automattic/jetpack/pulls/7014","_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/114182046"},"html":{"href":"https://github.com/Automattic/jetpack/pull/7014#discussion_r114182046"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/7014"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/7014","id":116841927,"html_url":"https://github.com/Automattic/jetpack/pull/7014","diff_url":"https://github.com/Automattic/jetpack/pull/7014.diff","patch_url":"https://github.com/Automattic/jetpack/pull/7014.patch","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/7014","number":7014,"state":"open","locked":false,"title":"Sync: Add Sync Events for menus.","user":{"login":"enejb","id":115071,"avatar_url":"https://avatars1.githubusercontent.com/u/115071?v=3","gravatar_id":"","url":"https://api.github.com/users/enejb","html_url":"https://github.com/enejb","followers_url":"https://api.github.com/users/enejb/followers","following_url":"https://api.github.com/users/enejb/following{/other_user}","gists_url":"https://api.github.com/users/enejb/gists{/gist_id}","starred_url":"https://api.github.com/users/enejb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enejb/subscriptions","organizations_url":"https://api.github.com/users/enejb/orgs","repos_url":"https://api.github.com/users/enejb/repos","events_url":"https://api.github.com/users/enejb/events{/privacy}","received_events_url":"https://api.github.com/users/enejb/received_events","type":"User","site_admin":false},"body":"This will allows us to know when a user is creating /updating / removing a menu \r\nand when the user is adding new items and updating them on the menu.\r\n\r\n#### Changes proposed in this Pull Request:\r\n* Add events that let us track changes to menus.\r\n\r\n#### Testing instructions:\r\n\r\n* Do the test pass? \r\n\r\n<!-- Add the following only if this is meant to be in changelog -->\r\n#### Proposed changelog entry for your changes:\r\n","created_at":"2017-04-20T19:01:50Z","updated_at":"2017-05-01T19:22:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbe7c271e89876eb1a272547fe9a8482fb436561","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/jetpack/pulls/7014/commits","review_comments_url":"https://api.github.com/repos/Automattic/jetpack/pulls/7014/comments","review_comment_url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/7014/comments","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/48abe130401b2cd80a18668af98cdf1c0627190b","head":{"label":"Automattic:add/sync-menu-events","ref":"add/sync-menu-events","sha":"48abe130401b2cd80a18668af98cdf1c0627190b","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2017-04-28T22:09:32Z","pushed_at":"2017-05-01T19:19:12Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":192117,"stargazers_count":646,"watchers_count":646,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":400,"mirror_url":null,"open_issues_count":766,"forks":400,"open_issues":766,"watchers":646,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"fd873aaf413adf7f32f2ebcfa130b243ac91fe06","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2017-04-28T22:09:32Z","pushed_at":"2017-05-01T19:19:12Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":192117,"stargazers_count":646,"watchers_count":646,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":400,"mirror_url":null,"open_issues_count":766,"forks":400,"open_issues":766,"watchers":646,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/7014"},"html":{"href":"https://github.com/Automattic/jetpack/pull/7014"},"issue":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/7014"},"comments":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/7014/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/7014/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/7014/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/jetpack/statuses/48abe130401b2cd80a18668af98cdf1c0627190b"}}}}
{"actor":{"display_login":"gititon"}}