Constant to turn off chapter-story filter

Dubious action but okay.
This commit is contained in:
Tetrakern 2023-01-28 16:11:02 +01:00
parent 61d2f29b09
commit 6b1a2a10dd
2 changed files with 10 additions and 1 deletions

View File

@ -123,6 +123,12 @@ if ( ! defined( 'FICTIONEER_SHOW_AJAX_COMMENT_DISALLOWED_KEYS' ) ) {
define( 'FICTIONEER_SHOW_AJAX_COMMENT_DISALLOWED_KEYS', true );
}
// Boolean: Only allow assigned chapters in stories
// Warning: The chapter navigation always refers to the parent story!
if ( ! defined( 'FICTIONEER_FILTER_STORY_CHAPTERS' ) ) {
define( 'FICTIONEER_FILTER_STORY_CHAPTERS', true );
}
// =============================================================================
// GLOBAL
// =============================================================================

View File

@ -89,7 +89,10 @@ function fictioneer_acf_filter_chapters( $args, $field, $post_id ) {
);
return $args;
}
add_filter( 'acf/fields/relationship/query/name=fictioneer_story_chapters', 'fictioneer_acf_filter_chapters', 10, 3 );
if ( FICTIONEER_FILTER_STORY_CHAPTERS ) {
add_filter( 'acf/fields/relationship/query/name=fictioneer_story_chapters', 'fictioneer_acf_filter_chapters', 10, 3 );
}
// =============================================================================
// UPDATE POST FEATURED LIST RELATIONSHIP REGISTRY