{"action":"created","comment":{"url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments/175490107","pull_request_review_id":105022434,"id":175490107,"diff_hunk":"@@ -0,0 +1,224 @@\n+<?php\n+\n+/**\n+ * Class Event_Scheduler\n+ *\n+ * Uses cron to move old events to trash and/or permanently delete them.\n+ */\n+class Tribe__Events__Event_Scheduler {\n+\n+\t/**\n+\t * The name of the cron event to permanently delete past events.\n+\t * @static $del_cron_hook\n+\t */\n+\tpublic static $del_cron_hook = 'tribe_del_event_cron';\n+\n+\t/**\n+\t * The name of the cron event to move past events to trash.\n+\t * @static $trash_cron_hook\n+\t */\n+\tpublic static $trash_cron_hook = 'tribe_trash_event_cron';\n+\n+\t/**\n+\t * The new value for the $trash_events option.\n+\t *\n+\t * @var $trash_new_date\n+\t */\n+\tpublic $trash_new_date;\n+\n+\t/**\n+\t * The new value for the $delete_events option.\n+\t *\n+\t * @var $del_new_date\n+\t */\n+\tpublic $del_new_date;\n+\n+\t/**\n+\t * Receives the existing values for $trash_events and $delete_events options\n+\t * and defines them as trash_new_date and del_new_date variables.\n+\t *\n+\t * @param mixed $move_to_trash\n+\t * @param mixed $permanently_delete\n+\t *\n+\t * @since TBD\n+\t */\n+\tpublic function __construct( $move_to_trash = null, $permanently_delete = null ) {\n+\t\t$this->trash_new_date = $move_to_trash;\n+\t\t$this->del_new_date   = $permanently_delete;\n+\t}\n+\n+\t/**\n+\t * Receives the new user-defined value for $trash_events option\n+\t * and defines it as the trash_new_date variable.\n+\t *\n+\t * @param mixed $trash_new_value - the value for the $trash_events option\n+\t *\n+\t * @since TBD\n+\t */\n+\tpublic function trash_set_new_date( $trash_new_value ) {\n+\t\t$this->trash_new_date = $trash_new_value;\n+\t}\n+\n+\t/**\n+\t * Receives the new user-defined value for $delete_events option\n+\t * and defines it as the del_new_date variable.\n+\t *\n+\t * @param mixed $del_new_value - the value for the $delete_events option\n+\t *\n+\t * @since TBD\n+\t */\n+\tpublic function delete_set_new_date( $del_new_value ) {\n+\t\t$this->del_new_date = $del_new_value;\n+\t}\n+\n+\t/**\n+\t * Schedules the hooks to delete and move old events to trash\n+\t * These hooks will be executed daily.\n+\t *\n+\t * @since TBD\n+\t */\n+\tpublic function add_hooks() {\n+\t\tif ( ! wp_next_scheduled( self::$trash_cron_hook ) && $this->trash_new_date != null ) {\n+\t\t\twp_schedule_event( time(), 'daily', self::$trash_cron_hook );\n+\t\t}\n+\n+\t\tif ( ! wp_next_scheduled( self::$del_cron_hook ) && $this->del_new_date != null ) {\n+\t\t\twp_schedule_event( time(), 'daily', self::$del_cron_hook );\n+\t\t}\n+\n+\t\tif ( $this->trash_new_date != null ) {","path":"src/Tribe/Event_Scheduler.php","position":89,"original_position":89,"commit_id":"a4b4cec1893b482aaa5431e229746545c8e9b18e","original_commit_id":"a4b4cec1893b482aaa5431e229746545c8e9b18e","user":{"login":"jesseeproductions","id":8312466,"avatar_url":"https://avatars1.githubusercontent.com/u/8312466?v=4","gravatar_id":"","url":"https://api.github.com/users/jesseeproductions","html_url":"https://github.com/jesseeproductions","followers_url":"https://api.github.com/users/jesseeproductions/followers","following_url":"https://api.github.com/users/jesseeproductions/following{/other_user}","gists_url":"https://api.github.com/users/jesseeproductions/gists{/gist_id}","starred_url":"https://api.github.com/users/jesseeproductions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesseeproductions/subscriptions","organizations_url":"https://api.github.com/users/jesseeproductions/orgs","repos_url":"https://api.github.com/users/jesseeproductions/repos","events_url":"https://api.github.com/users/jesseeproductions/events{/privacy}","received_events_url":"https://api.github.com/users/jesseeproductions/received_events","type":"User","site_admin":false},"body":"yodaify ( null !=  $var )","created_at":"2018-03-19T16:03:20Z","updated_at":"2018-03-19T16:04:39Z","html_url":"https://github.com/moderntribe/the-events-calendar/pull/1861#discussion_r175490107","pull_request_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments/175490107"},"html":{"href":"https://github.com/moderntribe/the-events-calendar/pull/1861#discussion_r175490107"},"pull_request":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861"}}},"pull_request":{"url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861","id":173833500,"html_url":"https://github.com/moderntribe/the-events-calendar/pull/1861","diff_url":"https://github.com/moderntribe/the-events-calendar/pull/1861.diff","patch_url":"https://github.com/moderntribe/the-events-calendar/pull/1861.patch","issue_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/1861","number":1861,"state":"open","locked":false,"title":"Updated feature to purge expired events via cron","user":{"login":"nefeline","id":15730971,"avatar_url":"https://avatars2.githubusercontent.com/u/15730971?v=4","gravatar_id":"","url":"https://api.github.com/users/nefeline","html_url":"https://github.com/nefeline","followers_url":"https://api.github.com/users/nefeline/followers","following_url":"https://api.github.com/users/nefeline/following{/other_user}","gists_url":"https://api.github.com/users/nefeline/gists{/gist_id}","starred_url":"https://api.github.com/users/nefeline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nefeline/subscriptions","organizations_url":"https://api.github.com/users/nefeline/orgs","repos_url":"https://api.github.com/users/nefeline/repos","events_url":"https://api.github.com/users/nefeline/events{/privacy}","received_events_url":"https://api.github.com/users/nefeline/received_events","type":"User","site_admin":false},"body":"Ref: https://central.tri.be/issues/98826","created_at":"2018-03-08T19:52:37Z","updated_at":"2018-03-19T16:04:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29e9d17568107046a077e142100d6cf4ae9197e5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":211537038,"url":"https://api.github.com/repos/moderntribe/the-events-calendar/labels/code%20review","name":"code review","color":"bfe5bf","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861/commits","review_comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861/comments","review_comment_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/1861/comments","statuses_url":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/a4b4cec1893b482aaa5431e229746545c8e9b18e","head":{"label":"moderntribe:feature/98826-purge-expired-events","ref":"feature/98826-purge-expired-events","sha":"a4b4cec1893b482aaa5431e229746545c8e9b18e","user":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"repo":{"id":16366134,"name":"the-events-calendar","full_name":"moderntribe/the-events-calendar","owner":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moderntribe/the-events-calendar","description":"The Events Calendar WordPress plugin by Modern Tribe","fork":false,"url":"https://api.github.com/repos/moderntribe/the-events-calendar","forks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/forks","keys_url":"https://api.github.com/repos/moderntribe/the-events-calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moderntribe/the-events-calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moderntribe/the-events-calendar/teams","hooks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/hooks","issue_events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/events{/number}","events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/events","assignees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/assignees{/user}","branches_url":"https://api.github.com/repos/moderntribe/the-events-calendar/branches{/branch}","tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/tags","blobs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/moderntribe/the-events-calendar/languages","stargazers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/stargazers","contributors_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contributors","subscribers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscribers","subscription_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscription","commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contents/{+path}","compare_url":"https://api.github.com/repos/moderntribe/the-events-calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moderntribe/the-events-calendar/merges","archive_url":"https://api.github.com/repos/moderntribe/the-events-calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moderntribe/the-events-calendar/downloads","issues_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues{/number}","pulls_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/moderntribe/the-events-calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/moderntribe/the-events-calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moderntribe/the-events-calendar/labels{/name}","releases_url":"https://api.github.com/repos/moderntribe/the-events-calendar/releases{/id}","deployments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/deployments","created_at":"2014-01-30T02:17:01Z","updated_at":"2018-03-15T22:36:48Z","pushed_at":"2018-03-19T15:25:37Z","git_url":"git://github.com/moderntribe/the-events-calendar.git","ssh_url":"git@github.com:moderntribe/the-events-calendar.git","clone_url":"https://github.com/moderntribe/the-events-calendar.git","svn_url":"https://github.com/moderntribe/the-events-calendar","homepage":null,"size":78028,"stargazers_count":158,"watchers_count":158,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":131,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":131,"open_issues":4,"watchers":158,"default_branch":"master"}},"base":{"label":"moderntribe:release/M18.05","ref":"release/M18.05","sha":"eaa56ef4480b4bed6bedb25f717018a9f619764f","user":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"repo":{"id":16366134,"name":"the-events-calendar","full_name":"moderntribe/the-events-calendar","owner":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moderntribe/the-events-calendar","description":"The Events Calendar WordPress plugin by Modern Tribe","fork":false,"url":"https://api.github.com/repos/moderntribe/the-events-calendar","forks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/forks","keys_url":"https://api.github.com/repos/moderntribe/the-events-calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moderntribe/the-events-calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moderntribe/the-events-calendar/teams","hooks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/hooks","issue_events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/events{/number}","events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/events","assignees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/assignees{/user}","branches_url":"https://api.github.com/repos/moderntribe/the-events-calendar/branches{/branch}","tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/tags","blobs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/moderntribe/the-events-calendar/languages","stargazers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/stargazers","contributors_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contributors","subscribers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscribers","subscription_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscription","commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contents/{+path}","compare_url":"https://api.github.com/repos/moderntribe/the-events-calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moderntribe/the-events-calendar/merges","archive_url":"https://api.github.com/repos/moderntribe/the-events-calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moderntribe/the-events-calendar/downloads","issues_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues{/number}","pulls_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/moderntribe/the-events-calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/moderntribe/the-events-calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moderntribe/the-events-calendar/labels{/name}","releases_url":"https://api.github.com/repos/moderntribe/the-events-calendar/releases{/id}","deployments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/deployments","created_at":"2014-01-30T02:17:01Z","updated_at":"2018-03-15T22:36:48Z","pushed_at":"2018-03-19T15:25:37Z","git_url":"git://github.com/moderntribe/the-events-calendar.git","ssh_url":"git@github.com:moderntribe/the-events-calendar.git","clone_url":"https://github.com/moderntribe/the-events-calendar.git","svn_url":"https://github.com/moderntribe/the-events-calendar","homepage":null,"size":78028,"stargazers_count":158,"watchers_count":158,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":131,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":131,"open_issues":4,"watchers":158,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861"},"html":{"href":"https://github.com/moderntribe/the-events-calendar/pull/1861"},"issue":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/1861"},"comments":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/1861/comments"},"review_comments":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861/comments"},"review_comment":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/1861/commits"},"statuses":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/a4b4cec1893b482aaa5431e229746545c8e9b18e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jesseeproductions"}}