PluginProbe
WP Ultimate Post Grid / 1.7.1
WP Ultimate Post Grid v1.7.1
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 / meta_boxes / meta_box_data_source.php

meta_box_data_source.php in WP Ultimate Post Grid 1.7.1, at helpers/meta_boxes/meta_box_data_source.php

90 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Grid should never be null. Construct just allows easy access to WPUPG_Grid functions in IDE.
3 if( is_null( $grid ) ) $grid = new WPUPG_Grid(0);
4 $premium_only = WPUltimatePostGrid::is_premium_active() ? '' : ' (' . __( 'Premium only', 'wp-ultimate-post-grid' ) . ')';
5 ?>
6
7 <input type="hidden" name="wpupg_nonce" value="<?php echo wp_create_nonce( 'grid' ); ?>" />
8 <table id="wpupg_form_data_source" class="wpupg_form">
9 <tr>
10 <td><label for="wpupg_post_types"><?php _e( 'Post Types', 'wp-ultimate-post-grid' ); ?></label></td>
11 <td>
12 <select name="wpupg_post_types" id="wpupg_post_types" class="wpupg-select2">
13 <?php
14 $post_types = get_post_types( '', 'objects' );
15
16 unset( $post_types[WPUPG_POST_TYPE] );
17 unset( $post_types['revision'] );
18 unset( $post_types['nav_menu_item'] );
19
20 foreach( $post_types as $post_type => $options ) {
21 $selected = in_array( $post_type, $grid->post_types() ) ? ' selected="selected"' : '';
22 echo '<option value="' . esc_attr( $post_type ) . '"' . $selected . '>' . $options->labels->name . '</option>';
23 }
24 ?>
25 </select>
26 </td>
27 <td><?php _e( 'Post types to be displayed in the grid.', 'wp-ultimate-post-grid' ); ?></td>
28 </tr>
29 <tr class="wpupg_divider">
30 <td><label for="wpupg_order_by"><?php _e( 'Order By', 'wp-ultimate-post-grid' ); ?></label></td>
31 <td>
32 <select name="wpupg_order_by" id="wpupg_order_by" class="wpupg-select2">
33 <?php
34 $order_by_options = array(
35 'title' => __( 'Title', 'wp-ultimate-post-grid' ),
36 'date' => __( 'Date', 'wp-ultimate-post-grid' ),
37 'rand' => __( 'Random', 'wp-ultimate-post-grid' ),
38 );
39
40 foreach( $order_by_options as $order_by => $order_by_name ) {
41 $selected = $order_by == $grid->order_by() ? ' selected="selected"' : '';
42 echo '<option value="' . esc_attr( $order_by ) . '"' . $selected . '>' . $order_by_name . '</option>';
43 }
44 ?>
45 </select>
46 </td>
47 <td><?php _e( 'How to order the posts in the grid.', 'wp-ultimate-post-grid' ); ?></td>
48 </tr>
49 <tr>
50 <td><label for="wpupg_order"><?php _e( 'Order', 'wp-ultimate-post-grid' ); ?></label></td>
51 <td>
52 <select name="wpupg_order" id="wpupg_order" class="wpupg-select2">
53 <?php
54 $order_options = array(
55 'asc' => __( 'Ascending', 'wp-ultimate-post-grid' ),
56 'desc' => __( 'Descending', 'wp-ultimate-post-grid' ),
57 );
58
59 foreach( $order_options as $order => $order_name ) {
60 $selected = $order == $grid->order() ? ' selected="selected"' : '';
61 echo '<option value="' . esc_attr( $order ) . '"' . $selected . '>' . $order_name . '</option>';
62 }
63 ?>
64 </select>
65 </td>
66 <td>&nbsp;</td>
67 </tr>
68 <tr class="wpupg_divider">
69 <td><label for="wpupg_images_only"><?php _e( 'Images Only', 'wp-ultimate-post-grid' ); ?></label></td>
70 <td>
71 <input type="checkbox" name="wpupg_images_only" id="wpupg_images_only" <?php if( $grid->images_only() ) echo 'checked="true" '?>/>
72 </td>
73 <td><?php _e( 'Only display posts with a featured image.', 'wp-ultimate-post-grid' ); ?></td>
74 </tr>
75 <tr class="wpupg_divider">
76 <td><label for="wpupg_limit_posts_number"><?php _e( 'Limit Total # Posts', 'wp-ultimate-post-grid' ); ?></label></td>
77 <td>
78 <input type="number" min="1" name="wpupg_limit_posts_number" id="wpupg_limit_posts_number" value="<?php echo $grid->limit_posts_number(); ?>"/>
79 </td>
80 <td><?php _e( 'Limit the total number of posts in the grid.', 'wp-ultimate-post-grid' ); ?></td>
81 </tr>
82 <tr>
83 <td><label for="wpupg_limit_posts"><?php _e( 'Limit Posts', 'wp-ultimate-post-grid' ); ?></label></td>
84 <td>
85 <input type="checkbox" name="wpupg_limit_posts" id="wpupg_limit_posts" <?php if( $grid->limit_posts() ) echo 'checked="true" '?>/>
86 <?php echo $premium_only; ?>
87 </td>
88 <td><?php _e( 'Limit the posts that will be shown in the grid.', 'wp-ultimate-post-grid' ); ?></td>
89 </tr>
90 </table>