-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depend on php to identify elements and depth (PR #6929)
Co-authored-by: Mai <[email protected]>
- Loading branch information
1 parent
e57a54a
commit 7150c17
Showing
13 changed files
with
79 additions
and
69 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
47 changes: 47 additions & 0 deletions
47
inc/Engine/Optimization/LazyRenderContent/Frontend/Processor/HelperTrait.php
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,47 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace WP_Rocket\Engine\Optimization\LazyRenderContent\Frontend\Processor; | ||
|
||
trait HelperTrait { | ||
|
||
/** | ||
* Get filtered elements depth. | ||
* | ||
* @return int | ||
*/ | ||
protected function get_depth() { | ||
/** | ||
* Filter the depth integer value. | ||
* The actual applied depth in the source is the default + 1 after the body or rocket_lazy_render_content_depth+1 after the body if the filter is set | ||
* | ||
* @param int $depth Depth value. | ||
*/ | ||
return wpm_apply_filters_typed( 'integer', 'rocket_lazy_render_content_depth', 2 ); | ||
} | ||
|
||
/** | ||
* Get processed tags. | ||
* | ||
* @return array|string[] | ||
*/ | ||
protected function get_processed_tags() { | ||
/** | ||
* Filter the processed element tags. | ||
* | ||
* @param array|string[] $tags Tags to be processed. | ||
*/ | ||
return wpm_apply_filters_typed( | ||
'array', | ||
'rocket_lazy_render_content_processed_tags', | ||
[ | ||
'DIV', | ||
'MAIN', | ||
'FOOTER', | ||
'SECTION', | ||
'ARTICLE', | ||
'HEADER', | ||
] | ||
); | ||
} | ||
} |
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