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

Feature/swap html5 elements #67

Merged
merged 22 commits into from
Dec 3, 2013
Merged

Conversation

middlesister
Copy link
Member

No description provided.

Add legacy filter to use <div> tags
Add legacy filter to use <div> tags in xhtml mode
Add legacy filters for using <div> tags and opening/closing <ul> list
Add legacy filters to use <li> elements in xhtml mode
Add legacy filters to use <h3> elements in xhtml mode
Add legacy filter to use <div> tags in xhtml mode
Add legacy override for <div> tag in xhtml mode
Add legacy override for <div> tag in xhtml mode
Add css class .entry-header to <header>
Add legacy filter to remove the <header> tag in xhtml mode
Add legacy filter to use <div> tags in xhtml mode
Add legacy filter for using h2 where appropriate in xhtml mode
Add legacy filter to use <div> tags in xhtml mode
Add legacy functions for using <div> tags in xhtml mode
@middlesister
Copy link
Member Author

@emhr This is basically a complete port of my html5 plugin. The only thing not added is a str_replace on wp_page_menu to use the <nav> element. Do we want it?

Still not swapped are some loops that are directly in template files, namely 404.php, attachment.php, links.php,page.php, search.php, template-page-archives.php and template-page-fullwidth.php.

The Links page is getting deprecated (right?), but the others need to be addressed. The reason I didn't swap them yet is because I need to solve how to do the legacy mode. We could simply move these too into content-extensions.php, and treat them the same as the others.

Also missing are unit tests for the childtheme_override_* functions. I have to figure out how to test those.

Otherwise I think the html5 elements are there.

@middlesister middlesister mentioned this pull request Oct 5, 2013
8 tasks
@middlesister
Copy link
Member Author

Tests for childtheme overrides are now in a separate group and can be run using a command line parameter.

phpunit --group overrides

Legacy mode is also a separate group and is run with

phpunit --group legacy

And the rest is in group default

phpunit --group default

@middlesister
Copy link
Member Author

A possible solution for the template files is to include them in the legacy folder and then swap them in via the template_redirect hook or template_include filter.

add_filter( 'template_include', thematic_legacy_templates' );

function thematic_legacy_templates( $template ) {

    if ( is_page( )  ) {
        $new_template = TEMPLATEPATH . '/library/legacy/page.php';
        if ( '' != $new_template ) {
            return $new_template ;
        }
    }

    return $template;
}

Of course with added checks if child theme has defined the files etc, but as a general principle. cc @emhr

@middlesister
Copy link
Member Author

Changed in attachment.php, links.php, page.php, template-page-archive.php and template-page-fullwidth.php
Add legacy template files to the /legacy/directory
middlesister added a commit that referenced this pull request Dec 3, 2013
@middlesister middlesister merged commit 1a8132c into develop Dec 3, 2013
@middlesister
Copy link
Member Author

Legacy template files are now loaded in legacy mode. Merging this.

@middlesister middlesister deleted the feature/swap-html5-elements branch January 5, 2014 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant