Skip to content

Commit 07c9daf

Browse files
committed
Don't show drafts in the sidebar.
1 parent 1a18faa commit 07c9daf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

jquery.com/sidebar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
<h3 class="widget-title">Recent Posts</h3>
1414
<ul>
1515
<?php
16-
$recent_posts = wp_get_recent_posts();
16+
$recent_posts = wp_get_recent_posts(array(
17+
'post_status' => 'publish'
18+
));
1719
foreach( $recent_posts as $recent ){
1820
echo '<li><a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"].'</a></li>';
1921
}

jqueryui.com/sidebar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
<h3 class="widget-title">Recent Posts</h3>
1414
<ul>
1515
<?php
16-
$recent_posts = wp_get_recent_posts();
16+
$recent_posts = wp_get_recent_posts(array(
17+
'post_status' => 'publish'
18+
));
1719
foreach( $recent_posts as $recent ){
1820
echo '<li><a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"].'</a></li>';
1921
}

0 commit comments

Comments
 (0)