public function createOrFail(array $arguments)
    {
        $status = $this->create($arguments);

        if (is_wp_error($status)) {
            throw new QueryException('Could not create new comment.');
        }

        return $status;
    }
public function createOrFail(array $arguments)
    {
        $status = $this->create($arguments);

        if (is_wp_error($status)) {
            throw new QueryException('Could not create new comment.');
        }

        return $status;
    }
public function createOrFail ( array $ arguments ) { $ status = $ this -> create ( $ arguments ) ; if ( is_wp_error ( $ status ) ) { throw new QueryException ( 'Could not create new comment.' ) ; } return $ status ; }
Create post or fail if unsuccessful.

@throws QueryException

@return bool|\WP_Error
Create post or fail if unsuccessful .