class-ad-list-stats.php
1 week ago
class-addons.php
1 day ago
class-cache.php
1 week ago
class-conditional.php
1 day ago
class-content-injection.php
1 year ago
class-data.php
1 day ago
class-sanitize.php
1 year ago
class-testing.php
1 year ago
class-validation.php
1 day ago
class-wordpress.php
1 day ago
index.php
2 years ago
class-content-injection.php
65 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Utilities Content Injection. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.50.0 |
| 8 | */ |
| 9 | |
| 10 | namespace AdvancedAds\Utilities; |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | |
| 14 | /** |
| 15 | * Utilities Content Injection. |
| 16 | */ |
| 17 | class Content_Injection { |
| 18 | |
| 19 | /** |
| 20 | * Get html tags for content injection |
| 21 | * |
| 22 | * @since 1.3.5 |
| 23 | * |
| 24 | * @return array Tags that can be used for content injection |
| 25 | */ |
| 26 | public static function get_tags(): array { |
| 27 | $headline_tags = apply_filters( 'advanced-ads-headlines-for-ad-injection', [ 'h2', 'h3', 'h4' ] ); |
| 28 | $headline_tags = '<' . implode( '>, <', $headline_tags ) . '>'; |
| 29 | |
| 30 | $tags = apply_filters( |
| 31 | 'advanced-ads-tags-for-injection', |
| 32 | [ |
| 33 | /* translators: %s is an html tag. */ |
| 34 | 'p' => sprintf( __( 'paragraph (%s)', 'advanced-ads' ), '<p>' ), |
| 35 | /* translators: %s is an html tag. */ |
| 36 | 'pwithoutimg' => sprintf( __( 'paragraph without image (%s)', 'advanced-ads' ), '<p>' ), |
| 37 | /* translators: %s is an html tag. */ |
| 38 | 'h2' => sprintf( __( 'headline 2 (%s)', 'advanced-ads' ), '<h2>' ), |
| 39 | /* translators: %s is an html tag. */ |
| 40 | 'h3' => sprintf( __( 'headline 3 (%s)', 'advanced-ads' ), '<h3>' ), |
| 41 | /* translators: %s is an html tag. */ |
| 42 | 'h4' => sprintf( __( 'headline 4 (%s)', 'advanced-ads' ), '<h4>' ), |
| 43 | /* translators: %s is an html tag. */ |
| 44 | 'headlines' => sprintf( __( 'any headline (%s)', 'advanced-ads' ), $headline_tags ), |
| 45 | /* translators: %s is an html tag. */ |
| 46 | 'img' => sprintf( __( 'image (%s)', 'advanced-ads' ), '<img>' ), |
| 47 | /* translators: %s is an html tag. */ |
| 48 | 'table' => sprintf( __( 'table (%s)', 'advanced-ads' ), '<table>' ), |
| 49 | /* translators: %s is an html tag. */ |
| 50 | 'li' => sprintf( __( 'list item (%s)', 'advanced-ads' ), '<li>' ), |
| 51 | /* translators: %s is an html tag. */ |
| 52 | 'blockquote' => sprintf( __( 'quote (%s)', 'advanced-ads' ), '<blockquote>' ), |
| 53 | /* translators: %s is an html tag. */ |
| 54 | 'iframe' => sprintf( __( 'iframe (%s)', 'advanced-ads' ), '<iframe>' ), |
| 55 | /* translators: %s is an html tag. */ |
| 56 | 'div' => sprintf( __( 'container (%s)', 'advanced-ads' ), '<div>' ), |
| 57 | 'anyelement' => __( 'any element', 'advanced-ads' ), |
| 58 | 'custom' => _x( 'custom', 'for the "custom" content placement option', 'advanced-ads' ), |
| 59 | ] |
| 60 | ); |
| 61 | |
| 62 | return $tags; |
| 63 | } |
| 64 | } |
| 65 |