PluginProbe
Themify Builder / trunk
Themify Builder vtrunk
7.8.1 7.8.0 7.7.9 7.7.8 7.7.7 7.7.6 7.7.5 7.7.4 7.7.3 7.7.2 trunk 7.6.0 7.6.1 7.6.2 7.6.3 7.6.4 7.6.5 7.6.6 7.6.7 7.6.8 7.6.9 7.7.0 7.7.1
themify-builder / themify / includes / conditions.php

conditions.php in Themify Builder trunk, at themify/includes/conditions.php

150 lines 10.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 $post_types = apply_filters( 'themify_hooks_visibility_post_types', get_post_types( array( 'public' => true ) ) );
4 unset( $post_types['page'], $post_types['attachment'] );
5 $post_types = array_map( 'get_post_type_object', $post_types );
6
7 $taxonomies = apply_filters( 'themify_hooks_visibility_taxonomies', get_taxonomies( array( 'public' => true ) ) );
8 $taxonomies = array_map( 'get_taxonomy', $taxonomies );
9 ?>
10
11 <div id="themify_lightbox_visibility" class="themify_lightbox_visibility themify-admin-lightbox tf_clearfix" style="display: none;">
12 <h3 class="themify_lightbox_title"><?php _e( 'Condition', 'themify' ) ?></h3>
13 <div class="close_lightbox tf_close"></div>
14 <div class="lightbox_container">
15 <form id="visibility-tabs" class="ui-tabs">
16 <ul class="tf_clearfix">
17 <li><a href="#visibility-tab-general"><?php _e( 'General', 'themify' ) ?></a></li>
18 <li><a href="#visibility-tab-pages" class="themify_hc_load_ajax" data-type="post_type:page"><?php _e( 'Pages', 'themify' ) ?></a></li>
19 <li><a href="#visibility-tab-categories-singles" class="themify_hc_load_ajax"><?php _e( 'Has Term', 'themify' ) ?></a></li>
20 <li><a href="#visibility-tab-categories" class="themify_hc_load_ajax" data-type="tax:category"><?php _e( 'Categories', 'themify' ) ?></a></li>
21 <li><a href="#visibility-tab-post-types" class="themify_hc_load_ajax"><?php _e( 'Post Types', 'themify' ) ?></a></li>
22 <li><a href="#visibility-tab-taxonomies" class="themify_hc_load_ajax"><?php _e( 'Taxonomies', 'themify' ) ?></a></li>
23 <?php if ( themify_is_woocommerce_active() ) : ?><li><a href="#visibility-tab-wc"><?php _e( 'WooCommerce', 'themify' ) ?></a></li><?php endif; ?>
24 <li><a href="#visibility-tab-userroles"><?php _e( 'User Roles', 'themify' ) ?></a></li>
25 </ul>
26
27 <div id="visibility-tab-general" class="themify-visibility-options tf_clearfix">
28 <label><input type="checkbox" name="general[home]" /><span data-tooltip="<?php echo get_home_url() ?>"><?php _e( 'Home page', 'themify' ) ?></span></label>
29 <label><input type="checkbox" name="general[404]" /><?php _e( '404 page', 'themify' ) ?></label>
30 <label><input type="checkbox" name="general[page]" /><?php _e( 'Page views', 'themify' ) ?></label>
31 <label><input type="checkbox" name="general[single]" /><?php _e( 'Single post views', 'themify' ) ?></label>
32 <label><input type="checkbox" name="general[search]" /><?php _e( 'Search pages', 'themify' ) ?></label>
33 <label><input type="checkbox" name="general[category]" /><?php _e( 'Category archive', 'themify' ) ?></label>
34 <label><input type="checkbox" name="general[tag]" /><?php _e( 'Tag archive', 'themify' ) ?></label>
35 <label><input type="checkbox" name="general[author]" /><?php _e( 'Author pages', 'themify' ) ?></label>
36 <label><input type="checkbox" name="general[date]" /><?php _e( 'Date archive pages', 'themify' ) ?></label>
37 <label><input type="checkbox" name="general[year]" /><?php _e( 'Year based archive', 'themify' ) ?></label>
38 <label><input type="checkbox" name="general[month]" /><?php _e( 'Month based archive', 'themify' ) ?></label>
39 <label><input type="checkbox" name="general[day]" /><?php _e( 'Day based archive', 'themify' ) ?></label>
40 <label><input type="checkbox" name="general[logged]" /><?php _e( 'User logged in', 'themify' ) ?></label>
41
42 <?php
43 /* General views for CPT */
44 foreach( get_post_types( array( 'public' => true, 'exclude_from_search' => false, '_builtin' => false ) ) as $key => $post_type ) :
45 $post_type = get_post_type_object( $key );
46 ?>
47 <label><input type="checkbox" name="general[<?php echo $key ?>]" /><?php printf( __( 'Single %s View', 'themify' ), $post_type->labels->singular_name ) ?></label>
48 <label><input type="checkbox" name="post_type_archive[<?php echo $key ?>]" /><?php printf( __( '%s Archive View', 'themify' ), $post_type->labels->singular_name ) ?></label>
49 <?php endforeach; ?>
50
51 <?php
52 /* Custom taxonomies archive view */
53 foreach( get_taxonomies( array( 'public' => true, '_builtin' => false ) ) as $key => $tax ) :
54 $tax = get_taxonomy( $key );
55 ?>
56 <label><input type="checkbox" name="general[<?php echo $key ?>]" /><?php printf( __( '%s Archive View', 'themify' ), $tax->label ) ?></label>
57 <?php endforeach; ?>
58
59 </div><!-- #visibility-tab-general -->
60
61 <div id="visibility-tab-pages" class="themify-visibility-options themify-visibility-type-options tf_clearfix">
62 <div class="themify-visibility-items-inner">
63 </div>
64 </div><!-- #visibility-tab-pages -->
65
66 <div id="visibility-tab-categories-singles" class="themify-visibility-options tf_clearfix">
67 <div id="themify-visibility-category-single-inner-tabs" class="themify-visibility-inner-tabs">
68 <ul class="inline-tabs tf_clearfix">
69 <?php foreach( $taxonomies as $key => $tax ) : ?>
70 <li><a href="#visibility-tab-in_tax-<?php echo $key ?>" data-type="in_tax:<?php echo $key ?>"><?php echo $tax->label ?></a></li>
71 <?php endforeach; ?>
72 </ul>
73 <div class="themify-visibility-type-options tf_clearfix">
74 <?php foreach( $taxonomies as $key => $tax ) : ?>
75 <div id="visibility-tab-in_tax-<?php echo $key ?>" class="themify-visibility-inner-tab">
76 <div class="themify-visibility-items-inner"></div>
77 </div>
78 <?php endforeach; ?>
79 </div>
80 </div>
81 </div><!-- #visibility-tab-categories-singles -->
82
83 <div id="visibility-tab-categories" class="themify-visibility-options themify-visibility-type-options tf_clearfix">
84 <div class="themify-visibility-items-inner">
85 </div>
86 </div><!-- #visibility-tab-categories -->
87
88 <div id="visibility-tab-post-types" class="themify-visibility-options tf_clearfix">
89 <div id="themify-visibility-post-types-inner-tabs" class="themify-visibility-inner-tabs">
90 <ul class="inline-tabs tf_clearfix">
91 <?php foreach( $post_types as $key => $post_type ) : ?>
92 <li><a href="#visibility-tab-<?php echo $key ?>" data-type="post_type:<?php echo $key ?>"><?php echo $post_type->label ?></a></li>
93 <?php endforeach; ?>
94 </ul>
95 <div class="themify-visibility-type-options tf_clearfix">
96 <?php foreach( $post_types as $key => $post_type ) : ?>
97 <div id="visibility-tab-<?php echo $key ?>" class="themify-visibility-inner-tab">
98 <div class="themify-visibility-items-inner"></div>
99 </div>
100 <?php endforeach; ?>
101 </div>
102 </div>
103 </div><!-- #visibility-tab-post-types -->
104
105 <?php
106 unset( $taxonomies['category'] );
107 ?>
108 <div id="visibility-tab-taxonomies" class="themify-visibility-options tf_clearfix">
109 <div id="themify-visibility-taxonomies-inner-tabs" class="themify-visibility-inner-tabs">
110 <ul class="inline-tabs tf_clearfix">
111 <?php foreach( $taxonomies as $key => $tax ) : ?>
112 <li><a href="#visibility-tab-<?php echo $key ?>" data-type="tax:<?php echo $key ?>"><?php echo $tax->label ?></a></li>
113 <?php endforeach; ?>
114 </ul>
115 <div class="themify-visibility-type-options tf_clearfix">
116 <?php foreach( $taxonomies as $key => $tax ) : ?>
117 <div id="visibility-tab-<?php echo $key ?>" class="themify-visibility-inner-tab">
118 <div class="themify-visibility-items-inner"></div>
119 </div>
120 <?php endforeach; ?>
121 </div>
122 </div>
123 </div><!-- #visibility-tab-taxonomies -->
124
125 <?php if ( themify_is_woocommerce_active() ) : ?>
126 <div id="visibility-tab-wc" class="themify-visibility-options tf_clearfix">
127 <label><input type="checkbox" name="wc[orders]" /><?php _e( 'Orders', 'themify' ) ?></label>
128 <label><input type="checkbox" name="wc[view-order]" /><?php _e( 'View Order', 'themify' ) ?></label>
129 <label><input type="checkbox" name="wc[downloads]" /><?php _e( 'Downloads', 'themify' ) ?></label>
130 <label><input type="checkbox" name="wc[edit-account]" /><?php _e( 'Edit Account', 'themify' ) ?></label>
131 <label><input type="checkbox" name="wc[edit-address]" /><?php _e( 'Edit Address', 'themify' ) ?></label>
132 <label><input type="checkbox" name="wc[lost-password]" /><?php _e( 'Lost Password', 'themify' ) ?></label>
133 <label><input type="checkbox" name="wc[order-pay]" /><?php _e( 'Pay', 'themify' ) ?></label>
134 <label><input type="checkbox" name="wc[order-received]" /><?php _e( 'Order Received', 'themify' ) ?></label>
135 <label><input type="checkbox" name="wc[payment-methods]" /><?php _e( 'Payment Methods', 'themify' ) ?></label>
136 </div><!-- #visibility-tab-wc -->
137 <?php endif; ?>
138
139 <div id="visibility-tab-userroles" class="themify-visibility-options tf_clearfix">
140 <?php foreach( $GLOBALS['wp_roles']->roles as $key => $role ) : ?>
141 <label><input type="checkbox" name="roles[<?php echo $key ?>]" /><?php echo $role['name'] ?></label>
142 <?php endforeach; ?>
143 </div><!-- #visibility-tab-userroles -->
144
145 </form>
146 </div>
147 <a href="#" class="uncheck-all"><?php _e( 'Uncheck All', 'themify' ) ?></a>
148 <a href="#" class="button button-primary visibility-save alignright"><?php _e( 'Save', 'themify' ) ?></a>
149 </div>
150 <div id="themify_lightbox_overlay"></div>