Move main observer element to action hook
This commit is contained in:
parent
af187a4ff6
commit
d15d4c6e1d
2
404.php
2
404.php
@ -18,8 +18,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<main id="main" class="main singular the-404">
|
<main id="main" class="main singular the-404">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', '404' ); ?>
|
<?php do_action( 'fictioneer_main', '404' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -674,12 +674,13 @@ Fires before the content of the card grid is rendered in the `partials/_card-sto
|
|||||||
---
|
---
|
||||||
|
|
||||||
### `do_action( 'fictioneer_main', $context )`
|
### `do_action( 'fictioneer_main', $context )`
|
||||||
Fires after opening the site’s `<main>` container, right after the `.main-observer` element.
|
Fires after opening the site’s `<main>` container.
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
* $context (string|null) – Context of the action call. Unsafe.
|
* $context (string|null) – Context of the action call, typically related to the template. Unsafe.
|
||||||
|
|
||||||
**Hooked Actions:**
|
**Hooked Actions:**
|
||||||
|
* `fictioneer_main_observer()` – Renders the main observer element. Priority 1.
|
||||||
* `fictioneer_page_background()` – Renders the page background. Priority 10.
|
* `fictioneer_page_background()` – Renders the page background. Priority 10.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -93,8 +93,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main author-page singular">
|
<main id="main" class="main author-page singular">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'author' ); ?>
|
<?php do_action( 'fictioneer_main', 'author' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -16,8 +16,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main archive category-archive">
|
<main id="main" class="main archive category-archive">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'category-archive' ); ?>
|
<?php do_action( 'fictioneer_main', 'category-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -93,8 +93,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular chapters">
|
<main id="main" class="main singular chapters">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'chapters' ); ?>
|
<?php do_action( 'fictioneer_main', 'chapters' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -53,8 +53,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular collections">
|
<main id="main" class="main singular collections">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'collections' ); ?>
|
<?php do_action( 'fictioneer_main', 'collections' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -2049,7 +2049,20 @@ function fictioneer_get_story_changelog( $story_id ) {
|
|||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the page background element
|
* Renders the main observer element
|
||||||
|
*
|
||||||
|
* @since 5.20.0
|
||||||
|
*
|
||||||
|
* @param string|null $context Optional. Context of the function call.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function fictioneer_main_observer( $context = null ) {
|
||||||
|
echo '<div class="observer main-observer"></div>';
|
||||||
|
}
|
||||||
|
add_action( 'fictioneer_main', 'fictioneer_main_observer', 1 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page background element
|
||||||
*
|
*
|
||||||
* Note: The page background is a separate element, absolute positioned under the
|
* Note: The page background is a separate element, absolute positioned under the
|
||||||
* actual content. This allows for quite some CSS shenanigans and can improve the
|
* actual content. This allows for quite some CSS shenanigans and can improve the
|
||||||
|
@ -19,8 +19,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main index">
|
<main id="main" class="main index">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper"><?php
|
<div class="main__wrapper"><?php
|
||||||
|
@ -53,8 +53,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular recommendations">
|
<main id="main" class="main singular recommendations">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'recommendations' ); ?>
|
<?php do_action( 'fictioneer_main', 'recommendations' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -69,8 +69,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main search-results">
|
<main id="main" class="main search-results">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'search' ); ?>
|
<?php do_action( 'fictioneer_main', 'search' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -32,8 +32,6 @@ get_header(
|
|||||||
|
|
||||||
<main id="main" class="main chapter">
|
<main id="main" class="main chapter">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'chapter' ); ?>
|
<?php do_action( 'fictioneer_main', 'chapter' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -22,8 +22,6 @@ get_header( null, array( 'type' => 'fcn_collection' ) );
|
|||||||
|
|
||||||
<main id="main" class="main collection">
|
<main id="main" class="main collection">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'collection' ); ?>
|
<?php do_action( 'fictioneer_main', 'collection' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -21,8 +21,6 @@ get_header( null, array( 'type' => 'fcn_recommendation' ) );
|
|||||||
|
|
||||||
<main id="main" class="main recommendation">
|
<main id="main" class="main recommendation">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'recommendation' ); ?>
|
<?php do_action( 'fictioneer_main', 'recommendation' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -29,8 +29,6 @@ get_header(
|
|||||||
|
|
||||||
<main id="main" class="main story <?php echo get_option( 'fictioneer_enable_checkmarks' ) ? '' : '_no-checkmarks'; ?>">
|
<main id="main" class="main story <?php echo get_option( 'fictioneer_enable_checkmarks' ) ? '' : '_no-checkmarks'; ?>">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'story' ); ?>
|
<?php do_action( 'fictioneer_main', 'story' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper _no-padding-top">
|
<div class="main__wrapper _no-padding-top">
|
||||||
|
@ -18,8 +18,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main post">
|
<main id="main" class="main post">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'post' ); ?>
|
<?php do_action( 'fictioneer_main', 'post' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -26,8 +26,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<main id="main" class="main singular bookmarks-page">
|
<main id="main" class="main singular bookmarks-page">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-bookmarks' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-bookmarks' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -70,8 +70,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<main id="main" class="main singular bookshelf">
|
<main id="main" class="main singular bookshelf">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-bookmarks-ajax' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-bookmarks-ajax' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -86,8 +86,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<main id="main" class="main singular bookshelf">
|
<main id="main" class="main singular bookshelf">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-bookshelf' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-bookshelf' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -18,8 +18,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="canvas">
|
<main id="main" class="canvas">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
while ( have_posts() ) {
|
while ( have_posts() ) {
|
||||||
the_post();
|
the_post();
|
||||||
|
@ -18,8 +18,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main canvas">
|
<main id="main" class="main canvas">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-canas-page' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-canas-page' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -18,8 +18,6 @@ get_header( null, array( 'blank' => 1 ) );
|
|||||||
|
|
||||||
<main id="main" class="canvas">
|
<main id="main" class="canvas">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
while ( have_posts() ) {
|
while ( have_posts() ) {
|
||||||
the_post();
|
the_post();
|
||||||
|
@ -78,8 +78,6 @@ reset( $sorted_stories );
|
|||||||
|
|
||||||
<main id="main" class="main singular index">
|
<main id="main" class="main singular index">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-index-advanced' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-index-advanced' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -74,8 +74,6 @@ reset( $sorted_stories );
|
|||||||
|
|
||||||
<main id="main" class="main singular index">
|
<main id="main" class="main singular index">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-index' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-index' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -26,8 +26,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular">
|
<main id="main" class="main singular">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-story' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-story' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper <?php echo $render_story_header ? '_no-padding-top' : ''; ?>">
|
<div class="main__wrapper <?php echo $render_story_header ? '_no-padding-top' : ''; ?>">
|
||||||
|
@ -59,8 +59,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular">
|
<main id="main" class="main singular">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-taxonomies' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-taxonomies' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -19,8 +19,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular">
|
<main id="main" class="main singular">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular-titleless' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-titleless' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -19,8 +19,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular">
|
<main id="main" class="main singular">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'singular' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -100,8 +100,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main singular stories">
|
<main id="main" class="main singular stories">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'stories' ); ?>
|
<?php do_action( 'fictioneer_main', 'stories' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
2
tag.php
2
tag.php
@ -17,8 +17,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main archive tag-archive">
|
<main id="main" class="main archive tag-archive">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'tag-archive' ); ?>
|
<?php do_action( 'fictioneer_main', 'tag-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -16,8 +16,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main archive character-archive">
|
<main id="main" class="main archive character-archive">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'character-archive' ); ?>
|
<?php do_action( 'fictioneer_main', 'character-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -16,8 +16,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main archive content-warning-archive">
|
<main id="main" class="main archive content-warning-archive">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'content-warning-archive' ); ?>
|
<?php do_action( 'fictioneer_main', 'content-warning-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -16,8 +16,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main archive fandom-archive">
|
<main id="main" class="main archive fandom-archive">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'fandom-archive' ); ?>
|
<?php do_action( 'fictioneer_main', 'fandom-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -16,8 +16,6 @@ get_header();
|
|||||||
|
|
||||||
<main id="main" class="main archive genre-archive">
|
<main id="main" class="main archive genre-archive">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'genre-archive' ); ?>
|
<?php do_action( 'fictioneer_main', 'genre-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
@ -62,8 +62,6 @@ get_header( null, array( 'type' => 'user-profile', 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<main id="main" class="main singular profile">
|
<main id="main" class="main singular profile">
|
||||||
|
|
||||||
<div class="observer main-observer"></div>
|
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main', 'user-profile' ); ?>
|
<?php do_action( 'fictioneer_main', 'user-profile' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user