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

Add/rest api for block commenting #54

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/compat/wordpress-6.7/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,30 @@
* @return array The updated array of comment types.
*/
if ( ! function_exists( 'update_get_avatar_comment_type' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) {
function update_get_avatar_comment_type( $comment_type ) {

Check failure on line 151 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed

Check failure on line 152 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed

Check failure on line 152 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Whitespace found at end of line
$comment_type[] = 'block_comment';

Check failure on line 153 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
return $comment_type;

Check failure on line 154 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed

Check failure on line 155 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed

Check failure on line 155 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Whitespace found at end of line
}

Check failure on line 156 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed

Check failure on line 156 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Function closing brace must go on the next line following the body; found 1 blank lines before brace
add_filter( 'get_avatar_comment_types', 'update_get_avatar_comment_type', 10, 1 );

Check failure on line 157 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
}

/**
* Updates the comment type filter dropdown options.
*
* This function is only defined if the 'gutenberg-block-comment' experiment is enabled and the 'update_comment_type_filter_dropdown' function does not already exist.
* It returns an array of comment type options for the comment type filter dropdown in the admin area.
*
* @return array An associative array of comment type options.
* The keys are the comment type slugs and the values are the translated names of the comment types.
*/
if ( ! function_exists( 'update_comment_type_filter_dropdown' ) && gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) {
function update_comment_type_filter_dropdown() {
return array(
'comment' => __( 'Comments' ),

Check warning on line 172 in lib/compat/wordpress-6.7/rest-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Array double arrow not aligned correctly; expected 7 space(s) between "'comment'" and double arrow, but found 1.
'block_comment' => __( 'Block Comments' ),
);
}
add_filter( 'admin_comment_types_dropdown', 'update_comment_type_filter_dropdown' );
}
Loading