-
Notifications
You must be signed in to change notification settings - Fork 1
/
posts.php
56 lines (49 loc) · 2.66 KB
/
posts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); ?>
<tr valign="top">
<th scope="row"><label for="categories"><?php _e( 'Select Categories', 'bulk-post-update-date' ); ?></label></th>
<td>
<select multiple="multiple" id="categories" name="categories[]">
<?php
$args = array(
'orderby' => 'name',
// 'exclude' => '1'
);
$categories = get_categories( $args );
foreach ( $categories as $category ) { ?>
<option value="<?php echo $category->term_id; ?>">
<?php echo $category->cat_name . ' (' . $category->category_count . ')'; ?>
</option>
<?php } //endforeach ?>
</select>
<p class="description">
<?php _e( 'Will apply on all posts if no category is selected. Select multiple categories by holding Ctrl or Command key while selecting.', 'bulk-post-update-date' ); ?>
</p>
</td>
</tr>
<?php
// Do not show tags option if there are more than 500 tags to save memory
$total_tags = wp_count_terms( 'post_tag' );
if ( $total_tags < 500 ) :
?>
<tr valign="top">
<th scope="row"><label for="tags"><?php _e( 'Select Tags', 'bulk-post-update-date' ); ?></label></th>
<td>
<select multiple="multiple" id="tags" name="tags[]">
<?php
$args = array(
'orderby' => 'name',
// 'exclude' => '1'
);
$tags = get_tags( $args );
foreach ( $tags as $tag ) { ?>
<option value="<?php echo $tag->slug; ?>">
<?php echo $tag->name . ' (' . $tag->count . ')'; ?>
</option>
<?php } //endforeach ?>
</select>
<p class="description">
<?php _e( 'Will apply on all posts if no tag is selected. Select multiple tags by holding Ctrl or Command key while selecting.', 'bulk-post-update-date' ); ?>
</p>
</td>
</tr>
<?php endif; ?>