-
have_posts() ) {
$content = $contents->next_post();
?>
options->section_slug); $preview = array_key_exists('preview', $_GET) && ($_GET['preview'] == 'true') && is_user_logged_in() && current_user_can('read', $post->ID); // Let's default to showing the first section if no section or invalid section // if section is specified, follow article options unless showtocalways is false and showallsections is true the_post(); $has_section = $section ? true : false; $always_show_toc = get_post_meta( $post->ID, af_namespace() . '_always_show_toc', 'false' ) == 'true' ? true : false; $show_all_sections = (get_post_meta( $post->ID, af_namespace() . '_show_all_sections', 'false' ) == 'true') || (array_key_exists('show_all_sections', $_GET) && ($_GET['show_all_sections'] == 'true')); $show_toc = (!$has_section && $show_all_sections && $always_show_toc) || (!$has_section && !$show_all_sections) || ($has_section && $always_show_toc); $show_all_sections = !$has_section && $show_all_sections; function af_check_preview($post_id = 0) { if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) { $id = (int) $_GET['preview_id']; if ($id != $post_id) return false; if ( false == wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) wp_die( __('You do not have permission to preview drafts.') ); return true; } return false; } function af_section_url($content, $preview) { $url = get_permalink() . articleforge()->options->section_slug . "/" . $content->post_name; if ($preview) { $url = add_query_arg(array( 'preview' => 'true' ), $url); } return $url; } $content = null; global $content; ?>