} else {
if (count($path_components) >= 1) {
$slug = $path_components[0];
- $page_id = cx_posts_find_page_id($slug);
+ $page_id = cx_posts_find_page_id($slug, include_drafts: cx_admin_logged_in());
if ($page_id) {
$template = 'post';
$template_variables['post_id'] = $page_id;
$year = $path_components[0];
$month = $path_components[1];
$slug = $path_components[2];
- $post_id = cx_posts_find_article_id($slug);
+ $post_id = cx_posts_find_article_id($slug, include_drafts: cx_admin_logged_in());
if ($post_id) {
$template = 'post';
$template_variables['post_id'] = $post_id;