GitHub PullRequestReviewCommentEvent at 2014-03-27 09:00:53
Repository: wordpress-plugin
Actor: markijbema
Payload: {"comment":{"url":"https://api.github.com/repos/Factlink/wordpress-plugin/pulls/comments/11014387","id":11014387,"diff_hunk":"@@ -0,0 +1,37 @@\n+<?php\n+/**\n+ * Created by PhpStorm.\n+ * User: maarten\n+ * Date: 26/03/14\n+ * Time: 16:53\n+ */\n+\n+namespace factlink\\capability;\n+\n+class DisableComments extends \\vg\\wordpress_plugin\\capability\\Capability\n+{\n+    /***\n+     * inject:\n+     * @var \\factlink\\model\\Settings\n+     */\n+    public $settings;\n+\n+    public function initialize()\n+    {\n+        if ($this->settings->disable_global_comments->get() == 1)\n+        {\n+            // add a filter to when wordpress asks if comments are open for the current post, can return false\n+            add_filter( 'comments_open', array($this, 'disable_comments_filter'), 10, 2 );\n+\n+            // TODO: remove / replace the comments link from the top admin bar\n+            // TODO: remove / replace the comments link from the left admin bar\n+        }\n+    }\n+\n+    // the return value determines if the comment is enabled / disabled for the current page\n+    public function disable_comments_filter( $open, $post_id ) {\n+\n+        return false;\n+","path":"trunk/app/capability/disable_comments.php","position":35,"original_position":35,"commit_id":"ee435f8c68c492dafdea0fdf0848d44ebc3b8a72","original_commit_id":"ee435f8c68c492dafdea0fdf0848d44ebc3b8a72","user":{"login":"markijbema","id":624143,"avatar_url":"https://avatars.githubusercontent.com/u/624143?","gravatar_id":"86f77339c385c35c7bac770b2e3921c2","url":"https://api.github.com/users/markijbema","html_url":"https://github.com/markijbema","followers_url":"https://api.github.com/users/markijbema/followers","following_url":"https://api.github.com/users/markijbema/following{/other_user}","gists_url":"https://api.github.com/users/markijbema/gists{/gist_id}","starred_url":"https://api.github.com/users/markijbema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markijbema/subscriptions","organizations_url":"https://api.github.com/users/markijbema/orgs","repos_url":"https://api.github.com/users/markijbema/repos","events_url":"https://api.github.com/users/markijbema/events{/privacy}","received_events_url":"https://api.github.com/users/markijbema/received_events","type":"User","site_admin":false},"body":"please remove whiteline","created_at":"2014-03-27T09:00:53Z","updated_at":"2014-03-27T09:00:53Z","html_url":"https://github.com/Factlink/wordpress-plugin/pull/2#discussion_r11014387","pull_request_url":"https://api.github.com/repos/Factlink/wordpress-plugin/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Factlink/wordpress-plugin/pulls/comments/11014387"},"html":{"href":"https://github.com/Factlink/wordpress-plugin/pull/2#discussion_r11014387"},"pull_request":{"href":"https://api.github.com/repos/Factlink/wordpress-plugin/pulls/2"}}}}