-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #25
- Loading branch information
Showing
4 changed files
with
395 additions
and
8 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,6 @@ public static function instance() : self { | |
* Construct. | ||
*/ | ||
protected function __construct() { | ||
$this->theme = get_stylesheet(); | ||
|
||
add_action( 'template_redirect', array( $this, 'action__template_redirect' ), 101 ); | ||
} | ||
|
||
|
@@ -65,8 +63,6 @@ public function action__template_redirect() : void { | |
return; | ||
} | ||
|
||
get_header(); | ||
|
||
$this->header(); | ||
$this->attachment(); | ||
$this->attachment_lqip(); | ||
|
@@ -76,6 +72,7 @@ public function action__template_redirect() : void { | |
$this->unsplash(); | ||
$this->placeholder(); | ||
$this->placehold(); | ||
$this->holderjs(); | ||
$this->url(); | ||
$this->fallback(); | ||
|
||
|
@@ -87,11 +84,13 @@ public function action__template_redirect() : void { | |
protected function header() : void { | ||
?> | ||
|
||
<html> | ||
<html class="no-js"> | ||
|
||
<head> | ||
<title>Image Tag demo</title> | ||
|
||
<script>document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );</script> | ||
|
||
<style> | ||
|
||
html, body { | ||
|
@@ -100,6 +99,10 @@ protected function header() : void { | |
padding: 0; | ||
} | ||
|
||
html.no-js .hide-if-no-js { | ||
display: none !important; | ||
} | ||
|
||
body, | ||
figure { | ||
display: flex; | ||
|
@@ -144,6 +147,8 @@ protected function header() : void { | |
box-sizing: border-box; | ||
} | ||
</style> | ||
|
||
<?php wp_head() ?> | ||
</head> | ||
|
||
<body> | ||
|
@@ -322,6 +327,28 @@ protected function placehold() : void { | |
$this->output( $image, ob_get_clean() ); | ||
} | ||
|
||
protected function holderjs() : void { | ||
$image = \Image_Tag::create( 'holderjs', array( | ||
'width' => 750, | ||
'height' => 500, | ||
), array( | ||
'theme' => 'random', | ||
) ); | ||
|
||
ob_start(); | ||
?> | ||
|
||
\Image_Tag::create( 'holderjs', array( | ||
'width' => 750, | ||
'height' => 500, | ||
), array( | ||
'theme' => 'random', | ||
) ); | ||
|
||
<?php | ||
$this->output( $image, ob_get_clean() ); | ||
} | ||
|
||
protected function url() { | ||
$url = 'https://placehold.co/[email protected]'; | ||
|
||
|
@@ -334,7 +361,7 @@ protected function url() { | |
?> | ||
|
||
\Image_Tag::create( | ||
"<?php echo $url ?>", | ||
'<?php echo $url ?>', | ||
array( | ||
'width' => 982, | ||
'height' => 1424, | ||
|
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
Oops, something went wrong.