Add context to fictioneer_main action
... and fix chapter double background.
This commit is contained in:
parent
94ba62ae70
commit
c00356da92
2
404.php
2
404.php
@ -20,7 +20,7 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', '404' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -673,9 +673,12 @@ Fires before the content of the card grid is rendered in the `partials/_card-sto
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `do_action( 'fictioneer_main' )`
|
### `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, right after the `.main-observer` element.
|
||||||
|
|
||||||
|
**Parameters:**
|
||||||
|
* $context (string|null) – Context of the action call. Unsafe.
|
||||||
|
|
||||||
**Hooked Actions:**
|
**Hooked Actions:**
|
||||||
* `fictioneer_page_background()` – Renders the page background. Priority 10.
|
* `fictioneer_page_background()` – Renders the page background. Priority 10.
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'author' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'category-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'chapters' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'collections' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -2056,11 +2056,20 @@ function fictioneer_get_story_changelog( $story_id ) {
|
|||||||
* render performance in certain scenarios. Hooked to 'fictioneer_main' action.
|
* render performance in certain scenarios. Hooked to 'fictioneer_main' action.
|
||||||
*
|
*
|
||||||
* @since 5.20.0
|
* @since 5.20.0
|
||||||
|
*
|
||||||
|
* @param string|null $context Optional. Context of the function call.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function fictioneer_page_background() {
|
function fictioneer_page_background( $context = null ) {
|
||||||
|
// Setup
|
||||||
$background = '<div class="main__background polygon polygon--main background-texture"></div>';
|
$background = '<div class="main__background polygon polygon--main background-texture"></div>';
|
||||||
|
|
||||||
|
// Chapter?
|
||||||
|
if ( $context === 'chapter' ) {
|
||||||
|
$background = '<div class="main__background chapter__background polygon polygon--main background-texture"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render
|
||||||
echo apply_filters( 'fictioneer_filter_page_background', $background );
|
echo apply_filters( 'fictioneer_filter_page_background', $background );
|
||||||
}
|
}
|
||||||
add_action( 'fictioneer_main', 'fictioneer_page_background' );
|
add_action( 'fictioneer_main', 'fictioneer_page_background' );
|
||||||
|
@ -55,7 +55,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'recommendations' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'search' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -34,9 +34,7 @@ get_header(
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'chapter' ); ?>
|
||||||
|
|
||||||
<div class="main__background chapter__background polygon polygon--main background-texture"></div>
|
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ get_header( null, array( 'type' => 'fcn_collection' ) );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'collection' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ get_header( null, array( 'type' => 'fcn_recommendation' ) );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'recommendation' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ get_header(
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'story' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper _no-padding-top">
|
<div class="main__wrapper _no-padding-top">
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'post' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-bookmarks' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-bookmarks-ajax' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ get_header( null, array( 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-bookshelf' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-canas-page' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ reset( $sorted_stories );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-index-advanced' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ reset( $sorted_stories );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-index' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?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' : ''; ?>">
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-taxonomies' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular-titleless' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'singular' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'stories' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
2
tag.php
2
tag.php
@ -19,7 +19,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'tag-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'character-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'content-warning-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'fandom-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ get_header();
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'genre-archive' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ get_header( null, array( 'type' => 'user-profile', 'no_index' => 1 ) );
|
|||||||
|
|
||||||
<div class="observer main-observer"></div>
|
<div class="observer main-observer"></div>
|
||||||
|
|
||||||
<?php do_action( 'fictioneer_main' ); ?>
|
<?php do_action( 'fictioneer_main', 'user-profile' ); ?>
|
||||||
|
|
||||||
<div class="main__wrapper">
|
<div class="main__wrapper">
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user