PluginProbe
WP Ultimate Post Grid / 1.7.2
WP Ultimate Post Grid v1.7.2
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / helpers / vafpress / vafpress_menu_whitelist.php

vafpress_menu_whitelist.php in WP Ultimate Post Grid 1.7.2, at helpers/vafpress/vafpress_menu_whitelist.php

68 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 function wpupg_admin_premium_not_installed()
3 {
4 return !WPUltimatePostGrid::is_premium_active();
5 }
6
7 function wpupg_admin_premium_installed()
8 {
9 return WPUltimatePostGrid::is_premium_active();
10 }
11
12 function wpupg_admin_grids()
13 {
14 $args = array(
15 'post_type' => WPUPG_POST_TYPE,
16 'post_status' => array( 'publish', 'private' ),
17 'posts_per_page' => -1,
18 'nopaging' => true,
19 'orderby' => 'date',
20 'order' => 'ASC',
21 );
22
23 $query = new WP_Query( $args );
24 $posts = $query->have_posts() ? $query->posts : array();
25
26 $grids = array();
27 foreach( $posts as $post ) {
28 $grids[] = array(
29 'value' => $post->ID,
30 'label' => $post->post_title,
31 );
32 }
33
34 return $grids;
35 }
36
37 function wpupg_admin_template_editor()
38 {
39 if( WPUltimatePostGrid::is_addon_active( 'template-editor' ) ) {
40 $url = WPUltimatePostGrid::addon( 'template-editor' )->editor_url();
41 $button = '<a href="' . $url . '" class="button button-primary" target="_blank">' . __('Open the Template Editor', 'wp-ultimate-post-grid') . '</a>';
42 } else {
43 $button = '<a href="#" class="button button-primary button-disabled" disabled>' . __('Open the Template Editor', 'wp-ultimate-post-grid') . '</a>';
44 }
45
46 return $button;
47 }
48
49 function wpupg_admin_post_types()
50 {
51 $post_types = get_post_types( '', 'names' );
52 $types = array();
53
54 foreach( $post_types as $post_type ) {
55 $types[] = array(
56 'value' => $post_type,
57 'label' => ucfirst( $post_type )
58 );
59 }
60
61 return $types;
62 }
63
64 VP_Security::instance()->whitelist_function( 'wpupg_admin_premium_not_installed' );
65 VP_Security::instance()->whitelist_function( 'wpupg_admin_premium_installed' );
66 VP_Security::instance()->whitelist_function( 'wpupg_admin_grids' );
67 VP_Security::instance()->whitelist_function( 'wpupg_admin_template_editor' );
68 VP_Security::instance()->whitelist_function( 'wpupg_admin_post_types' );