Reduce PHP/HTML mode-switch overhead
Probably impossible to notice, but still.
This commit is contained in:
parent
d136d97c13
commit
c384de6e01
7
404.php
7
404.php
@ -6,16 +6,15 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.7.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$custom_404 = intval( get_option( 'fictioneer_404_page', -1 ) ?: -1 );
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular the-404">
|
||||
|
||||
|
@ -7,9 +7,7 @@
|
||||
* @since 4.6.0
|
||||
* @see fictioneer_clause_sticky_stories()
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Get queried author
|
||||
$author_id = get_queried_object_id();
|
||||
@ -88,9 +86,10 @@ if ( ! array_key_exists( $current_tab, $tabs ) ) {
|
||||
// Select tab
|
||||
$tabs[ $current_tab ]['classes'][] = '_current';
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main author-page singular">
|
||||
|
||||
|
@ -7,9 +7,12 @@
|
||||
* @since 3.0
|
||||
* @see partials/_archive-loop.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main archive category-archive">
|
||||
|
||||
|
@ -10,9 +10,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 3.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
@ -88,9 +86,10 @@ if ( function_exists( 'update_post_author_caches' ) ) {
|
||||
update_post_author_caches( $list_of_chapters->posts );
|
||||
}
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular chapters">
|
||||
|
||||
|
@ -10,9 +10,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 5.0.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
@ -48,9 +46,10 @@ if ( function_exists( 'update_post_author_caches' ) ) {
|
||||
update_post_author_caches( $list_of_collections->posts );
|
||||
}
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular collections">
|
||||
|
||||
|
@ -8,9 +8,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.7.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Don't show the comments if the password has not been entered
|
||||
if ( post_password_required() ) {
|
||||
|
@ -18,9 +18,7 @@
|
||||
* @internal $args['post_type'] Optional. Current post type.
|
||||
* @internal $args['breadcrumbs'] Array of breadcrumb tuples with label (0) and link (1).
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$page_id = get_queried_object_id();
|
||||
|
@ -17,9 +17,7 @@
|
||||
*
|
||||
* @internal $args Array of arguments passed to the template.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
||||
global $fictioneer_render_start_time;
|
||||
|
@ -10,9 +10,12 @@
|
||||
* @since 4.6.0
|
||||
* @see partials/_loop.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main index">
|
||||
|
||||
|
@ -10,9 +10,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 3.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
@ -48,9 +46,10 @@ if ( function_exists( 'update_post_author_caches' ) ) {
|
||||
update_post_author_caches( $list_of_recommendations->posts );
|
||||
}
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular recommendations">
|
||||
|
||||
|
@ -7,9 +7,7 @@
|
||||
* @since 5.0.0
|
||||
* @since 5.11.0 - Consider querying for story status.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
global $wp_query;
|
||||
|
||||
@ -64,9 +62,10 @@ $is_advanced_search = $post_type != 'any' || $sentence != '0' || $order != 'desc
|
||||
|
||||
$hook_args['is_advanced_search'] = $is_advanced_search;
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main search-results">
|
||||
<div class="observer main-observer"></div>
|
||||
|
@ -12,9 +12,7 @@
|
||||
* @internal $args['preselect_type'] Optional. Default post type to query.
|
||||
* @internal $args['cache'] Whether to account for active caching.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$no_params = empty( array_filter( $_GET ) );
|
||||
|
@ -9,9 +9,7 @@
|
||||
* @since 1.0
|
||||
* @see comments.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$password_required = post_password_required();
|
||||
|
@ -13,9 +13,7 @@
|
||||
* @see partials/_collection-header.php
|
||||
* @see partials/_collection-statistics.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Header
|
||||
get_header( null, array( 'type' => 'fcn_collection' ) );
|
||||
|
@ -9,9 +9,7 @@
|
||||
* @since 4.0.0
|
||||
* @see partials/_recommendation-header.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$password_required = post_password_required();
|
||||
|
@ -10,9 +10,7 @@
|
||||
* @see partials/_story-header.php
|
||||
* @see partials/_story-footer.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = $args['post_id'] ?? get_the_ID();
|
||||
|
@ -6,9 +6,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 1.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$password_required = post_password_required();
|
||||
|
@ -11,9 +11,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.6.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Return home if bookmarks are disabled
|
||||
if ( ! get_option( 'fictioneer_enable_bookmarks' ) ) {
|
||||
@ -21,9 +19,10 @@ if ( ! get_option( 'fictioneer_enable_bookmarks' ) ) {
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular bookmarks-page">
|
||||
|
||||
|
@ -10,9 +10,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 5.0.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$current_tab = sanitize_key( $_GET['tab'] ?? '' );
|
||||
@ -65,9 +63,10 @@ if ( ! array_key_exists( $current_tab, $tabs ) ) {
|
||||
// Select tab
|
||||
$tabs[ $current_tab ]['classes'][] = '_current';
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular bookshelf">
|
||||
|
||||
|
@ -10,9 +10,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 5.0.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Only for logged-in users...
|
||||
if ( ! is_user_logged_in() || get_option( 'fictioneer_enable_public_cache_compatibility' ) ) {
|
||||
@ -81,9 +79,10 @@ if ( ! array_key_exists( $current_tab, $tabs ) ) {
|
||||
// Select tab
|
||||
$tabs[ $current_tab ]['classes'][] = '_current';
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular bookshelf">
|
||||
|
||||
|
@ -6,9 +6,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 5.14.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
|
@ -6,9 +6,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 5.14.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
|
@ -8,9 +8,7 @@
|
||||
* @see partials/_story-header.php
|
||||
* @see partials/_story-footer.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_post_meta( get_the_ID(), 'fictioneer_template_story_id', true );
|
||||
@ -23,3 +21,5 @@ if ( ! $post_id ) {
|
||||
$post = get_post( $post_id );
|
||||
|
||||
get_template_part( 'single-fcn_story', null, array( 'post_id' => $post_id ) );
|
||||
|
||||
?>
|
||||
|
@ -7,9 +7,7 @@
|
||||
* @since 5.14.0
|
||||
* @see comments.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
|
@ -6,9 +6,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 5.0.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Queries
|
||||
$tags = get_terms(
|
||||
@ -54,9 +52,10 @@ $terms = array(
|
||||
'characters' => [__( 'Characters', 'fictioneer' ), $characters]
|
||||
);
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular">
|
||||
|
||||
|
@ -7,9 +7,7 @@
|
||||
* @since 1.0
|
||||
* @see comments.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
|
@ -7,9 +7,7 @@
|
||||
* @since 1.0
|
||||
* @see comments.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
|
@ -11,9 +11,7 @@
|
||||
* @since 3.0
|
||||
* @see fictioneer_clause_sticky_stories()
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Setup
|
||||
$post_id = get_the_ID();
|
||||
@ -95,9 +93,10 @@ if ( function_exists( 'update_post_author_caches' ) ) {
|
||||
update_post_author_caches( $list_of_stories->posts );
|
||||
}
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
<?php get_header(); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular stories">
|
||||
|
||||
|
7
tag.php
7
tag.php
@ -8,9 +8,12 @@
|
||||
* @see wp_tag_cloud()
|
||||
* @see partials/_archive-loop.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main archive tag-archive">
|
||||
|
||||
|
@ -7,9 +7,12 @@
|
||||
* @since 4.0.0
|
||||
* @see partials/_archive-loop.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main archive character-archive">
|
||||
|
||||
|
@ -7,9 +7,12 @@
|
||||
* @since 4.6.0
|
||||
* @see partials/_archive-loop.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main archive content-warning-archive">
|
||||
|
||||
|
@ -7,9 +7,12 @@
|
||||
* @since 4.0.0
|
||||
* @see partials/_archive-loop.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main archive fandom-archive">
|
||||
|
||||
|
@ -7,9 +7,12 @@
|
||||
* @since 4.6.0
|
||||
* @see partials/_archive-loop.php
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main archive genre-archive">
|
||||
|
||||
|
@ -10,9 +10,7 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.5.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// Only for logged-in users...
|
||||
if ( ! is_user_logged_in() && ! get_option( 'fictioneer_enable_public_cache_compatibility' ) ) {
|
||||
@ -57,9 +55,10 @@ $hook_args = array(
|
||||
'is_moderator' => $is_moderator
|
||||
);
|
||||
|
||||
?>
|
||||
// Header
|
||||
get_header( null, array( 'type' => 'user-profile' ) );
|
||||
|
||||
<?php get_header( null, array( 'type' => 'user-profile' ) ); ?>
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular profile">
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user