array_ad_conditions.php
77 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * conditions under which to (not) show an ad |
| 5 | * I don’t like huge arrays like this to clutter my classes |
| 6 | * and anyway, this might be needed on multiple places |
| 7 | * |
| 8 | * at the bottom, you find a filter to be able to extend / remove your own elements |
| 9 | * |
| 10 | * elements |
| 11 | * key - internal id of the condition; needs to be unique, obviously |
| 12 | * label - title in the dashboard |
| 13 | * description - (optional) description displayed in the dashboard |
| 14 | * type - information / markup type |
| 15 | * idfield - input field for comma separated lists of ids |
| 16 | * radio - radio button |
| 17 | * |
| 18 | * note: ’idfield’ always has a {field}_not version that is created automatically and being its own condition |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | $advanced_ads_slug = Advanced_Ads::get_instance()->get_plugin_slug(); |
| 23 | |
| 24 | $advanced_ads_ad_conditions = array( |
| 25 | 'postids' => array( |
| 26 | 'label' => __('Single Pages/Posts', $advanced_ads_slug), |
| 27 | 'description' => __('comma seperated IDs of post, page or custom post type', $advanced_ads_slug), |
| 28 | 'type' => 'idfield', |
| 29 | ), |
| 30 | 'categoryids' => array( |
| 31 | 'label' => __('Categories', $advanced_ads_slug), |
| 32 | 'description' => __('comma seperated IDs of categories for posts or category archives', $advanced_ads_slug), |
| 33 | 'type' => 'idfield', |
| 34 | ), |
| 35 | 'categoryarchiveids' => array( |
| 36 | 'label' => __('Category Archives', $advanced_ads_slug), |
| 37 | 'description' => __('comma seperated IDs of category archives', $advanced_ads_slug), |
| 38 | 'type' => 'idfield', |
| 39 | ), |
| 40 | 'posttypes' => array( |
| 41 | 'label' => __('Post Types', $advanced_ads_slug), |
| 42 | 'description' => __('comma seperated list of post types', $advanced_ads_slug), |
| 43 | 'type' => 'textvalues', |
| 44 | ), |
| 45 | 'is_front_page' => array( |
| 46 | 'label' => __('Home Page', $advanced_ads_slug), |
| 47 | 'description' => __('(don’t) show on Home page', $advanced_ads_slug), |
| 48 | 'type' => 'radio', |
| 49 | ), |
| 50 | 'is_singular' => array( |
| 51 | 'label' => __('Singular Pages', $advanced_ads_slug), |
| 52 | 'description' => __('(don’t) show on singular pages/posts', $advanced_ads_slug), |
| 53 | 'type' => 'radio', |
| 54 | ), |
| 55 | 'is_archive' => array( |
| 56 | 'label' => __('Archive Pages', $advanced_ads_slug), |
| 57 | 'description' => __('(don’t) show on any type of archive page (category, tag, author and date)', $advanced_ads_slug), |
| 58 | 'type' => 'radio', |
| 59 | ), |
| 60 | 'is_search' => array( |
| 61 | 'label' => __('Search Results', $advanced_ads_slug), |
| 62 | 'description' => __('(don’t) show on search result pages', $advanced_ads_slug), |
| 63 | 'type' => 'radio', |
| 64 | ), |
| 65 | 'is_404' => array( |
| 66 | 'label' => __('404 Page', $advanced_ads_slug), |
| 67 | 'description' => __('(don’t) show on 404 error page', $advanced_ads_slug), |
| 68 | 'type' => 'radio', |
| 69 | ), |
| 70 | 'is_attachment' => array( |
| 71 | 'label' => __('Attachment Pages', $advanced_ads_slug), |
| 72 | 'description' => __('(don’t) show on attachment pages', $advanced_ads_slug), |
| 73 | 'type' => 'radio', |
| 74 | ) |
| 75 | ); |
| 76 | |
| 77 | $advanced_ads_ad_conditions = apply_filters('advanced-ads-conditions', $advanced_ads_ad_conditions); |