[wp-trac] [WordPress Trac] #61183: Make all themes fully support HTML5 by default.

WordPress Trac noreply at wordpress.org
Sat May 25 01:48:34 UTC 2024


#61183: Make all themes fully support HTML5 by default.
--------------------------------------+-----------------------------
 Reporter:  dmsnell                   |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  General                   |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------

Comment (by poena):

 I don't understand what you mean with "I guess Twenty Eleven is using
 HTML5 support as an indirect proxy to something else?"

 {{{add_theme_support( 'html5', args goes here)}}} changes the markup that
 WordPress outputs.
 If the theme does not have styles for that markup, the design can break.
 Like in the case where WordPress outputs an email input field instead of a
 text input field.

 It is not the theme that is outputting invalid code, the theme is relying
 on WordPress built-in functions that still uses old syntax as the default.
 Partial code example from the comment form function:

 {{{

         if ( ! isset( $args['format'] ) ) {
                 $args['format'] = current_theme_supports( 'html5',
 'comment-form' ) ? 'html5' : 'xhtml';
         }

         $req   = get_option( 'require_name_email' );
         $html5 = 'html5' === $args['format'];

         // Define attributes in HTML5 or XHTML syntax.
         $required_attribute = ( $html5 ? ' required' : '
 required="required"' );
         $checked_attribute  = ( $html5 ? ' checked' : ' checked="checked"'
 );

 }}}

 https://developer.wordpress.org/reference/functions/comment_form/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61183#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list