-
Notifications
You must be signed in to change notification settings - Fork 384
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
Issue 848: Allow theme support of canonical AMP #852
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
995f0ce
Issue 848: Allow theme support of canonical AMP.
9f8fb86
Bump 0.7-alpha
westonruter b9e0925
Allow amp_is_canonical() to be true if args are passed without templa…
westonruter 4258e10
Continue enqueueng edit post JS/CSS for when canonical mode functiona…
westonruter a1112c9
Improve position of canonical check in amp_maybe_add_actions()
westonruter 4a1f621
Issue 848 : Change 'AMP Settings' page with canonical AMP.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Tests for amp.php. | ||
* | ||
* @package AMP | ||
*/ | ||
|
||
/** | ||
* Tests for amp.php. | ||
*/ | ||
class Test_AMP extends WP_UnitTestCase { | ||
|
||
/** | ||
* Tear down and clean up. | ||
*/ | ||
public function tearDown() { | ||
parent::tearDown(); | ||
remove_theme_support( 'amp' ); | ||
} | ||
|
||
/** | ||
* Test amp_is_canonical(). | ||
* | ||
* @covers amp_is_canonical() | ||
*/ | ||
public function test_amp_is_canonical() { | ||
remove_theme_support( 'amp' ); | ||
$this->assertFalse( amp_is_canonical() ); | ||
|
||
add_theme_support( 'amp' ); | ||
$this->assertTrue( amp_is_canonical() ); | ||
|
||
remove_theme_support( 'amp' ); | ||
add_theme_support( 'amp', array( | ||
'template_path' => get_template_directory() . 'amp-templates/', | ||
) ); | ||
$this->assertFalse( amp_is_canonical() ); | ||
|
||
remove_theme_support( 'amp' ); | ||
add_theme_support( 'amp', array( | ||
'custom_prop' => 'something', | ||
) ); | ||
$this->assertTrue( amp_is_canonical() ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of
template_path
will probably need to be iterated upon. For example,theme_root
per\WP_Theme::get_theme_root()
ortemplate_dir
per\WP_Theme::get_template_directory()
. This will need some more discovery in #849 as to what makes the most sense. To me it seems thetheme_root
andtemplate_directory
are the same. /cc @kaitnyl