Skip to content

Commit

Permalink
Only use block markup for comment form button when using a block theme (
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Dec 14, 2021
1 parent 81a5043 commit d727b8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/block-library/src/post-comments-form/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ function register_block_core_post_comments_form() {
* @return array Returns the modified fields.
*/
function gutenberg_comment_form_block_form_defaults( $fields ) {
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
if ( wp_is_block_theme() ) {
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
}

return $fields;
}
Expand Down
6 changes: 4 additions & 2 deletions packages/block-library/src/post-comments/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ function register_block_core_post_comments() {
* @return array Returns the modified fields.
*/
function gutenberg_post_comments_block_form_defaults( $fields ) {
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
if ( wp_is_block_theme() ) {
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
}

return $fields;
}
Expand Down

0 comments on commit d727b8b

Please sign in to comment.