Add FICTIONEER_ENABLE_ALL_AUTHOR_PROFILES

This commit is contained in:
Tetrakern 2024-12-31 17:14:51 +01:00
parent 431966fc00
commit f80278b459
3 changed files with 11 additions and 2 deletions

View File

@ -1579,4 +1579,5 @@ define( 'CONSTANT_NAME', value );
| FICTIONEER_ENABLE_ASYNC_ONLOAD_PATTERN | boolean | Whether the [onload pattern](https://www.filamentgroup.com/lab/load-css-simpler/) for asynchronous CSS loading is used. Default `true`. | FICTIONEER_ENABLE_ASYNC_ONLOAD_PATTERN | boolean | Whether the [onload pattern](https://www.filamentgroup.com/lab/load-css-simpler/) for asynchronous CSS loading is used. Default `true`.
| FICTIONEER_SHOW_LATEST_CHAPTERS_ON_STORY_CARDS | boolean | Whether to show the latest instead of the first chapters on story cards. Default `false`. | FICTIONEER_SHOW_LATEST_CHAPTERS_ON_STORY_CARDS | boolean | Whether to show the latest instead of the first chapters on story cards. Default `false`.
| FICTIONEER_LIST_SCHEDULED_CHAPTERS | boolean | Whether to show scheduled chapters in lists. Default `false`. | FICTIONEER_LIST_SCHEDULED_CHAPTERS | boolean | Whether to show scheduled chapters in lists. Default `false`.
| FICTIONEER_ENABLE_ALL_AUTHOR_PROFILES | boolean | Whether to enable all author profile pages. Default `false`.
| FICTIONEER_EXAMPLE_CHAPTER_ICONS | array | Collection of example Font Awesome icon class strings. | FICTIONEER_EXAMPLE_CHAPTER_ICONS | array | Collection of example Font Awesome icon class strings.

View File

@ -15,8 +15,11 @@ $author = get_userdata( $author_id );
// Return home if not a valid author // Return home if not a valid author
if ( if (
! FICTIONEER_ENABLE_ALL_AUTHOR_PROFILES &&
(
! fictioneer_is_author( $author_id ) || ! fictioneer_is_author( $author_id ) ||
count_user_posts( $author_id, ['fcn_story', 'fcn_chapter'] ) < 1 count_user_posts( $author_id, ['fcn_story', 'fcn_chapter'] ) < 1
)
) { ) {
wp_redirect( home_url() ); wp_redirect( home_url() );
exit(); exit();

View File

@ -444,6 +444,11 @@ if ( ! defined( 'FICTIONEER_LIST_SCHEDULED_CHAPTERS' ) ) {
define( 'FICTIONEER_LIST_SCHEDULED_CHAPTERS', false ); define( 'FICTIONEER_LIST_SCHEDULED_CHAPTERS', false );
} }
// Boolean: Whether to enable all author profile pages
if ( ! defined( 'FICTIONEER_ENABLE_ALL_AUTHOR_PROFILES' ) ) {
define( 'FICTIONEER_ENABLE_ALL_AUTHOR_PROFILES', false );
}
// ============================================================================= // =============================================================================
// GLOBAL // GLOBAL
// ============================================================================= // =============================================================================