wphooks.info - xmlrpc_allow_anonymous_comments

xmlrpc_allow_anonymous_comments

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/class-wp-xmlrpc-server.php:
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
		$content_struct = $args[4];

		/**
		 * Filters whether to allow anonymous comments over XML-RPC.
		 *
		 * @since 2.7.0
		 *
		 * @param bool $allow Whether to allow anonymous commenting via XML-RPC.
		 *                    Default false.
		 */
		$allow_anon = apply_filters( 'xmlrpc_allow_anonymous_comments', false );

		$user = $this->login( $username, $password );

		if ( ! $user ) {
			$logged_in = false;
			if ( $allow_anon && get_option( 'comment_registration' ) ) {
				return new IXR_Error( 403, __( 'You must be registered to comment.' ) );
			} elseif ( ! $allow_anon ) {
				return $this->error;