Version 5.21.0 #39

Merged
Tetrakern merged 43 commits from next_version into main 2024-07-06 21:12:42 +08:00
50 changed files with 2215 additions and 1229 deletions

View File

@ -1118,6 +1118,20 @@ Fires right between the comments list and heading in the `fictioneer_story_comme
---
### `do_action( 'fictioneer_text_center_header', $args )`
Fires right after opening the `<header>` container for the "Text (Centered)" header style.
**$args:**
* $post_id (int|null) Current post ID. Unsafe.
* $story_id (int|null) Current story ID. Unsafe.
* $header_image_url (string|boolean) URL of the filtered header image or false.
* $header_args (array) Arguments passed to the header.php partial.
**Hooked Actions:**
* `function( $args )` Anonymous function to output the header content. Priority 10.
---
### `do_action( 'fictioneer_toggled_follow', $story_id, $force )`
Fires after a Follow has been successfully toggled and right before the JSON response is sent.

View File

@ -238,7 +238,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `show_user_profile` | `fictioneer_custom_profile_fields`
| `switch_theme` | `fictioneer_theme_deactivation`
| `template_redirect` | `fictioneer_disable_date_archives`, `fictioneer_generate_epub`, `fictioneer_handle_oauth`, `fictioneer_logout`, `fictioneer_disable_attachment_pages`, `fictioneer_gate_unpublished_content`, `fictioneer_serve_sitemap`, `fictioneer_redirect_story`
| `transition_post_status` | `fictioneer_log_story_chapter_status_changes`
| `transition_post_status` | `fictioneer_log_story_chapter_status_changes`, `fictioneer_chapter_future_to_publish`
| `trashed_post` | `fictioneer_refresh_post_caches`, `fictioneer_track_chapter_and_story_updates`, `fictioneer_update_modified_date_on_story_for_chapter`, `fictioneer_purge_transients`, `fictioneer_remove_chapter_from_story`
| `untrash_post` | `fictioneer_refresh_post_caches`, `fictioneer_track_chapter_and_story_updates`, `fictioneer_update_modified_date_on_story_for_chapter`, `fictioneer_purge_transients`
| `update_option_*` | `fictioneer_update_option_disable_extended_chapter_list_meta_queries`, `fictioneer_update_option_disable_extended_story_list_meta_queries`

View File

@ -1174,7 +1174,9 @@ This location can be confusing. The page background is actually a separate eleme
**Hints:**
* The `nav_bar` location also overwrites the `nav_menu` location.
* Trying to overwrite the default navigation is generally a poor life choice, but you do you.
* Overwriting the navigation is possible but generally a poor life choice.
* Elementor disables several WordPress block styles when applied to a page...
* ... which can affect other elements, such as the Post Content header variant.
* Use the `padding-[top|right|bottom|left]` CSS classes to apply theme page padding.
* Use the `bg-[50|100|200|...|800|900|950]` CSS classes to force theme background colors.
* Use the `fg-[100|200|...|800|900|950]` CSS classes to force theme text colors.

4
FAQ.md
View File

@ -68,10 +68,6 @@ After activating the feature, you need to flush the permalinks. You can do this
Nobody can stop you from doing that, but it is wrong. Stories do not have the same capabilities as chapters and the theme does not understand the concept. There will be no formatting options, bookmarks, text-to-speech, suggestions, comments, and so forth. SEO data and API responses may also be messed up. If you can live with that, go ahead.
### Q: Why do chapter permalinks not include the story?
Because. And it is really difficult.
### Q: Can I use the theme for Japanese, Korean, Chinese, and other writing systems?
Apparently, even though this was never considered during development. WordPress is multi-lingual by default and the theme can be translated, which can be done with certain plugins too. You can change the word count script to count characters instead, with an optional multiplier for approximation. You will most likely need to add a [custom font](https://github.com/Tetrakern/fictioneer/blob/main/INSTALLATION.md#custom-fonts), though.

View File

@ -1382,6 +1382,8 @@ Filters the arguments passed to the `partials/_card-story` template part in the
* $order (string) Current query order argument. Default 'desc'.
* $orderby (string) Current query orderby argument. Default 'modified'.
* $ago (int|string) Current date query argument part. Default 0.
* $show_latest (boolean|null) Whether to show the latest chapters. Default `false`.
* $hide_author (boolean|null) Whether to hide the author. Default `false`.
**$args:**
* $current_page (int) Current page if paginated or `1`.

View File

@ -1518,4 +1518,5 @@ define( 'CONSTANT_NAME', value );
| FICTIONEER_ENABLE_STORY_CHANGELOG | boolean | Whether changes to the story chapter list should be logged. Default `true`.
| FICTIONEER_DEFER_SCRIPTS | boolean | Whether to defer scripts or load them in the footer. 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.
| FICTIONEER_EXAMPLE_CHAPTER_ICONS | array | Collection of example Font Awesome icon class strings.

View File

@ -1,7 +1,7 @@
<p align="center"><img src="./repo/assets/fictioneer_logo.svg?raw=true" alt="Fictioneer"></p>
<p align="center">
<a href="https://github.com/Tetrakern/fictioneer"><img alt="Theme: 5.20" src="https://img.shields.io/badge/theme-5.20-blue?style=flat" /></a>
<a href="https://github.com/Tetrakern/fictioneer"><img alt="Theme: 5.21" src="https://img.shields.io/badge/theme-5.21-blue?style=flat" /></a>
<a href="LICENSE.md"><img alt="License: GPL v3" src="https://img.shields.io/badge/license-GPL%20v3-blue?style=flat" /></a>
<a href="https://wordpress.org/download/"><img alt="WordPress 6.1+" src="https://img.shields.io/badge/WordPress-%3E%3D6.1-blue?style=flat" /></a>
<a href="https://www.php.net/"><img alt="PHP: 7.4+" src="https://img.shields.io/badge/php-%3E%3D7.4-blue?logoColor=white&style=flat" /></a>
@ -43,7 +43,7 @@ I do take commissions for customizations and new features, *within reason.* Just
## Support the Development
Fictioneer (up to 5.20) has been developed by one author, barring [credited](CREDITS.md) code snippets. This was an exhausting effort and is not sustainable, so any help going forward is appreciated. If you are interested, or want to fork your own version, take a look at the [development](DEVELOPMENT.md) guidelines, [action](ACTIONS.md) hooks, and [filter](FILTERS.md) hooks. A theme-related base plugin can be found [here](https://github.com/Tetrakern/fictioneer-base-plugin). You can also join the [Discord](https://discord.gg/tVfDB7EbaP).
Fictioneer (up to 5.21) has been developed by one author, barring [credited](CREDITS.md) code snippets. This was an exhausting effort and is not sustainable, so any help going forward is appreciated. If you are interested, or want to fork your own version, take a look at the [development](DEVELOPMENT.md) guidelines, [action](ACTIONS.md) hooks, and [filter](FILTERS.md) hooks. A theme-related base plugin can be found [here](https://github.com/Tetrakern/fictioneer-base-plugin). You can also join the [Discord](https://discord.gg/tVfDB7EbaP).
## Screenshots

View File

@ -376,6 +376,30 @@
"oF" : 1,
"pg" : 0
},
"\/css\/customize\/header-style-post-content.css" : {
"aP" : 1,
"bl" : 0,
"ci" : 0,
"co" : 0,
"ft" : 16,
"ma" : 0,
"oA" : 0,
"oAP" : "\/css\/customize\/header-style-post-content-min.css",
"oF" : 0,
"pg" : 0
},
"\/css\/customize\/header-style-text-center.css" : {
"aP" : 1,
"bl" : 0,
"ci" : 0,
"co" : 0,
"ft" : 16,
"ma" : 0,
"oA" : 0,
"oAP" : "\/css\/customize\/header-style-text-center-min.css",
"oF" : 0,
"pg" : 0
},
"\/css\/customize\/header-style-top-split.css" : {
"aP" : 1,
"bl" : 0,
@ -568,18 +592,6 @@
"oF" : 1,
"pg" : 0
},
"\/css\/override.css" : {
"aP" : 1,
"bl" : 0,
"ci" : 0,
"co" : 0,
"ft" : 16,
"ma" : 0,
"oA" : 1,
"oAP" : "\/css\/override-min.css",
"oF" : 1,
"pg" : 0
},
"\/css\/properties.css" : {
"aP" : 1,
"bl" : 0,
@ -3512,6 +3524,36 @@
"pg" : 0,
"sct" : 0
},
"\/src\/scss\/customize\/header-style-post-content.scss" : {
"aP" : 0,
"bl" : 0,
"co" : 0,
"dP" : 10,
"ec" : 1,
"ft" : 4,
"ma" : 0,
"oA" : 0,
"oAP" : "\/css\/customize\/header-style-post-content.css",
"oF" : 2,
"oS" : 3,
"pg" : 0,
"sct" : 0
},
"\/src\/scss\/customize\/header-style-text-center.scss" : {
"aP" : 0,
"bl" : 0,
"co" : 0,
"dP" : 10,
"ec" : 0,
"ft" : 4,
"ma" : 0,
"oA" : 0,
"oAP" : "\/css\/customize\/header-style-text-center.css",
"oF" : 2,
"oS" : 3,
"pg" : 0,
"sct" : 0
},
"\/src\/scss\/customize\/header-style-top-split.scss" : {
"aP" : 0,
"bl" : 0,
@ -3842,21 +3884,6 @@
"pg" : 0,
"sct" : 0
},
"\/src\/scss\/override.scss" : {
"aP" : 0,
"bl" : 0,
"co" : 0,
"dP" : 10,
"ec" : 1,
"ft" : 4,
"ma" : 0,
"oA" : 0,
"oAP" : "\/css\/override.css",
"oF" : 3,
"oS" : 3,
"pg" : 0,
"sct" : 0
},
"\/src\/scss\/properties.scss" : {
"aP" : 0,
"bl" : 0,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.post-content-header{flex:1 1 100%;width:100%}.post-content-header>:not(.alignfull){margin-left:auto;margin-right:auto;max-width:var(--site-width)}.post-content-header>*{width:var(--site-width)}.post-content-header>.alignfull{width:100%}

View File

@ -0,0 +1 @@
.text-center-header{display:flex;flex-direction:column;align-items:center;justify-content:center;height:var(--header-height);max-width:var(--site-width)}.text-center-header__content{text-align:center;margin:1rem 0 2rem}.text-center-header__content:not(._no-text-shadow){text-shadow:var(--site-title-text-shadow)}.text-center-header__title{color:var(--site-title-heading-color);font:900 var(--site-title-font-size)/1.3 var(--ff-site-title);letter-spacing:0}.text-center-header__tagline{color:var(--site-title-tagline-color);font:500 var(--site-title-tagline-font-size)/1.3 var(--ff-site-title);letter-spacing:0}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@

File diff suppressed because one or more lines are too long

View File

@ -5,9 +5,9 @@
// =============================================================================
// Version
define( 'FICTIONEER_VERSION', '5.20.4' );
define( 'FICTIONEER_VERSION', '5.21.0' );
define( 'FICTIONEER_MAJOR_VERSION', '5' );
define( 'FICTIONEER_RELEASE_TAG', 'v5.20.4' );
define( 'FICTIONEER_RELEASE_TAG', 'v5.21.0' );
if ( ! defined( 'CHILD_VERSION' ) ) {
define( 'CHILD_VERSION', null );
@ -408,6 +408,11 @@ if ( ! defined( 'FICTIONEER_ENABLE_ASYNC_ONLOAD_PATTERN' ) ) {
define( 'FICTIONEER_ENABLE_ASYNC_ONLOAD_PATTERN', true );
}
// Boolean: Whether to show the latest instead of the first chapters on story cards
if ( ! defined( 'FICTIONEER_SHOW_LATEST_CHAPTERS_ON_STORY_CARDS' ) ) {
define( 'FICTIONEER_SHOW_LATEST_CHAPTERS_ON_STORY_CARDS', false );
}
// =============================================================================
// GLOBAL
// =============================================================================

View File

@ -1428,6 +1428,8 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
'default' => _x( 'Default (Image)', 'Customizer header style option.', 'fictioneer' ),
'split' => _x( 'Split (Image)', 'Customizer header style option.', 'fictioneer' ),
'overlay' => _x( 'Overlay (Image)', 'Customizer header style option.', 'fictioneer' ),
'text_center' => _x( 'Text (Center)', 'Customizer header style option.', 'fictioneer' ),
'post_content' => _x( 'Post Content (ID)', 'Customizer header style option.', 'fictioneer' ),
'top' => _x( 'Top', 'Customizer header style option.', 'fictioneer' ),
'wide' => _x( 'Wide', 'Customizer header style option.', 'fictioneer' ),
'none' => _x( 'None', 'Customizer header style option.', 'fictioneer' )
@ -1468,6 +1470,31 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
)
);
// Post content header iD
$manager->add_setting(
'header_post_content_id',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'absint',
'default' => ''
)
);
$manager->add_control(
'header_post_content_id',
array(
'type' => 'number',
'priority' => 10,
'section' => 'layout',
'label' => __( 'Post Content Header ID', 'fictioneer' ),
'description' => __( 'Only used by the Post Content header style. Enter the ID of the post or page you want to render as header. Can impact performance.', 'fictioneer' ),
'input_attrs' => array(
'style' => 'width: 80px',
'min' => 0
)
)
);
// Clamp minimum for header height
$manager->add_setting(
'header_height_min',

View File

@ -956,6 +956,14 @@ function fictioneer_build_customize_css( $context = null ) {
$css .= fictioneer_get_customizer_css_snippet( 'header-style-wide' );
}
if ( $header_style === 'text_center' ) {
$css .= fictioneer_get_customizer_css_snippet( 'header-style-text-center' );
}
if ( $header_style === 'post_content' ) {
$css .= fictioneer_get_customizer_css_snippet( 'header-style-post-content' );
}
// --- Page styles -----------------------------------------------------------
if ( $page_style === 'polygon-mask-image-battered-ringbook' || $page_style === 'polygon-battered' ) {

View File

@ -1344,11 +1344,12 @@ if ( ! function_exists( 'fictioneer_get_list_chapter_meta_row' ) ) {
// Setup
$output = [];
$has_grid_view = ! empty( $args['grid'] );
$prefer_chapter_icon = get_option( 'fictioneer_override_chapter_status_icons' );
$hide_icons = get_option( 'fictioneer_hide_chapter_icons' ) ||
get_post_meta( $data['story_id'] ?? 0, 'fictioneer_story_hide_chapter_icons', true );
// Password
if ( $hide_icons && ! empty( $data['password'] ) ) {
if ( ! empty( $data['password'] ) && ( $hide_icons || $prefer_chapter_icon ) ) {
$output['protected'] = '<i class="fa-solid fa-lock chapter-group__list-item-protected list-view"></i>';
}

View File

@ -312,7 +312,7 @@ function fictioneer_remove_chapter_from_story( $chapter_id ) {
$chapters = fictioneer_unset_by_value( $chapter_id, $chapters );
update_post_meta( $story_id, 'fictioneer_story_chapters', $chapters );
update_post_meta( $story_id, 'fictioneer_chapters_modified', current_time( 'mysql' ) );
update_post_meta( $story_id, 'fictioneer_chapters_modified', current_time( 'mysql', true ) );
// Log change
fictioneer_log_story_chapter_changes( $story_id, $chapters, $previous );
@ -352,6 +352,31 @@ function fictioneer_chapter_to_draft( $post ) {
add_action( 'publish_to_draft', 'fictioneer_chapter_to_draft' );
add_action( 'private_to_draft', 'fictioneer_chapter_to_draft' );
/**
* Perform updates when a chapter goes from future to publish
*
* @since 5.21.0
*
* @param string $new_status New post status.
* @param string $old_status Old post status.
* @param WP_Post $post Post object.
*/
function fictioneer_chapter_future_to_publish( $new_status, $old_status, $post ) {
// Validate transition...
if ( $post->post_type !== 'fcn_chapter' || $old_status !== 'future' || $new_status !== 'publish' ) {
return;
}
// Update fictioneer_chapters_added field of story (if any)
$story_id = get_post_meta( $post->ID, 'fictioneer_chapter_story', true );
if ( $story_id ) {
update_post_meta( $story_id, 'fictioneer_chapters_added', $post->post_date_gmt );
}
}
add_action( 'transition_post_status', 'fictioneer_chapter_future_to_publish', 10, 3 );
// =============================================================================
// POST PASSWORD EXPIRATION
// =============================================================================

View File

@ -22,6 +22,31 @@ require_once __DIR__ . '/_setup-meta-fields.php';
require_once __DIR__ . '/users/_admin-profile.php';
// =============================================================================
// FIRST INSTALL
// =============================================================================
/**
* Redirects to setup menu page after installation
*
* @since 5.21.0
*/
function fictioneer_first_install() {
if ( is_admin() && isset( $_GET['activated'] ) && $GLOBALS['pagenow'] === 'themes.php' ) {
$theme_info = fictioneer_get_theme_info();
if ( ! ( $theme_info['setup'] ?? 0 ) ) {
$theme_info['setup'] = 1;
update_option( 'fictioneer_theme_info', $theme_info, 'yes' );
wp_safe_redirect( admin_url( 'admin.php?page=fictioneer_setup' ) );
exit;
}
}
}
add_action( 'after_setup_theme', 'fictioneer_first_install' );
// =============================================================================
// ENQUEUE ADMIN STYLESHEETS
// =============================================================================
@ -900,7 +925,7 @@ function fictioneer_get_mu_plugin_data() {
'filename' => 'fictioneer_002_elementor_control.php',
'name' => _x( 'Fictioneer Elementor Control', 'Theme mu-plugin.', 'fictioneer' ),
'description' => _x( 'Disables the Elementor plugin on all pages except those with a Canvas page template. Since Elementor consumes a lot of server resources, limiting it to actual use cases is sensible. However, this makes the plugin unavailable anywhere else on the frontend.', 'Theme mu-plugin.', 'fictioneer' ),
'version' => '1.0.0',
'version' => '1.0.1',
'update' => false,
'active' => false
)

View File

@ -2409,11 +2409,11 @@ function fictioneer_save_story_metaboxes( $post_id ) {
// Remember when chapters have been changed
if ( $previous_chapter_ids !== $chapter_ids ) {
update_post_meta( $post_id, 'fictioneer_chapters_modified', current_time( 'mysql' ) );
update_post_meta( $post_id, 'fictioneer_chapters_modified', current_time( 'mysql', true ) );
}
if ( count( $previous_chapter_ids ) < count( $chapter_ids ) ) {
update_post_meta( $post_id, 'fictioneer_chapters_added', current_time( 'mysql' ) );
update_post_meta( $post_id, 'fictioneer_chapters_added', current_time( 'mysql', true ) );
}
// Log changes

View File

@ -944,6 +944,7 @@ function fictioneer_shortcode_chapter_list( $attr ) {
$group = empty( $attr['group'] ) ? false : strtolower( trim( $attr['group'] ) );
$heading = empty( $attr['heading'] ) ? false : $attr['heading'];
$story_id = fictioneer_validate_id( $attr['story_id'] ?? -1, 'fcn_story' );
$prefer_chapter_icon = get_option( 'fictioneer_override_chapter_status_icons' );
$hide_icons = get_option( 'fictioneer_hide_chapter_icons' );
$can_checkmarks = get_option( 'fictioneer_enable_checkmarks' ) && ( is_user_logged_in() || get_option( 'fictioneer_enable_ajax_authentication' ) );
$classes = wp_strip_all_tags( $attr['class'] ?? '' );
@ -1087,9 +1088,9 @@ function fictioneer_shortcode_chapter_list( $attr ) {
<?php
if ( ! $hide_icons ) {
// Icon hierarchy: password > scheduled > text > normal
if ( $has_password ) {
if ( ! $prefer_chapter_icon && $has_password ) {
$icon = '<i class="fa-solid fa-lock chapter-group__list-item-icon"></i>';
} elseif ( get_post_status( $chapter_id ) === 'future' ) {
} elseif ( ! $prefer_chapter_icon && get_post_status( $chapter_id ) === 'future' ) {
$icon = '<i class="fa-solid fa-calendar-days chapter-group__list-item-icon"></i>';
} elseif ( $text_icon ) {
$icon = "<span class='chapter-group__list-item-icon _text text-icon'>{$text_icon}</span>";

View File

@ -153,6 +153,7 @@ function fictioneer_get_theme_info() {
'last_update_nag' => current_time( 'mysql', 1 ),
'last_update_notes' => '',
'last_version_download_url' => '',
'setup' => 0,
'version' => FICTIONEER_VERSION
);
@ -167,6 +168,7 @@ function fictioneer_get_theme_info() {
'last_update_nag' => '',
'last_update_notes' => '',
'last_version_download_url' => '',
'setup' => 0,
'version' => FICTIONEER_VERSION
),
$info
@ -847,21 +849,6 @@ if ( is_customize_preview() ) {
add_action( 'wp_enqueue_scripts', 'fictioneer_output_customize_preview_css', 9999 );
}
// =============================================================================
// ENQUEUE OVERRIDE STYLESHEETS
// =============================================================================
/**
* Enqueues an "override" stylesheet that supersedes all others
*
* @since 2.0.0
*/
function fictioneer_style_footer_queue() {
wp_enqueue_style( 'override', get_template_directory_uri() . '/css/override.css' );
}
add_action( 'get_footer', 'fictioneer_style_footer_queue' );
// =============================================================================
// FONT AWESOME
// =============================================================================
@ -1824,7 +1811,7 @@ function fictioneer_elementor_override_styles() {
// Setup
$kit_id = get_option( 'elementor_active_kit' );
$css = ".elementor-kit-{$kit_id} {
$css = "body.elementor-kit-{$kit_id} {
--e-global-color-primary: var(--primary-500);
--e-global-color-secondary: var(--fg-300);
--e-global-color-text: var(--fg-500);

View File

@ -1079,11 +1079,15 @@ if ( ! function_exists( 'fictioneer_get_content_field' ) ) {
$content = get_post_meta( $post_id ?? get_the_ID(), $field, true );
// Apply default filter functions from the_content (but nothing else)
$content = do_blocks( $content );
$content = wptexturize( $content );
$content = convert_chars( $content );
$content = wpautop( $content );
$content = shortcode_unautop( $content );
$content = prepend_attachment( $content );
$content = wp_replace_insecure_home_url( $content );
$content = wp_filter_content_tags( $content );
$content = convert_smilies( $content );
// Return formatted/filtered content
return $content;
@ -1277,8 +1281,8 @@ function fictioneer_append_chapter_to_story( $post_id, $story_id, $force = false
update_post_meta( $story_id, 'fictioneer_story_chapters', $story_chapters );
// Remember when chapter list has been last updated
update_post_meta( $story_id, 'fictioneer_chapters_modified', current_time( 'mysql' ) );
update_post_meta( $story_id, 'fictioneer_chapters_added', current_time( 'mysql' ) );
update_post_meta( $story_id, 'fictioneer_chapters_modified', current_time( 'mysql', true ) );
update_post_meta( $story_id, 'fictioneer_chapters_added', current_time( 'mysql', true ) );
// Log changes
fictioneer_log_story_chapter_changes( $story_id, $story_chapters, $previous_chapters );

View File

@ -568,13 +568,20 @@ if ( ! function_exists( 'fictioneer_theme_comment' ) ) {
<?php echo $open; ?>
<div class="fictioneer-comment__header">
<?php echo ( $avatar = get_avatar( $comment->user_id , $args['avatar_size'] ) ) && $args['avatar_size'] != 0 ? $avatar : ''; ?>
<?php
$id_or_email = $comment->user_id ?: $comment->comment_author_email;
$avatar = get_avatar( $id_or_email, $args['avatar_size'] );
if ( $avatar && $args['avatar_size'] != 0 ) {
echo $avatar;
}
?>
<div class="fictioneer-comment__meta">
<div class="fictioneer-comment__author truncate _1-1"><?php
if ( fictioneer_is_author( $comment->user_id ) ) {
?><a href="<?php echo get_author_posts_url( $comment->user_id ); ?>"><?php echo $comment->comment_author; ?></a><?php
echo '<a href="' . get_author_posts_url( $comment->user_id ) . '">' . $comment->comment_author . '</a>';
} else {
?><span><?php echo $comment_author; ?></span><?php
echo "<span>{$comment_author}</span>";
}
echo $badge;

View File

@ -360,6 +360,118 @@ function fictioneer_inner_header( $args ) {
}
add_action( 'fictioneer_site', 'fictioneer_inner_header', 20 );
// =============================================================================
// OUTPUT TEXT CENTER HEADER
// =============================================================================
/**
* Outputs the HTML for the text (center) header
*
* @since 5.21.0
*
* @param int|null $args['post_id'] Optional. Current post ID.
* @param int|null $args['story_id'] Optional. Current story ID (if chapter).
* @param string|boolean $args['header_image_url'] URL of the filtered header image or false.
* @param array $args['header_args'] Arguments passed to the header.php partial.
*/
function fictioneer_text_center_header( $args ) {
// Return early if...
if ( ( $args['header_args']['blank'] ?? 0 ) || ! display_header_text() ) {
return;
}
// Setup
$theme_mod = get_theme_mod( 'header_style', 'default' );
// Abort if...
if ( $theme_mod !== 'text_center' || ( $args['header_args']['no_header'] ?? 0 ) ) {
return;
}
// Render Elementor or theme template
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) {
// Start HTML ---> ?>
<header class="text-center-header hide-on-fullscreen"><?php
// Add header content as action
add_action(
'fictioneer_text_center_header',
function ( $args ) {
$title_tag = is_front_page() ? 'h1' : 'div';
$text_shadow = get_theme_mod( 'title_text_shadow', false ) ? '' : '_no-text-shadow';
printf(
"<div class='text-center-header__content {$text_shadow}'><{$title_tag} class='text-center-header__title'><a href='%s' class='text-center-header__link' rel='home'>%s</a></{$title_tag}>%s</div>",
esc_url( home_url() ),
get_bloginfo( 'name' ),
get_bloginfo( 'description' ) ?
'<div class="text-center-header__tagline">' . get_bloginfo( 'description' ) . '</div>' : ''
);
}
);
// Render everything via action
do_action( 'fictioneer_text_center_header', $args );
?></header>
<?php // <--- End HTML
}
}
add_action( 'fictioneer_site', 'fictioneer_text_center_header', 20 );
// =============================================================================
// OUTPUT POST CONTENT HEADER
// =============================================================================
/**
* Outputs the HTML for the post content header
*
* @since 5.21.0
*
* @param int|null $args['post_id'] Optional. Current post ID.
* @param int|null $args['story_id'] Optional. Current story ID (if chapter).
* @param string|boolean $args['header_image_url'] URL of the filtered header image or false.
* @param array $args['header_args'] Arguments passed to the header.php partial.
*/
function fictioneer_post_content_header( $args ) {
// Return early if...
if ( ( $args['header_args']['blank'] ?? 0 ) ) {
return;
}
// Setup
$post_id = get_theme_mod( 'header_post_content_id', 0 );
$theme_mod = get_theme_mod( 'header_style', 'default' );
// Abort if...
if ( $theme_mod !== 'post_content' || ! $post_id || ( $args['header_args']['no_header'] ?? 0 ) ) {
return;
}
// Get post
global $post;
$original_post = $post;
$post = get_post( $post_id );
if ( ! $post ) {
$post = $original_post;
return;
}
// Render Elementor or theme template
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) {
setup_postdata( $post );
$content = apply_filters( 'get_the_content', $post->post_content );
$content = apply_filters( 'the_content', $content );
wp_reset_postdata();
$post = $original_post;
echo '<header class="post-content-header content-section hide-on-fullscreen">' . $content . '</header>';
}
}
add_action( 'fictioneer_site', 'fictioneer_post_content_header', 20 );
// =============================================================================
// OUTPUT HEADER BACKGROUND
// =============================================================================

View File

@ -510,6 +510,7 @@ function fictioneer_story_chapters( $args ) {
// Setup
$story_id = $args['story_id'];
$story = $args['story_data'];
$prefer_chapter_icon = get_option( 'fictioneer_override_chapter_status_icons' );
$hide_icons = get_post_meta( $story_id, 'fictioneer_story_hide_chapter_icons', true ) ||
get_option( 'fictioneer_hide_chapter_icons' );
$enable_groups = get_option( 'fictioneer_enable_chapter_groups' ) &&
@ -655,9 +656,9 @@ function fictioneer_story_chapters( $args ) {
<?php
if ( ! $hide_icons ) {
// Icon hierarchy: password > scheduled > text > normal
if ( $chapter['password'] ) {
if ( ! $prefer_chapter_icon && $chapter['password'] ) {
$icon = '<i class="fa-solid fa-lock chapter-group__list-item-icon"></i>';
} elseif ( $chapter['status'] === 'future' ) {
} elseif ( ! $prefer_chapter_icon && $chapter['status'] === 'future' ) {
$icon = '<i class="fa-solid fa-calendar-days chapter-group__list-item-icon"></i>';
} elseif ( $chapter['text_icon'] ) {
$icon = "<span class='chapter-group__list-item-icon _text text-icon'>{$chapter['text_icon']}</span>";

View File

@ -212,7 +212,7 @@ define( 'FICTIONEER_OPTIONS', array(
),
'fictioneer_enable_patreon_badges' => array(
'name' => 'fictioneer_enable_patreon_badges',
'group' => 'fictioneer-settings-general-group',
'group' => 'fictioneer-settings-connections-group',
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
'default' => 0
),
@ -647,6 +647,12 @@ define( 'FICTIONEER_OPTIONS', array(
'group' => 'fictioneer-settings-general-group',
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
'default' => 0
),
'fictioneer_override_chapter_status_icons' => array(
'name' => 'fictioneer_override_chapter_status_icons',
'group' => 'fictioneer-settings-general-group',
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
'default' => 0
)
),
'integers' => array(
@ -785,7 +791,7 @@ define( 'FICTIONEER_OPTIONS', array(
),
'fictioneer_patreon_label' => array(
'name' => 'fictioneer_patreon_label',
'group' => 'fictioneer-settings-general-group',
'group' => 'fictioneer-settings-connections-group',
'sanitize_callback' => 'sanitize_text_field'
),
'fictioneer_comments_notice' => array(
@ -985,7 +991,7 @@ function fictioneer_get_option_label( $option ) {
'fictioneer_disable_comment_bbcodes' => __( 'Disable comment BBCodes', 'fictioneer' ),
'fictioneer_enable_ajax_comment_moderation' => __( 'Enable AJAX comment moderation', 'fictioneer' ),
'fictioneer_enable_custom_badges' => __( 'Enable custom badges', 'fictioneer' ),
'fictioneer_enable_patreon_badges' => __( 'Enable Patreon badges', 'fictioneer' ),
'fictioneer_enable_patreon_badges' => __( 'Enable Patreon comment badges', 'fictioneer' ),
'fictioneer_enable_private_commenting' => __( 'Enable private commenting', 'fictioneer' ),
'fictioneer_enable_comment_notifications' => __( 'Enable comment reply notifications', 'fictioneer' ),
'fictioneer_enable_comment_reporting' => __( 'Enable comment reporting', 'fictioneer' ),
@ -1105,7 +1111,8 @@ function fictioneer_get_option_label( $option ) {
'fictioneer_rewrite_chapter_permalinks' => __( 'Rewrite chapter permalinks to include story ', 'fictioneer' ),
'fictioneer_enable_xmlrpc' => __( 'Enable XML-RPC', 'fictioneer' ),
'fictioneer_disable_emojis' => __( 'Disable WordPress emojis', 'fictioneer' ),
'fictioneer_disable_default_formatting_indent' => __( 'Disable default indentation of chapter paragraphs', 'fictioneer' )
'fictioneer_disable_default_formatting_indent' => __( 'Disable default indentation of chapter paragraphs', 'fictioneer' ),
'fictioneer_override_chapter_status_icons' => __( 'Override chapter status icons', 'fictioneer' )
);
}

View File

@ -123,6 +123,15 @@ function fictioneer_add_admin_menu() {
'fictioneer_settings_logs'
);
$setup_hook = add_submenu_page(
'fictioneer',
__( 'Setup', 'fictioneer' ),
__( 'Setup', 'fictioneer' ),
'manage_options',
'fictioneer_setup',
'fictioneer_settings_setup'
);
add_action( 'admin_init', 'fictioneer_register_settings' );
// Add screen options
@ -371,6 +380,16 @@ function fictioneer_settings_logs() {
get_template_part( 'includes/functions/settings/_settings_page_logs' );
}
/**
* Callback for setup settings page
*
* @since 5.20.3
*/
function fictioneer_settings_setup() {
get_template_part( 'includes/functions/settings/_settings_page_setup' );
}
// =============================================================================
// SETTINGS CONTENT HELPERS
// =============================================================================
@ -554,3 +573,48 @@ function fictioneer_settings_page_assignment( $option, $label ) {
echo '<p class="fictioneer-sub-label">' . $label . '</p>';
}
/**
* Renders a label-wrapped setting toggle checkbox
*
* @since 5.21.0
*
* @param string $option The name of the setting option.
*/
function fictioneer_settings_toggle( $option ) {
// Start HTML ---> ?>
<label class="checkbox-toggle" for="<?php echo $option; ?>">
<input type="hidden" name="<?php echo $option; ?>" value="0">
<input type="checkbox" id="<?php echo $option; ?>" name="<?php echo $option; ?>" value="1" autocomplete="off" <?php echo checked( 1, get_option( $option ), false ); ?>>
</label>
<?php // <--- End HTML
}
/**
* Renders a card for the after-install setup
*
* @since 5.21.0
*
* @param string $option The name of the setting option.
* @param string $title The card title
* @param string $content The card content.
*/
function fictioneer_settings_setup_card( $option, $title, $content ) {
// Start HTML ---> ?>
<div class="fictioneer-card">
<div class="fictioneer-card__wrapper">
<div class="fictioneer-card__content">
<div class="fictioneer-card__row">
<p class="fictioneer-card__row-heading"><?php echo $title; ?></p>
<p><?php echo $content; ?></p>
</div>
<div class="fictioneer-card__row">
<?php fictioneer_settings_toggle( $option ); ?>
</div>
</div>
</div>
</div>
<?php // <--- End HTML
}

View File

@ -1600,8 +1600,8 @@ function fictioneer_tools_append_chapters() {
update_post_meta( $story_id, 'fictioneer_story_chapters', $story_chapters );
// Remember when chapter list has been last updated
update_post_meta( $story_id, 'fictioneer_chapters_modified', current_time( 'mysql' ) );
update_post_meta( $story_id, 'fictioneer_chapters_added', current_time( 'mysql' ) );
update_post_meta( $story_id, 'fictioneer_chapters_modified', current_time( 'mysql', true ) );
update_post_meta( $story_id, 'fictioneer_chapters_added', current_time( 'mysql', true ) );
// Clear meta caches to ensure they get refreshed
delete_post_meta( $story_id, 'fictioneer_story_data_collection' );
@ -1868,3 +1868,44 @@ function fictioneer_disable_mu_plugin() {
exit;
}
add_action( 'admin_post_fictioneer_disable_mu_plugin', 'fictioneer_disable_mu_plugin' );
// =============================================================================
// THEME SETUP ACTIONS
// =============================================================================
/**
* Saves the after-install setup form and redirects to settings page
*
* Note: Might be extended in the future to include more than general options.
*
* @since 5.21.0
*/
function fictioneer_after_install_setup() {
// Verify request
fictioneer_verify_admin_action( 'fictioneer_after_install_setup' );
// Setup
$booleans = array(
'fictioneer_dark_mode_as_default', 'fictioneer_show_authors', 'fictioneer_enable_chapter_groups',
'fictioneer_disable_default_formatting_indent', 'fictioneer_hide_large_card_chapter_list',
'fictioneer_count_characters_as_words', 'fictioneer_enable_lightbox', 'fictioneer_enable_bookmarks',
'fictioneer_enable_follows', 'fictioneer_enable_reminders', 'fictioneer_enable_checkmarks',
'fictioneer_enable_suggestions', 'fictioneer_do_not_save_comment_ip', 'fictioneer_consent_wrappers',
'fictioneer_cookie_banner', 'fictioneer_rewrite_chapter_permalinks'
);
// Update options
foreach ( $booleans as $option ) {
update_option(
$option,
filter_var( $_POST[ $option ] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'yes'
);
}
// Redirect to general theme settings
wp_safe_redirect( admin_url( 'admin.php?page=fictioneer' ) );
exit;
}
add_action( 'admin_post_fictioneer_after_install_setup', 'fictioneer_after_install_setup' );

View File

@ -207,7 +207,7 @@ function fictioneer_settings_checkbox_updated( $option, $old_value, $value ) {
if ( ! $purged ) {
$cache_purge_options = ['fictioneer_hide_chapter_icons', 'fictioneer_enable_chapter_groups',
'fictioneer_collapse_groups_by_default', 'fictioneer_disable_chapter_collapsing',
'fictioneer_count_characters_as_words'];
'fictioneer_count_characters_as_words', 'fictioneer_override_chapter_status_icons'];
if ( in_array( $option, $cache_purge_options ) ) {
fictioneer_purge_theme_caches();

View File

@ -189,6 +189,25 @@ $patreon_tiers = is_array( $patreon_tiers ) ? $patreon_tiers : [];
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_text_input(
'fictioneer_patreon_label',
__( 'Patreon comment badge label', 'fictioneer' ),
_x( 'Patron', 'Default Patreon supporter badge label.', 'fictioneer' )
);
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(
'fictioneer_enable_patreon_badges',
__( 'Enable Patreon comment badges', 'fictioneer' )
);
?>
</div>
<hr>
<div class="fictioneer-card__row">

View File

@ -207,12 +207,22 @@
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(
'fictioneer_override_chapter_status_icons',
__( 'Override chapter status icons', 'fictioneer' ),
__( 'Always renders the chapter icons instead of locks/etc.', 'fictioneer' )
);
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(
'fictioneer_enable_chapter_groups',
__( 'Enable chapter groups', 'fictioneer' ),
__( 'Display chapters in groups on story pages (if set).', 'fictioneer' )
__( 'Renders chapters in groups on story pages (if set).', 'fictioneer' )
);
?>
</div>
@ -252,7 +262,7 @@
fictioneer_settings_label_checkbox(
'fictioneer_enable_chapter_appending',
__( 'Append new chapters to story', 'fictioneer' ),
__( 'Only once when the chapter is first saved.', 'fictioneer' )
__( 'Whenever you change the chapter story and save.', 'fictioneer' )
);
?>
</div>
@ -289,7 +299,7 @@
<?php
fictioneer_settings_label_checkbox(
'fictioneer_hide_large_card_chapter_list',
__( 'Hide latest chapter list on large story cards', 'fictioneer' ),
__( 'Hide chapter list on large story cards', 'fictioneer' ),
__( 'Less informative but also less cluttered.', 'fictioneer' )
);
?>
@ -815,29 +825,6 @@
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(
'fictioneer_enable_patreon_badges',
__( 'Enable Patreon badges', 'fictioneer' ),
sprintf(
__( 'Show supporter badge for the <a href="%s">linked Patreon client</a>. This only works for the owner of the linked client. You cannot add campaigns for individual authors.', 'fictioneer' ),
'?page=fictioneer_connections'
)
);
?>
</div>
<div class="fictioneer-card__row fictioneer-card__row--checkbox-inset">
<?php
fictioneer_settings_text_input(
'fictioneer_patreon_label',
__( 'Patreon badge label', 'fictioneer' ),
_x( 'Patron', 'Default Patreon supporter badge label.', 'fictioneer' )
);
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(

View File

@ -0,0 +1,199 @@
<?php
/**
* Partial: Setup Settings
*
* @package WordPress
* @subpackage Fictioneer
* @since 5.20.3
*/
// Setup
?>
<div class="fictioneer-settings">
<div class="fictioneer-settings__content">
<form action="<?php echo esc_url( fictioneer_admin_action( 'fictioneer_after_install_setup' ) ); ?>" method="post" class="fictioneer-single-column fictioneer-single-column--setup">
<h1><?php _e( 'Fictioneer Setup', 'fictioneer' ); ?></h1>
<div><?php
printf(
'<p>Welcome and thank you for using Fictioneer!</p><p>Please make sure to read the <a href="%1$s" target="_blank" rel="noopener">installation guide</a> thoroughly. If any issues arise, refer to the <a href="%2$s" target="_blank" rel="noopener">documentation</a> and <a href="%3$s" target="_blank" rel="noopener">FAQ</a> first. If you are new to WordPress, consider looking up some guides, as this theme is not the most beginner-friendly. For further questions or commissions, feel free to join the <a href="%4$s" target="_blank" rel="noopener">Discord</a>.</p><p>The following steps will help you select some basic options for an easier start, but you can skip this screen if you want. You can find all these options and much more in the <a href="%5$s" target="_blank" rel="noopener">theme settings</a> and the <a href="%6$s" target="_blank" rel="noopener">Customizer</a>.</p>',
'https://github.com/Tetrakern/fictioneer/blob/main/INSTALLATION.md',
'https://github.com/Tetrakern/fictioneer/blob/main/DOCUMENTATION.md',
'https://github.com/Tetrakern/fictioneer/blob/main/FAQ.md',
'https://discord.gg/tVfDB7EbaP',
esc_url( admin_url( 'admin.php?page=fictioneer' ) ),
esc_url( admin_url( 'customize.php' ) )
);
?>
</div>
<?php
wp_nonce_field( 'fictioneer_after_install_setup', 'fictioneer_nonce', false );
fictioneer_settings_setup_card(
'fictioneer_dark_mode_as_default',
__( 'Enable dark mode by default?', 'fictioneer' ),
__( 'The theme is set to light mode by default, but you can switch to dark mode. Visitors can override the display mode with the sun/moon icon toggle on the frontend.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_show_authors',
__( 'Display authors on cards and posts?', 'fictioneer' ),
__( 'Fictioneer was primarily developed for single authors to publish their web serials, and therefore omits the author to save space. However, if you have multiple authors writing on your site, you can choose to display their names.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_chapter_groups',
__( 'Enable chapter groups?', 'fictioneer' ),
__( 'You can group chapters into separate sections, for example, to better compartmentalize story arcs. Groups are defined as verbatim strings set per chapter — they are case-sensitive and must match exactly. Groups will only show up if you have more than one, and any chapters without a group will be collected under "Unassigned".', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_disable_default_formatting_indent',
__( 'Disable default indentation of chapter paragraphs?', 'fictioneer' ),
__( 'Paragraphs in chapters have a first-line indentation by default to guide the reading eye. However, you may find this unaesthetic and prefer to disable it. Note that readers can still enable indentation through the chapter formatting modal.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_hide_large_card_chapter_list',
__( 'Hide chapter list on large story cards?', 'fictioneer' ),
__( 'Story cards pack a lot of information into a compact space to assist with browsing, providing everything at a glance. However, displaying the first (or latest if set) three chapters on the cards might make them appear too cluttered for your liking.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_count_characters_as_words',
__( 'Count characters instead of words?', 'fictioneer' ),
__( 'Counting words does not work well for logographic writing systems, so you may want to count characters instead. You can further refine this count by applying a multiplier in the theme settings.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_lightbox',
__( 'Enable theme lightbox for images?', 'fictioneer' ),
__( 'With this feature enabled, clicking on images in the page content will open a window overlay popup. This blocks some content and dims and disables the background to present the image more prominently.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_bookmarks',
__( 'Enable bookmarks for chapter paragraphs?', 'fictioneer' ),
__( 'With this feature enabled, readers can click on chapter paragraphs to set a bookmark, which is stored in the local browser. Logged-in users will also benefit from bookmark synchronization across browsers and devices, though an account is not necessary for basic functionality.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_follows',
__( 'Enable logged-in users to follow stories?', 'fictioneer' ),
__( 'With this feature enabled, logged-in users can "follow" a story to receive on-site update notifications and track the story in their bookshelf (if set up). This feature is more useful if you host many ongoing stories. Otherwise, you may want to save server resources by keeping it disabled.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_reminders',
__( 'Enable logged-in users to set reminders for stories?', 'fictioneer' ),
__( 'With this feature enabled, logged-in users can set reminders for stories to keep track of them for a later date in their bookshelf (if set up). This feature is more useful if you host many stories. Otherwise, you may want to save server resources by keeping it disabled.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_checkmarks',
__( 'Enable logged-in users to check-mark chapters/stories?', 'fictioneer' ),
__( 'With this feature enabled, logged-in users can mark chapters and stories as "read" and keep track of them in their bookshelf (if set up). This feature is more useful if you host many stories. Otherwise, you may want to save server resources by keeping it disabled.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_suggestions',
__( 'Enable suggestion tools for chapters?', 'fictioneer' ),
__( 'With this feature enabled, readers can leave color-coded suggestions for improvements in the comments. To do so, they can simply click on a paragraph or highlight some text, then click the button to open the suggestion modal, make changes, and append the result to the comment form.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_do_not_save_comment_ip',
__( 'Prevent saving of IP address for commenters?', 'fictioneer' ),
__( 'Saving IP addresses when visitors leave comments can conflict with GDPR and other data privacy laws, depending on how the IP addresses are used and associated with other data. Given the sensitivity of this topic, it is generally better to avoid saving IP addresses. They are not reliable anyway.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_consent_wrappers',
__( 'Add consent wrappers to third-party embeds?', 'fictioneer' ),
__( 'Embedding external content, such as YouTube videos, automatically loads scripts from the source, which can violate data privacy laws by including tracking, advertising, analytics, and more. Consent wrappers quarantine an embed until it is deliberately clicked, informing the visitor about the third-party consent requirements.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_cookie_banner',
__( 'Enable cookie banner?', 'fictioneer' ),
__( 'Cookie banners are often necessary to comply with data privacy laws and meet visitor expectations; it is better to be safe than sorry, even if the theme does not require one in its base configuration. Developers can also use the <code>fictioneer_get_consent()</code> function to comply with regulations.', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_rewrite_chapter_permalinks',
__( 'Rewrite chapter permalinks to include story?', 'fictioneer' ),
__( 'Stories and chapters are actually separate posts that are only associated, not hierarchically linked. Therefore, the permalink of a chapter does not include the story by default. Enabling this setting adds an alias to include the story in the permalink. However, chapter slugs must still be globally unique, with numbers appended in case of conflicts (e.g. <code>.../story/story-slug/chapter-slug-1</code> instead of <code>.../chapter/chapter-slug-1</code>).', 'fictioneer' )
);
fictioneer_settings_setup_card(
'fictioneer_enable_all_blocks',
__( 'Enable all Gutenberg blocks?', 'fictioneer' ),
__( 'Many blocks in the editor are disabled by default due to compatibility concerns. The theme is not built for full-site editing, and layout blocks — such as Row, Stack, and Group, along with widgets and content items — may lack styling or not work as expected.', 'fictioneer' )
);
?>
<div class="fictioneer-actions"><?php submit_button( __( 'Submit', 'fictioneer' ) ); ?></div>
<h2><?php _e( 'Tips', 'fictioneer' ); ?></h2>
<div class="fictioneer-card">
<div class="fictioneer-card__wrapper">
<div class="fictioneer-card__content">
<div class="fictioneer-card__row">
<p class="fictioneer-card__row-heading"><span class="dashicons dashicons-lightbulb"></span> <?php _e( 'Use a child theme for customization.', 'fictioneer' ); ?></p>
<p><?php
printf(
__( 'Child themes allow you to overwrite any part of the parent theme without actually modifying it. Otherwise, any changes you make would be removed once you update the theme. While creating a child theme is not difficult, it does require a bit of technical skill. You can start with the prepared <a href="%s" target="_blank" rel="noopener">base child theme</a>.', 'fictioneer' ),
'https://github.com/Tetrakern/fictioneer-child-theme'
);
?></p>
</div>
</div>
</div>
</div>
<div class="fictioneer-card">
<div class="fictioneer-card__wrapper">
<div class="fictioneer-card__content">
<div class="fictioneer-card__row">
<p class="fictioneer-card__row-heading"><span class="dashicons dashicons-lightbulb"></span> <?php _e( 'Use constants for additional customization.', 'fictioneer' ); ?></p>
<p><?php
printf(
__( 'Fictioneer offers even more options beyond what is accessible in the settings! However, tampering with some of these options can break the theme or cause unexpected behavior. This is why they are only defined as PHP constants. You can change them in a child theme as described in the <a href="%s" target="_blank" rel="noopener">installation guide</a>.', 'fictioneer' ),
'https://github.com/Tetrakern/fictioneer/blob/main/INSTALLATION.md#constants'
);
?></p>
</div>
</div>
</div>
</div>
<div class="fictioneer-card">
<div class="fictioneer-card__wrapper">
<div class="fictioneer-card__content">
<div class="fictioneer-card__row">
<p class="fictioneer-card__row-heading"><span class="dashicons dashicons-lightbulb"></span> <?php _e( 'Set up a static page with shortcodes as the home page.', 'fictioneer' ); ?></p>
<p><?php
printf(
__( 'By default, newly installed WordPress sites display the blog index as the "home" page. You can change this by going to <strong>Settings > Reading</strong> and selecting a static home and blog page instead, which you need to create first. If you want to replicate the demo site layout, the process is explained in the <a href="%s" target="_blank" rel="noopener">installation guide</a>.', 'fictioneer' ),
'https://github.com/Tetrakern/fictioneer/blob/main/INSTALLATION.md#demo-layout'
);
?></p>
</div>
</div>
</div>
</div>
</form>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
/**
* Plugin Name: Fictioneer Elementor Control
* Description: Disables Elementor on all pages except for the Canvas templates.
* Version: 1.0.0
* Version: 1.0.1
* Author: Tetrakern
* Author URI: https://github.com/Tetrakern
* License: GNU General Public License v3.0 or later
@ -49,6 +49,7 @@ function fictioneer_mu_002_get_post_id() {
* Add filter to remove Elementor if not on a Canvas page template
*
* @since 1.0.0
* @since 1.0.1 - Allow Elementor in Customizer.
*/
function fictioneer_elementor_control() {
@ -56,7 +57,8 @@ function fictioneer_elementor_control() {
if (
is_admin() ||
wp_doing_ajax() ||
strpos( $_SERVER['REQUEST_URI'], 'elementor' ) !== false
strpos( $_SERVER['REQUEST_URI'], 'elementor' ) !== false ||
strpos( $_SERVER['REQUEST_URI'], 'customize_changeset' ) !== false
) {
return;
}

View File

@ -22,7 +22,7 @@ defined( 'ABSPATH' ) OR exit;
$post_id = $post->ID;
$story = fictioneer_get_story_data( $post_id );
$story_link = ( $story['redirect'] ?? 0 ) ?: get_permalink( $post_id );
$latest = $args['show_latest'] ?? false;
$latest = $args['show_latest'] ?? FICTIONEER_SHOW_LATEST_CHAPTERS_ON_STORY_CARDS;
$chapter_ids = array_slice( $story['chapter_ids'], $latest ? -3 : 0, 3, true ); // Does not include hidden or non-chapters
$chapter_count = count( $chapter_ids );
$excerpt = fictioneer_first_paragraph_as_excerpt(

View File

@ -7,7 +7,7 @@ Contributors: tetrakern
Requires at least: 6.1.0
Tested up to: 6.5.5
Requires PHP: 7.4
Stable tag: 5.20.4
Stable tag: 5.21.0
License: GNU General Public License v3.0 or later
License URI: http://www.gnu.org/licenses/gpl.html

View File

@ -108,12 +108,12 @@ do_action( 'rss_tag_pre', 'rss2' );
?>
<?php if ( has_site_icon() ) : ?>
<webfeeds:icon><?php echo get_site_icon_url(); ?></webfeeds:icon>
<webfeeds:icon><?php echo esc_url( get_site_icon_url() ); ?></webfeeds:icon>
<?php endif; ?>
<?php if ( get_option( 'site_icon', false ) ) : ?>
<image>
<url><?php echo get_site_icon_url( 32 ); ?></url>
<url><?php echo esc_url( get_site_icon_url( 32 ) ); ?></url>
<title><?php echo $title; ?></title>
<link><?php bloginfo_rss( 'url' ); ?></link>
<width>32</width>

View File

@ -84,12 +84,12 @@ do_action( 'rss_tag_pre', 'rss2' );
<?php endif; ?>
<?php if ( has_site_icon() ) : ?>
<webfeeds:icon><?php echo get_site_icon_url(); ?></webfeeds:icon>
<webfeeds:icon><?php echo esc_url( get_site_icon_url() ); ?></webfeeds:icon>
<?php endif; ?>
<?php if ( get_option( 'site_icon', false ) ) : ?>
<image>
<url><?php echo get_site_icon_url( 32 ); ?></url>
<url><?php echo esc_url( get_site_icon_url( 32 ) ); ?></url>
<title><?php echo $title; ?></title>
<link><?php bloginfo_rss( 'url' ); ?></link>
<width>32</width>

View File

@ -77,7 +77,6 @@
&__letter {
display: grid;
place-content: center;
font-size: var(--fs-l);
font-size: get_clamp(16, 24, 375, 768);
font-weight: 900;
line-height: 1;

View File

@ -395,6 +395,26 @@ body[class*="fictioneer_page_"] {
@include bp(480px) {
gap: 32px;
}
&--setup {
max-width: 768px;
h1 {
font-size: 48px;
font-weight: 700;
}
h2 {
font-size: 28px;
}
.dashicons {
font-size: 1.25em;
vertical-align: text-bottom;
height: 1em;
width: auto;
}
}
}
// =============================================================================
@ -457,6 +477,11 @@ body[class*="fictioneer_page_"] {
margin-bottom: 12px;
}
&-heading {
font-weight: 700;
font-size: 15px;
}
&--inline-input {
&:not(:first-child) {
margin-top: 16px;
@ -710,6 +735,44 @@ body[class*="fictioneer_page_"] {
}
}
.checkbox-toggle {
display: inline-flex;
border-radius: 3px;
width: 46px;
input {
appearance: none;
display: block;
background: var(--input-background-color) !important;
padding: 2px !important;
height: 25px;
width: 100%;
&::before {
content: none !important;
}
&::after {
content: '';
display: block;
background: rgb(0 0 0 / 20%);
background: #fff;
border-radius: 2px;
height: 100%;
width: 50%;
box-shadow: 0 1px 4px 1px rgb(0 0 0 / 8%);
}
}
input:checked {
background: var(--input-checkbox-background-color-checked) !important;
&::after {
margin-left: 50%;
}
}
}
.fcn-help {
position: relative;
z-index: 1;

View File

@ -9,7 +9,7 @@
* Relative (em) font-size to allow scaling with custom formatting.
*/
article {
:where(article, .content-section) {
h1 {
font-size: get_relative_clamp(1.5, 2.25, 320, $full-width, 'vw', 'em');
}

View File

@ -0,0 +1,18 @@
.post-content-header {
flex: 1 1 100%;
width: 100%;
> :not(.alignfull) {
margin-left: auto;
margin-right: auto;
max-width: var(--site-width);
}
> * {
width: var(--site-width);
}
> .alignfull {
width: 100%;
}
}

View File

@ -0,0 +1,29 @@
.text-center-header {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: var(--header-height);
max-width: var(--site-width);
&__content {
text-align: center;
margin: 1rem 0 2rem; // Put a bit higher so it does not appear to "fall off"
&:not(._no-text-shadow) {
text-shadow: var(--site-title-text-shadow);
}
}
&__title {
color: var(--site-title-heading-color);
font: 900 var(--site-title-font-size)/1.3 var(--ff-site-title);
letter-spacing: 0;
}
&__tagline {
color: var(--site-title-tagline-color);
font: 500 var(--site-title-tagline-font-size)/1.3 var(--ff-site-title);
letter-spacing: 0;
}
}

View File

@ -120,6 +120,12 @@ body {
}
}
.wp-block-group-is-layout-flex {
.wp-block {
margin: 0;
}
}
// =============================================================================
// HEADINGS
// =============================================================================

View File

@ -1,2 +0,0 @@
@import 'common/_functions';
@import 'common/_mixins';

View File

@ -67,3 +67,13 @@ function wp_admin_notice( string $message, array $args = array() ) {}
*/
function elementor_theme_do_location( $location ) {}
/**
* Replaces insecure HTTP URLs to the site in the given content, if configured to do so.
*
* @param string $content Content to replace URLs in.
*
* @return string Filtered content.
*/
function wp_replace_insecure_home_url( $content ) {}

View File

@ -11,7 +11,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
Requires at least: 6.1.0
Tested up to: 6.5.5
Requires PHP: 7.4
Version: 5.20.4
Version: 5.21.0
Text Domain: fictioneer
Description: Standalone solution for publishing and reading web fictions.