You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose a piece of code (mixed HTML + PHP) like this:
<h1 class="wp-heading-inline"><?php echo esc_html( get_admin_page_title() ); ?></h1>
Notice this space char -----------------------------------------------------------------⬏
If you are familiar with Wordpress, there are functions that echo the value they produce automatically...
So the code below escapes and echoes the title all in one neat function:
<option selected="selected" value=""><?php esc_html_e( 'Select attribute', 'woodmart-child' );?></option>
Notice there is no space char though -----------------------------------------------------------------------⬏
As you notice though, phpfmt, obviously because esc_html_e() isn't a built-in function, fails to format the code correctly, and so it doesn't add a space after ; and before ?>
The text was updated successfully, but these errors were encountered:
driade
added a commit
to driade/phpfmt8
that referenced
this issue
Jan 8, 2025
Suppose a piece of code (mixed HTML + PHP) like this:
<h1 class="wp-heading-inline"><?php echo esc_html( get_admin_page_title() ); ?></h1>
Notice this space char -----------------------------------------------------------------⬏
If you are familiar with Wordpress, there are functions that
echo
the value they produce automatically...So the code below escapes and echoes the title all in one neat function:
<option selected="selected" value=""><?php esc_html_e( 'Select attribute', 'woodmart-child' );?></option>
Notice there is no space char though -----------------------------------------------------------------------⬏
As you notice though, phpfmt, obviously because
esc_html_e()
isn't a built-in function, fails to format the code correctly, and so it doesn't add a space after;
and before?>
The text was updated successfully, but these errors were encountered: