__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Templately\Builder\Conditions;
class Archive extends Condition {
protected $sub_conditions = [
'search'
];
public function get_priority(): int {
return 80;
}
public function get_name(): string {
return 'archive';
}
public function get_label(): string {
return 'Archive';
}
public function get_type(): string {
return 'archive';
}
public function get_all_label(): string {
return esc_html__( 'All Archives', 'templately' );
}
public function check( $args = [] ): bool {
$is_archive = is_archive() || is_home() || is_search();
// WooCommerce is handled by `woocommerce` module.
if ( $is_archive && class_exists( 'woocommerce' ) && is_woocommerce() ) {
$is_archive = is_woocommerce() || is_search() && 'product' === get_query_var( 'post_type' );
}
return $is_archive;
}
protected function register_sub_conditions() {
foreach ( $this->builder->get_public_post_types() as $post_type => $label ) {
if ( ! get_post_type_archive_link( $post_type ) ) {
continue;
}
$condition = new PostTypeArchive( [
'post_type' => $post_type,
] );
$this->register_sub_condition( $condition );
}
}
}| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Archive.php | File | 1.14 KB | 0640 |
|
| Condition.php | File | 1.76 KB | 0640 |
|
| Error.php | File | 413 B | 0640 |
|
| Front.php | File | 421 B | 0640 |
|
| General.php | File | 451 B | 0640 |
|
| Page.php | File | 1.24 KB | 0640 |
|
| Post.php | File | 1.6 KB | 0640 |
|
| PostByAuthor.php | File | 966 B | 0640 |
|
| PostTypeArchive.php | File | 1.58 KB | 0640 |
|
| ProductSearch.php | File | 418 B | 0640 |
|
| Search.php | File | 414 B | 0640 |
|
| Singular.php | File | 971 B | 0640 |
|
| Taxonomy.php | File | 1.01 KB | 0640 |
|
| WooCommerce.php | File | 731 B | 0640 |
|