Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe hide discussion panel in block editor? #22

Open
joemaller opened this issue May 6, 2022 · 0 comments
Open

Maybe hide discussion panel in block editor? #22

joemaller opened this issue May 6, 2022 · 0 comments

Comments

@joemaller
Copy link
Member

Testing WP v6-RC1 and the discussion panel showed up even though post_type support had already been explicitly removed. Maybe their bug, maybe something we'll need to deal with.

image

If this sticks, we'll likely need to address this in JavaScript with this: (found here)

wp.data.dispatch('core/edit-post').removeEditorPanel('discussion-panel')

Added this to Extras\GlobalCommentsDisable based on some stuff in the Disable Comments plugin:

// in __construct
        /**
         * API, XMLRPC and REST comments
         */
        // add_filter('rest_endpoints', array($this, 'filter_rest_endpoints'));
        add_filter('rest_pre_insert_comment', '__return_false');
        add_filter('xmlrpc_methods', [$this, 'unset_xmlrpc_comments']);

// added this method:

    /**
     * @link https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/__construct/
     */
    public function unset_xmlrpc_comments($methods)
    {
        unset($methods['wp.newComment']);
        return $methods;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant