ad-group.php
3 months ago
conditions.php
3 months ago
header-note.php
3 months ago
item-select.php
3 months ago
name.php
3 months ago
type.php
3 months ago
usage.php
3 months ago
conditions.php
41 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render output of the placement conditions. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.50.0 |
| 8 | * |
| 9 | * @var Placement $placement Placement instance. |
| 10 | */ |
| 11 | |
| 12 | $display_conditions = Advanced_Ads_Display_Conditions::get_instance(); |
| 13 | $visitor_conditions = Advanced_Ads_Visitor_Conditions::get_instance(); |
| 14 | ?> |
| 15 | <?php if ( $placement->get_display_conditions() ) : ?> |
| 16 | <h4><?php echo esc_html__( 'Display Conditions', 'advanced-ads' ); ?></h4> |
| 17 | <ul> |
| 18 | <?php foreach ( $placement->get_display_conditions() as $condition ) : ?> |
| 19 | <?php if ( array_key_exists( $condition['type'], (array) $display_conditions->conditions ) ) : ?> |
| 20 | <li> |
| 21 | <?php echo esc_html( $display_conditions->conditions[ $condition['type'] ]['label'] ); ?> |
| 22 | </li> |
| 23 | <?php endif; ?> |
| 24 | <?php endforeach; ?> |
| 25 | </ul> |
| 26 | <?php endif; ?> |
| 27 | <?php if ( $placement->get_visitor_conditions() ) : ?> |
| 28 | <h4><?php echo esc_html__( 'Visitor Conditions', 'advanced-ads' ); ?></h4> |
| 29 | <ul> |
| 30 | <?php foreach ( $placement->get_visitor_conditions() as $condition ) : ?> |
| 31 | <?php if ( array_key_exists( $condition['type'], $visitor_conditions->conditions ) ) : ?> |
| 32 | <li> |
| 33 | <?php echo esc_html( $visitor_conditions->conditions[ $condition['type'] ]['label'] ); ?> |
| 34 | </li> |
| 35 | <?php endif; ?> |
| 36 | <?php endforeach; ?> |
| 37 | </ul> |
| 38 | <?php endif; ?> |
| 39 | |
| 40 | <a href="#modal-placement-edit-<?php echo esc_attr( $placement->get_id() ); ?>" data-placement="<?php echo esc_attr( $placement->get_id() ); ?>" class="advads-mobile-hidden"><?php esc_html_e( 'edit conditions', 'advanced-ads' ); ?></a> |
| 41 |