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
ad-group.php
38 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render item option for placements. |
| 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 | $placement_item = $placement->get_item_object(); |
| 13 | $allowed_ads = $placement->get_type_object()->get_allowed_ads(); |
| 14 | $allowed_groups = $placement->get_type_object()->get_allowed_groups(); |
| 15 | $has_items = ! empty( $allowed_ads ) || ! empty( $allowed_groups ); |
| 16 | |
| 17 | // Show a button when no ads exist, yet. |
| 18 | if ( ! $has_items ) : ?> |
| 19 | <a class="button button-primary advads-button-primary" href="<?php echo esc_url( admin_url( 'post-new.php?post_type=advanced_ads' ) ); ?>"> |
| 20 | <?php esc_html_e( 'Create your first ad', 'advanced-ads' ); ?> |
| 21 | </a> |
| 22 | <?php |
| 23 | return; |
| 24 | endif; |
| 25 | ?> |
| 26 | <label for="advads-placement-item-<?php echo esc_attr( $placement->get_slug() ); ?>" class="screen-reader-text"> |
| 27 | <?php esc_html_e( 'Choose the Ad or Group', 'advanced-ads' ); ?> |
| 28 | </label> |
| 29 | |
| 30 | <div class="advads-placement-item-select-wrap"> |
| 31 | <?php include 'item-select.php'; ?> |
| 32 | <span class="advads-loader hidden"></span> |
| 33 | |
| 34 | <a class="advads-placement-item-edit" href="<?php echo esc_url( $placement_item ? $placement_item->get_edit_link() : '#' ); ?>" style="display: <?php echo esc_attr( $placement_item && $placement_item->get_id() > 0 ? 'inline' : 'none' ); ?>" title="<?php esc_attr_e( 'Edit item', 'advanced-ads' ); ?>"> |
| 35 | <span class="dashicons dashicons-external"></span> |
| 36 | </a> |
| 37 | </div> |
| 38 |