class-after-content.php
3 months ago
class-before-content.php
3 months ago
class-content.php
3 months ago
class-footer.php
3 months ago
class-header.php
3 months ago
class-sidebar-widget.php
3 months ago
class-standard.php
3 months ago
class-unknown.php
3 months ago
class-header.php
95 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This class represents the "Header" placement type. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.47.0 |
| 8 | */ |
| 9 | |
| 10 | namespace AdvancedAds\Placements\Types; |
| 11 | |
| 12 | use AdvancedAds\Abstracts\Placement_Type as Base; |
| 13 | use AdvancedAds\Interfaces\Placement_Type; |
| 14 | use AdvancedAds\Placements\Placement_Header; |
| 15 | |
| 16 | defined( 'ABSPATH' ) || exit; |
| 17 | |
| 18 | /** |
| 19 | * Type Header. |
| 20 | */ |
| 21 | class Header extends Base implements Placement_Type { |
| 22 | |
| 23 | /** |
| 24 | * Get the unique identifier (ID) of the placement type. |
| 25 | * |
| 26 | * @return string The unique ID of the placement type. |
| 27 | */ |
| 28 | public function get_id(): string { |
| 29 | return 'header'; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Get the class name of the object as a string. |
| 34 | * |
| 35 | * @return string |
| 36 | */ |
| 37 | public function get_classname(): string { |
| 38 | return Placement_Header::class; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Get the title or name of the placement type. |
| 43 | * |
| 44 | * @return string The title of the placement type. |
| 45 | */ |
| 46 | public function get_title(): string { |
| 47 | return __( 'Header Code', 'advanced-ads' ); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Get a description of the placement type. |
| 52 | * |
| 53 | * @return string The description of the placement type. |
| 54 | */ |
| 55 | public function get_description(): string { |
| 56 | return __( 'Injected in Header (before closing </head> Tag, often not visible).', 'advanced-ads' ); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Check if this placement type requires premium. |
| 61 | * |
| 62 | * @return bool True if premium is required; otherwise, false. |
| 63 | */ |
| 64 | public function is_premium(): bool { |
| 65 | return false; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Get the URL for upgrading to this placement type. |
| 70 | * |
| 71 | * @return string The upgrade URL for the placement type. |
| 72 | */ |
| 73 | public function get_image(): string { |
| 74 | return ADVADS_BASE_URL . 'assets/img/placement-types/header.png'; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Get order number for this placement type. |
| 79 | * |
| 80 | * @return int The order number. |
| 81 | */ |
| 82 | public function get_order(): int { |
| 83 | return 30; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Get options for this placement type. |
| 88 | * |
| 89 | * @return array The options array. |
| 90 | */ |
| 91 | public function get_options(): array { |
| 92 | return $this->apply_filter_on_options( [] ); |
| 93 | } |
| 94 | } |
| 95 |