Merge branch 'Tetrakern:main' into main

This commit is contained in:
ccesar 2024-09-22 16:18:45 +00:00 committed by GitHub
commit 5ac6733455
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
86 changed files with 1857 additions and 1261 deletions

View File

@ -177,8 +177,10 @@ Fires after `wp_body_open()` in the `<body>` right before the inline storage ele
**$args:**
* $post_id (int|null) Current post ID. Unsafe.
* $post_type (string|null) Current post type. Unsafe.
* $story_id (int|null) Current story ID (if chapter). Unsafe.
* $header_image_url (string|boolean) URL of the filtered header image or false.
* $header_image_source (string) Source of the header image. Either `default`, `post`, or `story`.
* $header_args (array) Arguments passed to the header.php partial.
**Hooked Actions:**
@ -1010,8 +1012,10 @@ Fires right after opening the `#site` container in the `header.php` template. In
**$args:**
* $post_id (int|null) Current post ID . Unsafe.
* $post_type (string|null) Current post type. Unsafe.
* $post_id (story_id|null) Current story ID (if chapter). Unsafe.
* $header_image_url (string|boolean) URL of the filtered header image or false.
* $header_image_source (string) Source of the header image. Either `default`, `post`, or `story`.
* $header_args (array) Arguments passed to the header.php partial.
**Hooked Actions:**

View File

@ -237,7 +237,7 @@ These are the protected meta fields used specifically for the **fcn_chapter** po
| fictioneer_chapter_foreword | string | Content of the chapter foreword.
| fictioneer_chapter_afterword | string | Content of the chapter afterword.
| fictioneer_chapter_password_note | string | Content of the note shown if the story is password protected.
| fictioneer_chapter_icon | string | Font Awesome icon class string.
| fictioneer_chapter_icon | string | Font Awesome icon class string. Empty if default icon.
| fictioneer_chapter_text_icon | string | Text string in place of an icon.
| fictioneer_chapter_short_title | string | Shorter variant title. Not used by default, intended for child themes.
| fictioneer_chapter_prefix | string | Prefix for titles in chapter lists.
@ -272,6 +272,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `admin_notices` | `fictioneer_admin_profile_notices`, `fictioneer_admin_settings_notices`, `fictioneer_admin_update_notice`
| `admin_post_*` | `fictioneer_delete_all_epubs`, `admin_post_purge_all_seo_schemas`, `fictioneer_tools_add_moderator_role`, `fictioneer_tools_move_story_tags_to_genres`, `fictioneer_tools_duplicate_story_tags_to_genres`, `fictioneer_tools_purge_story_data_caches`, `fictioneer_tools_move_chapter_tags_to_genres`, `fictioneer_tools_duplicate_chapter_tags_to_genres`, `fictioneer_tools_append_default_genres`, `fictioneer_tools_append_default_tags`, `fictioneer_tools_remove_unused_tags`, `fictioneer_tools_reset_post_relationship_registry`, `fictioneer_tools_fix_users`, `fictioneer_tools_fix_stories`, `fictioneer_tools_fix_chapters`, `fictioneer_tools_fix_collections`, `fictioneer_tools_fix_pages`, `fictioneer_tools_fix_posts`, `fictioneer_tools_fix_recommendations`, `fictioneer_admin_profile_unset_oauth`, `fictioneer_admin_profile_clear_data_node`, `fictioneer_update_frontend_profile`, `fictioneer_cancel_frontend_email_change`, `fictioneer_add_role`, `fictioneer_remove_role`, `fictioneer_rename_role`, `fictioneer_connection_get_patreon_tiers`, `fictioneer_connection_delete_patreon_tiers`
| `after_setup_theme` | `fictioneer_theme_setup`
| `bulk_edit_custom_box` | `fictioneer_add_patreon_bulk_edit_tiers`, `fictioneer_add_patreon_bulk_edit_amount`
| `comment_post` | `fictioneer_comment_post`, `fictioneer_post_comment_to_discord`
| `current_screen` | `fictioneer_restrict_admin_only_pages`, `fictioneer_restrict_comment_edit`
| `customize_controls_enqueue_scripts` | `fictioneer_enqueue_customizer_scripts`
@ -285,10 +286,11 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `edit_user_profile` | `fictioneer_custom_profile_fields`
| `edit_user_profile_update` | `fictioneer_update_admin_user_profile`, `fictioneer_update_my_user_profile`, `fictioneer_update_admin_unlocked_posts`
| `get_header` | `fictioneer_maintenance_mode`
| `init` | `fictioneer_add_character_taxonomy`, `fictioneer_add_content_warning_taxonomy`, `fictioneer_add_epub_download_endpoint`, `fictioneer_add_fandom_taxonomy`, `fictioneer_add_genre_taxonomy`, `fictioneer_add_logout_endpoint`, `fictioneer_add_oauth2_endpoint`, `fictioneer_restrict_admin_panel`, `fictioneer_disable_heartbeat`, `fictioneer_fcn_chapter_post_type`, `fictioneer_fcn_collection_post_type`, `fictioneer_fcn_recommendation_post_type`, `fictioneer_fcn_story_post_type`, `fictioneer_modify_allowed_tags`, `fictioneer_story_rss`, `fictioneer_remove_custom_fields_supports`, `fictioneer_add_sitemap_rewrite_rule`, `fictioneer_fast_ajax`, `fictioneer_add_chapter_rewrite_tags`, `fictioneer_add_chapter_rewrite_rules`, `fictioneer_rewrite_chapter_permalink`, `fictioneer_disable_emojis`
| `init` | `fictioneer_add_character_taxonomy`, `fictioneer_add_content_warning_taxonomy`, `fictioneer_add_epub_download_endpoint`, `fictioneer_add_fandom_taxonomy`, `fictioneer_add_genre_taxonomy`, `fictioneer_add_logout_endpoint`, `fictioneer_add_oauth2_endpoint`, `fictioneer_restrict_admin_panel`, `fictioneer_disable_heartbeat`, `fictioneer_fcn_chapter_post_type`, `fictioneer_fcn_collection_post_type`, `fictioneer_fcn_recommendation_post_type`, `fictioneer_fcn_story_post_type`, `fictioneer_modify_allowed_tags`, `fictioneer_story_rss`, `fictioneer_remove_custom_fields_supports`, `fictioneer_add_sitemap_rewrite_rule`, `fictioneer_fast_ajax`, `fictioneer_add_chapter_rewrite_tags`, `fictioneer_add_chapter_rewrite_rules`, `fictioneer_rewrite_chapter_permalink`, `fictioneer_disable_emojis`, `fictioneer_disable_page_optimize_plugin`
| `login_form` | `fictioneer_after_logout_cleanup`
| `login_head` | `fictioneer_wp_login_scripts`
| `manage_comments_custom_column` | `fictioneer_add_comments_report_column_content`
| `manage_{$type}_posts_custom_column` | `fictioneer_manage_posts_column_patreon`
| `personal_options_update` | `fictioneer_update_admin_user_profile`, `fictioneer_update_my_user_profile`, `fictioneer_update_admin_unlocked_posts`
| `pre_get_posts` | `fictioneer_extend_search_query`, `fictioneer_read_others_files`, `fictioneer_read_others_files_list_view`, `fictioneer_filter_chapters_by_story`
| `private_to_draft` | `fictioneer_chapter_to_draft`
@ -296,13 +298,13 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `publish_to_draft` | `fictioneer_chapter_to_draft`
| `rest_api_init` | `fictioneer_register_endpoint_get_story_comments`
| `restrict_manage_posts` | `fictioneer_add_chapter_story_filter_dropdown`
| `save_post` | `fictioneer_refresh_chapters_schema`, `fictioneer_refresh_chapter_schema`, `fictioneer_refresh_collections_schema`, `fictioneer_refresh_post_caches`, `fictioneer_refresh_post_schema`, `fictioneer_refresh_recommendations_schema`, `fictioneer_refresh_recommendation_schema`, `fictioneer_refresh_stories_schema`, `fictioneer_refresh_story_schema`, `fictioneer_save_seo_metabox`, `fictioneer_save_word_count`, `fictioneer_track_chapter_and_story_updates`, `fictioneer_update_modified_date_on_story_for_chapter`, `fictioneer_update_shortcode_relationships`, `fictioneer_purge_transients`, `fictioneer_save_story_metaboxes`, `fictioneer_save_chapter_metaboxes`, `fictioneer_save_advanced_metabox`, `fictioneer_save_support_links_metabox`, `fictioneer_save_collection_metaboxes`, `fictioneer_save_recommendation_metaboxes`, `fictioneer_save_post_metaboxes`, `fictioneer_delete_cached_story_card_after_update`, `fictioneer_rebuild_story_data_collection`
| `save_post` | `fictioneer_refresh_chapters_schema`, `fictioneer_refresh_chapter_schema`, `fictioneer_refresh_collections_schema`, `fictioneer_refresh_post_caches`, `fictioneer_refresh_post_schema`, `fictioneer_refresh_recommendations_schema`, `fictioneer_refresh_recommendation_schema`, `fictioneer_refresh_stories_schema`, `fictioneer_refresh_story_schema`, `fictioneer_save_seo_metabox`, `fictioneer_save_word_count`, `fictioneer_track_chapter_and_story_updates`, `fictioneer_update_modified_date_on_story_for_chapter`, `fictioneer_update_shortcode_relationships`, `fictioneer_purge_transients`, `fictioneer_save_story_metaboxes`, `fictioneer_save_chapter_metaboxes`, `fictioneer_save_advanced_metabox`, `fictioneer_save_support_links_metabox`, `fictioneer_save_collection_metaboxes`, `fictioneer_save_recommendation_metaboxes`, `fictioneer_save_post_metaboxes`, `fictioneer_delete_cached_story_card_after_update`, `fictioneer_rebuild_story_data_collection`, `fictioneer_post_chapter_to_discord`, `fictioneer_bulk_edit_save_patreon`, `fictioneer_bulk_edit_save_chapter_fields`
| `send_headers` | `fictioneer_block_pages_from_indexing`
| `show_user_profile` | `fictioneer_custom_profile_fields`
| `shutdown` | `fictioneer_save_story_card_cache`, `fictioneer_save_query_result_cache_registry`
| `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`, `fictioneer_chapter_future_to_publish`, `fictioneer_post_story_to_discord`, `fictioneer_post_chapter_to_discord`
| `transition_post_status` | `fictioneer_log_story_chapter_status_changes`, `fictioneer_chapter_future_to_publish`, `fictioneer_post_story_to_discord`
| `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`
@ -313,7 +315,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `wp_default_scripts` | `fictioneer_remove_jquery_migrate`
| `wp_enqueue_scripts` | `fictioneer_add_custom_scripts`, `fictioneer_customizer_queue`, `fictioneer_style_queue`
| `wp_footer` | `fictioneer_render_taxonomy_submenu`
| `wp_head` | `fictioneer_output_head_seo`, `fictioneer_output_rss`, `fictioneer_output_schemas`, `fictioneer_add_fiction_css`, `fictioneer_output_head_fonts`, `fictioneer_output_head_translations`, `fictioneer_remove_mu_registration_styles`, `fictioneer_output_mu_registration_style`, `fictioneer_output_head_meta`, `fictioneer_output_head_critical_scripts`. `fictioneer_output_head_anti_flicker`
| `wp_head` | `fictioneer_output_head_seo`, `fictioneer_output_rss`, `fictioneer_output_schemas`, `fictioneer_add_fiction_css`, `fictioneer_output_head_fonts`, `fictioneer_output_head_translations`, `fictioneer_remove_mu_registration_styles`, `fictioneer_output_mu_registration_style`, `fictioneer_output_head_meta`, `fictioneer_output_head_critical_scripts`. `fictioneer_output_head_anti_flicker`, `fictioneer_cleanup_discord_meta`
| `wp_insert_comment` | `fictioneer_delete_cached_story_card_by_comment`, `fictioneer_increment_story_comment_count`
| `wp_update_nav_menu` | `fictioneer_purge_nav_menu_transients`
@ -347,6 +349,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `kses_allowed_protocols` | `fictioneer_extend_allowed_protocols`
| `logout_url` | `fictioneer_logout_redirect`
| `manage_edit-comments_columns` | `fictioneer_add_comments_report_column`
| `manage_{$type}_posts_columns` | `fictioneer_add_posts_columns_patreon`
| `manage_pages_columns` | `fictioneer_remove_comments_column`
| `manage_posts_columns` | `fictioneer_remove_comments_column`
| `manage_users_columns` | `fictioneer_hide_users_columns`
@ -356,7 +359,6 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `post_password_required` | `fictioneer_bypass_password`, `fictioneer_expire_post_password`
| `post_stuck` | `fictioneer_prevent_post_sticky`
| `postbox_classes_{$screen_id}_{$box_id}` | `fictioneer_append_metabox_classes`
| `posts_where` | `fictioneer_exclude_protected_posts`
| `pre_comment_user_ip` | `__return_empty_string`
| `pre_get_posts` | `fictioneer_extend_taxonomy_pages`, `fictioneer_edit_others_fictioneer_posts`, `fictioneer_add_sof_to_taxonomy_query`
| `pre_insert_term` | `fictioneer_restrict_tag_creation`
@ -366,6 +368,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `removable_query_args` | `fictioneer_removable_args`
| `render_block` | `fictioneer_download_block_wrapper`
| `rest_authentication_errors` | `fictioneer_restrict_rest_api`
| `script_loader_tag` | `fictioneer_data_jetpack_boost_tag`
| `show_admin_bar` | `__return_false`
| `strip_shortcodes_tagnames` | `fictioneer_exempt_shortcodes_from_removal`
| `style_loader_tag` | `fictioneer_add_font_awesome_integrity`

View File

@ -821,6 +821,7 @@ Renders a multi-column grid of paginated medium cards ordered by publishing date
* **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **ignore_sticky:** Whether sticky posts should be ignored or not. Default `false`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author:** Only show recommendations by a specific author. Make sure to use the url-safe nice_name.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
@ -873,6 +874,7 @@ Renders paginated blog posts akin to the main blog page, but with options. Only
* **per_page:** Number of posts per page. Defaults to theme settings.
* **ignore_sticky:** Whether sticky posts should be ignored or not. Default `false`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author:** Only show posts of a specific author. Make sure to use the url-safe nice_name.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
@ -997,6 +999,7 @@ Renders a multi-column grid of small cards, showing the latest four chapters ord
* **source:** Whether to show the author and story nodes. Default `true`.
* **post_ids:** Comma-separated list of chapter post IDs, if you want to pick from a curated pool.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1062,6 +1065,7 @@ Renders the last blog post or a list of blog posts, ignoring sticky posts, order
* **author:** Only show posts of a specific author. Make sure to use the url-safe nice_name.
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1097,6 +1101,7 @@ Renders a multi-column grid of small cards, showing the latest four recommendati
* **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1149,6 +1154,7 @@ Renders a multi-column grid of small cards, showing the latest four stories orde
* **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **post_ids:** Comma-separated list of story post IDs, if you want to pick from a curated pool.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1225,6 +1231,7 @@ Renders a multi-column grid of small cards, showing the latest four updated stor
* **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`.
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1337,6 +1344,7 @@ Renders dynamic grid of thumbnails with title, showing the latest eight posts of
* **orderby:** The default is `date`, but you can also use `rand` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.

View File

@ -1681,6 +1681,16 @@ Filters the built HTML of the taxonomy submenu before it is rendered.
---
### `apply_filters( 'fictioneer_filter_cached_taxonomy_submenu_html', $html, $type, $hide_empty )`
Filters the Transient HTML of the taxonomy submenu before it is rendered. The difference to the non-cached filter is that the terms are not queried in this case.
**Parameters:**
* $html (string) The current submenu HTML to be rendered.
* $type (string) The taxonomy type.
* $hide_empty (boolean) Whether to hide empty terms. Default `true`.
---
### `apply_filters( 'fictioneer_filter_taxonomy_submenu_note', $note, $taxonomy )`
Filters the string of the note rendered above the links in the taxonomy submenu. By default, that is "Choose a {taxonomy} to browse", with the dynamic part taken from the singular name of the taxonomy object.

View File

@ -1567,6 +1567,7 @@ define( 'CONSTANT_NAME', value );
| FICTIONEER_DISCORD_EMBED_COLOR | string | Color code for Discord notifications. Default `'9692513'`.
| FICTIONEER_TRUNCATION_ELLIPSIS | string | Appended to truncated strings. Default `…`.
| FICTIONEER_AGE_CONFIRMATION_REDIRECT | string | Redirect URL if a visitor reject the age confirmation. Default `https://search.brave.com/`.
| FICTIONEER_DEFAULT_SITE_WIDTH | integer | Default site width. Default `960`.
| FICTIONEER_COMMENTCODE_TTL | integer | How long guests can see their private/unapproved comments in _seconds_. Default `600`.
| FICTIONEER_AJAX_TTL | integer | How long to cache certain AJAX requests locally in _milliseconds_. Default `60000`.
| FICTIONEER_AJAX_LOGIN_TTL | integer | How long to cache AJAX authentications locally in _milliseconds_. Default `15000`.

View File

@ -108,12 +108,6 @@ function fictioneer_migrate_chapters( $query_args = [], $story_args = [], $previ
update_post_meta( $post->ID, 'fictioneer_chapter_story', $story_id );
}
// Set default chapter icon
update_post_meta( $post->ID, 'fictioneer_chapter_icon', 'fa-solid fa-book' );
// Update other meta
update_post_meta( $post->ID, 'fictioneer_first_publish_date', $post->post_date_gmt );
// Change post type to fcn_chapter (also triggers hooked actions and updates story)
wp_update_post(
array(

View File

@ -7,7 +7,7 @@
"uuidString" : "8FBBED4B-FAF6-4EE5-AC20-B162062715B3"
}
],
"creatorBuild" : "34576",
"creatorBuild" : "34590",
"files" : {
"\/.gitattributes" : {
"cB" : 0,
@ -1797,13 +1797,13 @@
"sC" : 3,
"tS" : 0
},
"\/js\/Sortable-1.15.2.min.js" : {
"\/js\/sortable.min.js" : {
"bF" : 0,
"ft" : 64,
"ma" : 0,
"mi" : 1,
"oA" : 1,
"oAP" : "\/js\/Sortable-1.15.2.min.min.js",
"oAP" : "\/js\/sortable.min.min.js",
"oF" : 1,
"sC" : 3,
"tS" : 0
@ -4647,10 +4647,6 @@
"active" : 0,
"optionString" : "{'before': true, 'after': true, 'overrides': {}}"
},
"line-comment-position" : {
"active" : 0,
"optionString" : "{'position': 'above'}"
},
"linebreak-style" : {
"active" : 0,
"optionString" : "'unix'"
@ -4703,10 +4699,6 @@
"active" : 0,
"optionString" : "{'max': 1}"
},
"multiline-comment-style" : {
"active" : 0,
"optionString" : "'starred-block'"
},
"multiline-ternary" : {
"active" : 0,
"optionString" : "'always'"
@ -4848,7 +4840,8 @@
"active" : 0
},
"no-extra-boolean-cast" : {
"active" : 1
"active" : 1,
"optionString" : "{'enforceForInnerExpressions': false}"
},
"no-extra-label" : {
"active" : 0
@ -4933,7 +4926,8 @@
"optionString" : "{'ignore': [], 'ignoreArrayIndexes': true, 'ignoreDefaultValues': false, 'ignoreClassFieldInitialValues': false, 'enforceConst': false, 'detectObjects': false}"
},
"no-misleading-character-class" : {
"active" : 1
"active" : 1,
"optionString" : "{'allowEscape': false}"
},
"no-mixed-operators" : {
"active" : 0,
@ -5301,7 +5295,8 @@
"active" : 0
},
"require-unicode-regexp" : {
"active" : 0
"active" : 0,
"optionString" : "{'requireFlag': 'u'}"
},
"require-yield" : {
"active" : 1
@ -5731,6 +5726,7 @@
"tsImportHelpers" : 0,
"tsIsolatedModules" : 0,
"tsJSXFactory" : "React.createElement",
"tsJSXFragmentFactory" : "Fragment",
"tsNoEmitHelpers" : 0,
"tsNoFallthroughCasesInSwitch" : 0,
"tsNoImplicitAny" : 0,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
:root:not(.minimal) .card{--card-style-border-width: 2px;--this-rotation: calc(2deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-s: calc(1.75deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-xs: calc(1.5deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-xxs: calc(1.25deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));box-shadow:0 0 0 var(--card-frame-border-thickness, 2.5px) var(--card-frame-border-color)}:root:not(.minimal) .card::before{pointer-events:none;content:"";position:absolute;top:50%;left:50%;z-index:-1;display:block;background:var(--card-frame-border-color);border-radius:var(--card-frame-border-radius, var(--layout-border-radius-small));height:var(--card-frame-height, calc(100% + 6px));width:var(--card-frame-width, calc(100% + 6px));transform-origin:center;transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation)))}@container (min-width: 450px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-s)))}}@container (min-width: 600px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xs)))}}@container (min-width: 750px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xxs)))}}:root:not(.minimal) .card .card__body{border-radius:var(--card-frame-border-radius, var(--layout-border-radius-small))}
:root:not(.minimal) .card{--card-style-border-width: 2px;--this-rotation: calc(2deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-s: calc(1.75deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-xs: calc(1.5deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-xxs: calc(1.25deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-xxxs: calc(1deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));--this-rotation-xxxxs: calc(0.75deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));box-shadow:0 0 0 var(--card-frame-border-thickness, 2.5px) var(--card-frame-border-color)}:root:not(.minimal) .card::before{pointer-events:none;content:"";position:absolute;top:50%;left:50%;z-index:-1;display:block;background:var(--card-frame-border-color);border-radius:var(--card-frame-border-radius, var(--layout-border-radius-small));height:var(--card-frame-height, calc(100% + 6px));width:var(--card-frame-width, calc(100% + 6px));transform-origin:center;transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation)))}@container (min-width: 450px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-s)))}}@container (min-width: 600px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xs)))}}@container (min-width: 750px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xxs)))}}@container (min-width: 900px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xxxs)))}}@container (min-width: 1050px){:root:not(.minimal) .card::before{transform:translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xxxxs)))}}:root:not(.minimal) .card .card__body{border-radius:var(--card-frame-border-radius, var(--layout-border-radius-small))}

View File

@ -1 +1 @@
.top-header{background:var(--top-header-background);width:100%;contain:style layout}.top-header__content{display:flex;align-items:center;justify-content:center;gap:1rem;padding:1rem 1rem .5rem;margin:0 auto;max-width:var(--site-width)}@media only screen and (min-width: 1024px){.top-header__content{justify-content:flex-start;padding-bottom:.25rem}}.top-header__logo{flex:0 0 auto}.top-header .custom-logo{display:block;height:var(--header-logo-height);max-height:calc(var(--site-title-font-size) + var(--site-title-tagline-font-size) + 1rem);width:auto;object-fit:contain}.top-header._no-tagline .custom-logo{max-height:calc(var(--site-title-font-size) + .75rem)}.top-header._no-title .custom-logo{max-height:unset}.top-header:not(._no-text-shadow) .top-header__title{text-shadow:var(--site-title-text-shadow)}.top-header__title{flex:0 1 auto}.top-header__heading{font:700 var(--site-title-font-size)/1.3 var(--ff-site-title);letter-spacing:0}.top-header__heading a{color:var(--site-title-heading-color)}.top-header__tagline{color:var(--site-title-tagline-color);font:400 var(--site-title-tagline-font-size)/1.3 var(--ff-site-title);letter-spacing:0}.top-header._no-logo{text-align:center}@media only screen and (min-width: 1024px){.top-header._no-logo{text-align:left}}
.top-header{background:var(--top-header-background);width:100%;contain:style layout}.top-header__content{display:flex;align-items:center;justify-content:center;gap:1rem;padding:1rem 1rem .5rem;margin:0 auto;max-width:var(--site-width)}@media only screen and (min-width: 1024px){.top-header__content{justify-content:flex-start;padding-bottom:.25rem}}.top-header__logo{flex:0 0 auto}.top-header .custom-logo{display:block;height:var(--header-logo-height);max-height:calc(var(--site-title-font-size) + var(--site-title-tagline-font-size) + 1rem);width:auto;max-width:100%;object-fit:contain}.top-header._no-tagline .custom-logo{max-height:calc(var(--site-title-font-size) + .75rem)}.top-header._no-title .custom-logo{max-height:unset}.top-header:not(._no-text-shadow) .top-header__title{text-shadow:var(--site-title-text-shadow)}.top-header__title{flex:0 1 auto}.top-header__heading{font:700 var(--site-title-font-size)/1.3 var(--ff-site-title);letter-spacing:0}.top-header__heading a{color:var(--site-title-heading-color)}.top-header__tagline{color:var(--site-title-tagline-color);font:400 var(--site-title-tagline-font-size)/1.3 var(--ff-site-title);letter-spacing:0}.top-header._no-logo{text-align:center}@media only screen and (min-width: 1024px){.top-header._no-logo{text-align:left}}

View File

@ -1 +1 @@
.main-navigation{margin:0 auto}.main-navigation__wrapper{--v: var(--header-wide-vertical-padding, 20px);align-items:center;justify-content:space-between;padding:var(--v) 4px var(--v) clamp(10px,18.1818181818vw - 48.1818181818px,20px);width:100%;max-width:max(var(--site-width),1440px)}@media only screen and (min-width: 1024px){.main-navigation__wrapper{padding:var(--v) 40px}}.wide-header-logo{margin-right:1.5rem}.wide-header-logo .custom-logo{display:block;height:var(--header-logo-height);max-height:var(--header-logo-height);width:fit-content;object-fit:contain}.wide-header-identity{flex:0 1 auto;letter-spacing:0;margin-right:1.5rem}.wide-header-identity:not(._no-text-shadow){text-shadow:var(--site-title-text-shadow)}.wide-header-identity__title{color:var(--site-title-heading-color);font:900 var(--site-title-font-size)/1 var(--ff-site-title);letter-spacing:0}.wide-header-identity__tagline{color:var(--site-title-tagline-color);font:500 var(--site-title-tagline-font-size)/1.3 var(--ff-site-title);letter-spacing:0;margin-top:.5em}@media only screen and (min-width: 1024px){.wide-header-identity__tagline{white-space:nowrap}}
.main-navigation{margin:0 auto}.main-navigation__wrapper{--v: var(--header-wide-vertical-padding, 20px);align-items:center;justify-content:space-between;padding:var(--v) 4px var(--v) clamp(10px,18.1818181818vw - 48.1818181818px,20px);width:100%;max-width:max(var(--site-width),1440px)}@media only screen and (min-width: 1024px){.main-navigation__wrapper{padding:var(--v) 40px}}.wide-header-logo{margin-right:1.5rem}.wide-header-logo .custom-logo{display:block;height:var(--header-logo-height);max-height:var(--header-logo-height);width:fit-content;max-width:100%;object-fit:contain}.wide-header-identity{flex:0 1 auto;letter-spacing:0;margin-right:1.5rem}.wide-header-identity:not(._no-text-shadow){text-shadow:var(--site-title-text-shadow)}.wide-header-identity__title{color:var(--site-title-heading-color);font:900 var(--site-title-font-size)/1 var(--ff-site-title);letter-spacing:0}.wide-header-identity__tagline{color:var(--site-title-tagline-color);font:500 var(--site-title-tagline-font-size)/1.3 var(--ff-site-title);letter-spacing:0;margin-top:.5em}@media only screen and (min-width: 1024px){.wide-header-identity__tagline{white-space:nowrap}}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.post-list{display:flex;flex-direction:column;gap:var(--post-list-gap, var(--content-list-gap, 4px));container-type:inline-size}.post-list-item{position:relative;display:grid;grid-template-columns:auto 1fr;grid-template-areas:"img ts" "img title" "img meta" "img bs";background:var(--post-list-li-background, var(--content-li-background));line-height:1.3;padding:.5rem 8px .5rem 0;border-radius:var(--layout-border-radius-small)}.post-list-item:is(._latest-updates,._latest-stories):not(._no-tax){grid-template-areas:"img ts" "img title" "img meta" "img tax" "img bs"}.post-list-item._no-footer{grid-template-areas:"img ts" "img title" "img bs"}.post-list-item._no-footer:is(._latest-updates,._latest-stories):not(._no-tax){grid-template-areas:"img ts" "img title" "img tax" "img bs"}.post-list-item._seamless{grid-template-rows:.5rem auto auto .5rem;padding:0 8px 0 0}.post-list-item._seamless .post-list-item__image{height:100%;width:3rem}.post-list-item._seamless .post-list-item__image img{--layout-nested-border-radius-multiplier: 1;height:100%}.post-list-item._seamless:is(._latest-updates,._latest-stories):not(._no-tax){grid-template-rows:.5rem auto auto auto .5rem}.post-list-item._seamless._full .post-list-item__image img{border-top-right-radius:0;border-bottom-right-radius:0}.post-list-item._no-footer-date .post-list-item__title{padding-right:0}.post-list-item._no-thumbnail{padding-left:2px}.post-list-item._full:not(._seamless){padding-left:8px}.post-list-item._full._seamless._no-thumbnail{padding-left:10px}.post-list-item._lines:not(:last-child){border-bottom:var(--content-li-hr-border);padding-bottom:calc(.5rem + var(--post-list-gap, var(--content-list-gap, 4px)))}.post-list-item._lines:not(:last-child)._seamless{padding-bottom:var(--post-list-gap, var(--content-list-gap, 4px))}.post-list-item__image{grid-area:img;align-self:center;margin-right:.75rem;width:2.5rem}.post-list-item__image[data-lightbox]{cursor:zoom-in}.post-list-item__image img{aspect-ratio:var(--post-item-image-aspect-ratio, 2/2.5);display:block;border-radius:calc(var(--layout-border-radius-small)*var(--layout-nested-border-radius-multiplier, 1));height:auto;width:100%;object-fit:cover}.post-list-item__title{grid-area:title;color:var(--post-list-title-color, var(--heading-link-color));font-family:var(--ff-post-list-title, var(--ff-heading));font-weight:var(--font-weight-medium);font-size:get_clamp(13, 14, 320, 768);font-size:var(--post-list-title-font-size, clamp(13px, 4.1cqw, 14px));margin-right:128px;width:fit-content}.post-list-item__title .protected-icon{font-size:.8em;margin-right:.125em;opacity:.9;transform:translateY(-0.125em)}@container (max-width: 639px){.post-list-item__title{margin-right:0}}.post-list-item__meta,.post-list-item__tax{grid-area:meta;color:var(--post-list-meta-color, var(--fg-600));font-family:var(--ff-post-list-meta, var(--ff-note));font-size:var(--post-list-meta-font-size, 13px);font-size:var(--post-list-meta-font-size, clamp(12px, 3.5cqw, 13px));line-height:1.5;margin-top:4px}.post-list-item__meta a:hover,.post-list-item__tax a:hover{--layout-link-color-hover: var(--post-list-meta-link-color-hover, var(--fg-200))}.post-list-item__meta .chapter-link-icon{color:var(--fg-800);line-height:inherit;margin-right:.25em}.post-list-item__meta-chapter,.post-list-item__meta-in-story{display:block;margin-bottom:3px}@container (min-width: 550px){.post-list-item__meta-chapter,.post-list-item__meta-in-story{display:inline}}.post-list-item__tax{grid-area:tax;margin-top:6px}.post-list-item__tax._pills{display:flex;gap:6px;flex-wrap:wrap}.post-list-item__tax .tag-pill._inline{font-size:inherit}.post-list-item :where(._floating-right){position:absolute;top:.5rem;right:8px;opacity:.5}.post-list-item :where(._floating-right)::before{display:none}@container (max-width: 639px){.post-list-item :where(._floating-right){position:static;opacity:1}.post-list-item :where(._floating-right)::before{display:inline}}
.post-list{display:flex;flex-direction:column;gap:var(--post-list-gap, var(--content-list-gap, 4px));container-type:inline-size}.post-list-item{position:relative;display:grid;grid-template-columns:auto 1fr;grid-template-areas:"img ts" "img title" "img meta" "img bs";background:var(--post-list-li-background, var(--content-li-background));line-height:1.3;padding:.5rem 8px .5rem 0;border-radius:var(--layout-border-radius-small)}.post-list-item:is(._latest-updates,._latest-stories):not(._no-tax){grid-template-areas:"img ts" "img title" "img meta" "img tax" "img bs"}.post-list-item._no-footer{grid-template-areas:"img ts" "img title" "img bs"}.post-list-item._no-footer:is(._latest-updates,._latest-stories):not(._no-tax){grid-template-areas:"img ts" "img title" "img tax" "img bs"}.post-list-item._seamless{grid-template-rows:minmax(0.5rem, 1fr) auto auto minmax(0.5rem, 1fr);padding:0 8px 0 0}.post-list-item._seamless .post-list-item__image{height:100%;width:3rem}.post-list-item._seamless .post-list-item__image img{--layout-nested-border-radius-multiplier: 1;height:100%}.post-list-item._seamless:is(._latest-updates,._latest-stories):not(._no-tax){grid-template-rows:minmax(0.5rem, 1fr) auto auto auto minmax(0.5rem, 1fr)}.post-list-item._seamless._full .post-list-item__image img{border-top-right-radius:0;border-bottom-right-radius:0}.post-list-item._no-footer-date .post-list-item__title{padding-right:0}.post-list-item._no-thumbnail{padding-left:2px}.post-list-item._full:not(._seamless){padding-left:8px}.post-list-item._full._seamless._no-thumbnail{padding-left:10px}.post-list-item._lines:not(:last-child){border-bottom:var(--content-li-hr-border);padding-bottom:calc(.5rem + var(--post-list-gap, var(--content-list-gap, 4px)))}.post-list-item._lines:not(:last-child)._seamless{padding-bottom:var(--post-list-gap, var(--content-list-gap, 4px))}.post-list-item__image{grid-area:img;align-self:center;margin-right:.75rem;width:2.5rem}.post-list-item__image[data-lightbox]{cursor:zoom-in}.post-list-item__image img{aspect-ratio:var(--post-item-image-aspect-ratio, 2/2.5);display:block;border-radius:calc(var(--layout-border-radius-small)*var(--layout-nested-border-radius-multiplier, 1));height:auto;width:100%;object-fit:cover}.post-list-item__title{grid-area:title;color:var(--post-list-title-color, var(--heading-link-color));font-family:var(--ff-post-list-title, var(--ff-heading));font-weight:var(--font-weight-medium);font-size:get_clamp(13, 14, 320, 768);font-size:var(--post-list-title-font-size, clamp(13px, 4.1cqw, 14px));margin-right:128px;width:fit-content}.post-list-item__title .protected-icon{font-size:.8em;margin-right:.125em;opacity:.9;transform:translateY(-0.125em)}@container (max-width: 639px){.post-list-item__title{margin-right:0}}.post-list-item__meta,.post-list-item__tax{grid-area:meta;color:var(--post-list-meta-color, var(--fg-600));font-family:var(--ff-post-list-meta, var(--ff-note));font-size:var(--post-list-meta-font-size, 13px);font-size:var(--post-list-meta-font-size, clamp(12px, 3.5cqw, 13px));line-height:1.5;margin-top:4px}.post-list-item__meta a:hover,.post-list-item__tax a:hover{--layout-link-color-hover: var(--post-list-meta-link-color-hover, var(--fg-200))}.post-list-item__meta .chapter-link-icon{color:var(--fg-800);line-height:inherit;margin-right:.25em}.post-list-item__meta-chapter,.post-list-item__meta-in-story{display:block;margin-bottom:3px}@container (min-width: 550px){.post-list-item__meta-chapter,.post-list-item__meta-in-story{display:inline}}.post-list-item__tax{grid-area:tax;margin-top:6px}.post-list-item__tax._pills{display:flex;gap:6px;flex-wrap:wrap}.post-list-item__tax .tag-pill._inline{font-size:inherit}.post-list-item :where(._floating-right){position:absolute;top:.5rem;right:8px;opacity:.5}.post-list-item :where(._floating-right)::before{display:none}@container (max-width: 639px){.post-list-item :where(._floating-right){position:static;opacity:1}.post-list-item :where(._floating-right)::before{display:inline}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,9 +5,9 @@
// =============================================================================
// Version
define( 'FICTIONEER_VERSION', '5.24.0' );
define( 'FICTIONEER_VERSION', '5.24.1' );
define( 'FICTIONEER_MAJOR_VERSION', '5' );
define( 'FICTIONEER_RELEASE_TAG', 'v5.24.0' );
define( 'FICTIONEER_RELEASE_TAG', 'v5.24.1' );
if ( ! defined( 'CHILD_VERSION' ) ) {
define( 'CHILD_VERSION', null );
@ -206,6 +206,11 @@ if ( ! defined( 'FICTIONEER_STORY_FOOTER_B480_DATE' ) ) {
* Integers
*/
// Integer: Default site width
if ( ! defined( 'FICTIONEER_DEFAULT_SITE_WIDTH' ) ) {
define( 'FICTIONEER_DEFAULT_SITE_WIDTH', 960 );
}
// Integer: Commentcode expiration timer in seconds (-1 for infinite)
if ( ! defined( 'FICTIONEER_COMMENTCODE_TTL' ) ) {
define( 'FICTIONEER_COMMENTCODE_TTL', 600 );
@ -410,7 +415,7 @@ if ( ! defined( 'FICTIONEER_ENABLE_STORY_DATA_META_CACHE' ) ) {
// Boolean: Enable nav menu Transients
if ( ! defined( 'FICTIONEER_ENABLE_MENU_TRANSIENTS' ) ) {
define( 'FICTIONEER_ENABLE_MENU_TRANSIENTS', true );
define( 'FICTIONEER_ENABLE_MENU_TRANSIENTS', ! get_option( 'fictioneer_disable_menu_transients', false ) );
}
// Boolean: Order stories by last updated chapter timestamp

View File

@ -57,12 +57,14 @@ if ( ( $args['no_index'] ?? 0 ) || FICTIONEER_MU_REGISTRATION ) {
<?php
// Setup
$story_id = null;
$post_type = $post_id ? $post->post_type : null;
$header_image_source = 'default';
$header_image_url = get_header_image();
// If this is a content page...
if ( ! empty( $post_id ) ) {
if ( $post_id ) {
// Type?
switch ( $post->post_type ) {
switch ( $post_type ) {
case 'fcn_story':
$story_id = $post_id;
break;
@ -75,9 +77,11 @@ if ( ( $args['no_index'] ?? 0 ) || FICTIONEER_MU_REGISTRATION ) {
if ( get_post_meta( $post_id, 'fictioneer_custom_header_image', true ) ) {
$header_image_url = get_post_meta( $post_id, 'fictioneer_custom_header_image', true );
$header_image_url = wp_get_attachment_image_url( $header_image_url, 'full' );
$header_image_source = 'post';
} elseif ( ! empty( $story_id ) && get_post_meta( $story_id, 'fictioneer_custom_header_image', true ) ) {
$header_image_url = get_post_meta( $story_id, 'fictioneer_custom_header_image', true );
$header_image_url = wp_get_attachment_image_url( $header_image_url, 'full' );
$header_image_source = 'story';
}
}
@ -89,8 +93,10 @@ if ( ( $args['no_index'] ?? 0 ) || FICTIONEER_MU_REGISTRATION ) {
// Action arguments
$action_args = array(
'post_id' => $post_id,
'post_type' => $post_type,
'story_id' => $story_id,
'header_image_url' => $header_image_url,
'header_image_source' => $header_image_source,
'header_args' => $args ?? []
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -466,7 +466,6 @@ function fictioneer_get_font_data() {
function fictioneer_build_bundled_fonts() {
// Setup
$base_fonts = WP_CONTENT_DIR . '/themes/fictioneer/css/fonts-base.css';
$bundled_fonts = fictioneer_get_theme_cache_dir( 'build_bundled_fonts' ) . '/bundled-fonts.css';
$fonts = fictioneer_get_font_data();
$disabled_fonts = get_option( 'fictioneer_disabled_fonts', [] );
$disabled_fonts = is_array( $disabled_fonts ) ? $disabled_fonts : [];
@ -515,7 +514,10 @@ function fictioneer_build_bundled_fonts() {
update_option( 'fictioneer_bundled_fonts_timestamp', time(), true );
// Save
file_put_contents( $bundled_fonts, $combined_font_css );
file_put_contents(
fictioneer_get_theme_cache_dir( 'build_bundled_fonts' ) . '/bundled-fonts.css',
$combined_font_css
);
}
// =============================================================================
@ -617,7 +619,7 @@ function fictioneer_build_customize_css( $context = null ) {
// --- Setup -----------------------------------------------------------------
$file_path = fictioneer_get_theme_cache_dir( 'build_customize_css' ) . '/customize.css';
$site_width = (int) get_theme_mod( 'site_width', 960 );
$site_width = (int) get_theme_mod( 'site_width', FICTIONEER_DEFAULT_SITE_WIDTH );
$header_image_style = get_theme_mod( 'header_image_style', 'default' );
$header_style = get_theme_mod( 'header_style', 'default' );
$content_list_style = get_theme_mod( 'content_list_style', 'default' );
@ -703,7 +705,7 @@ function fictioneer_build_customize_css( $context = null ) {
$lightness_offset_light = (int) get_theme_mod( 'lightness_offset_light', 0 );
$font_saturation_offset_light = (int) get_theme_mod( 'font_saturation_offset_light', 0 );
$font_lightness_offset_light = (int) get_theme_mod( 'font_lightness_offset_light', 0 );
$site_width = (int) get_theme_mod( 'site_width', 960 );
$site_width = (int) get_theme_mod( 'site_width', FICTIONEER_DEFAULT_SITE_WIDTH );
$main_offset = (int) get_theme_mod( 'main_offset', 0 );
$sidebar_width = (int) get_theme_mod( 'sidebar_width', 256 );
$sidebar_gap = (int) get_theme_mod( 'sidebar_gap', 48 );

View File

@ -158,8 +158,6 @@ function fictioneer_generate_test_content() {
fictioneer_generate_test_comments( $chapter_id, $comment_count );
update_post_meta( $chapter_id, 'fictioneer_chapter_story', $story_id );
update_post_meta( $chapter_id, 'fictioneer_chapter_icon', 'fa-solid fa-book' );
update_post_meta( $chapter_id, 'fictioneer_first_publish_date', current_time( 'mysql', true ) );
}
}

View File

@ -245,28 +245,6 @@ if ( ! function_exists( 'fictioneer_append_date_query' ) ) {
}
}
// =============================================================================
// IGNORE PROTECTED POSTS FILTER
// =============================================================================
/**
* Filter to ignore protected posts
*
* Note: Filter is not added by default, only in certain places.
*
* @since 5.7.3
*
* @param string $where WHERE statement. Default empty string.
*
* @return string The updated WHERE statement.
*/
function fictioneer_exclude_protected_posts( $where = '' ) {
$where .= " AND post_password = ''";
return $where;
}
// =============================================================================
// STICKY STORIES
// =============================================================================

View File

@ -14,7 +14,8 @@ if ( ! function_exists( 'fictioneer_discord_send_message' ) ) {
* @param string $webhook The webhook for the Discord channel.
* @param array $message The message to be sent.
*
* @param array|WP_Error The response or WP_Error on failure.
* @return array|WP_Error|null Null if not in debug mode, otherwise
* the response or WP_Error on failure.
*/
function fictioneer_discord_send_message( $webhook, $message ) {
@ -30,7 +31,8 @@ if ( ! function_exists( 'fictioneer_discord_send_message' ) ) {
),
'body' => json_encode( $message, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ),
'method' => 'POST',
'data_format' => 'body'
'data_format' => 'body',
'blocking' => ! WP_DEBUG
)
);
}
@ -54,7 +56,7 @@ if ( ! function_exists( 'fictioneer_discord_send_message' ) ) {
function fictioneer_post_comment_to_discord( $comment_id, $comment_approved ) {
// Setup
$comment = get_comment( $comment_id );
$comment_type = ucfirst( get_comment_type( $comment_id ) );
$comment_type = get_comment_type( $comment_id );
$comment_status = wp_get_comment_status( $comment );
$comment_avatar_url = get_avatar_url( $comment );
$post = get_post( $comment->comment_post_ID );
@ -76,7 +78,7 @@ function fictioneer_post_comment_to_discord( $comment_id, $comment_approved ) {
'fields' => array(
array(
'name' => _x( 'Status', 'Discord message "Status" field.', 'fictioneer' ),
'value' => ucfirst( $comment_status ),
'value' => fcntr( "{$comment_status}_comment_status" ),
'inline' => true
),
array(
@ -87,7 +89,7 @@ function fictioneer_post_comment_to_discord( $comment_id, $comment_approved ) {
),
'author' => array(
'name' => $comment->comment_author,
'icon_url' => $comment_avatar_url
'icon_url' => $comment_avatar_url ?: ''
),
'timestamp' => date_format( date_create( $comment->comment_date ), 'c' )
)
@ -155,7 +157,7 @@ function fictioneer_post_comment_to_discord( $comment_id, $comment_approved ) {
// Comment type
$message['embeds'][0]['fields'][] = array(
'name' => _x( 'Type', 'Discord message comment "Type" field.', 'fictioneer' ),
'value' => $comment_type,
'value' => fcntr( "{$comment_type}_comment" ),
'inline' => true
);
@ -171,6 +173,9 @@ function fictioneer_post_comment_to_discord( $comment_id, $comment_approved ) {
// Send to Discord
fictioneer_discord_send_message( $webhook, $message );
// Unhook if done to avoid additional triggers (if any)
remove_action( 'comment_post', 'fictioneer_post_comment_to_discord', 99 );
}
if ( get_option( 'fictioneer_discord_channel_comments_webhook' ) ) {
@ -198,8 +203,8 @@ function fictioneer_post_story_to_discord( $new_status, $old_status, $post ) {
return;
}
// Already triggered once?
if ( get_post_meta( $post->ID, 'fictioneer_discord_post_trigger', true ) ) {
// Already triggered (this field will eventually be deleted in favor of the time check)?
if ( get_post_meta( $post->ID, 'fictioneer_discord_post_trigger' ) ) {
return;
}
@ -249,8 +254,11 @@ function fictioneer_post_story_to_discord( $new_status, $old_status, $post ) {
// Send to Discord
fictioneer_discord_send_message( $webhook, $message );
// Set trigger true
// Remember trigger
update_post_meta( $post->ID, 'fictioneer_discord_post_trigger', true );
// Unhook if done to avoid additional triggers (if any)
remove_action( 'transition_post_status', 'fictioneer_post_story_to_discord', 99 );
}
if ( get_option( 'fictioneer_discord_channel_stories_webhook' ) ) {
@ -266,20 +274,34 @@ if ( get_option( 'fictioneer_discord_channel_stories_webhook' ) ) {
*
* @since 5.6.0
* @since 5.21.2 - Refactored.
* @since 5.24.1 - Switch back to save_post hook to ensure the story ID is set.
*
* @param string $new_status New post status.
* @param string $new_status Old post status.
* @param int $post_id Post ID.
* @param WP_Post $post Post object.
* @param bool $update Whether this is an existing post being updated.
*/
function fictioneer_post_chapter_to_discord( $new_status, $old_status, $post ) {
// Only if chapter going from non-publish status to publish
if ( $post->post_type !== 'fcn_chapter' || $new_status !== 'publish' || $old_status === 'publish' ) {
function fictioneer_post_chapter_to_discord( $post_id, $post, $update ) {
// Prevent multi-fire
if ( fictioneer_multi_save_guard( $post_id ) ) {
return;
}
// Already triggered once?
if ( get_post_meta( $post->ID, 'fictioneer_discord_post_trigger', true ) ) {
// Only if published chapter
if ( $post->post_type !== 'fcn_chapter' || $post->post_status !== 'publish' ) {
return;
}
// Only if published less than 10 minutes ago
$post_timestamp = get_post_time( 'U', true, $post_id );
$current_timestamp = current_time( 'U', true );
if ( $update && ( $current_timestamp - $post_timestamp ) >= 600 ) {
return;
}
// Already triggered (this field will eventually be deleted in favor of the time check)?
if ( get_post_meta( $post_id, 'fictioneer_discord_post_trigger' ) ) {
return;
}
@ -346,12 +368,15 @@ function fictioneer_post_chapter_to_discord( $new_status, $old_status, $post ) {
// Send to Discord
fictioneer_discord_send_message( $webhook, $message );
// Set trigger true
update_post_meta( $post->ID, 'fictioneer_discord_post_trigger', true );
// Remember trigger
update_post_meta( $post_id, 'fictioneer_discord_post_trigger', true );
// Unhook if done to avoid additional triggers (if any)
remove_action( 'save_post', 'fictioneer_post_chapter_to_discord', 99 );
}
if ( get_option( 'fictioneer_discord_channel_chapters_webhook' ) ) {
add_action( 'transition_post_status', 'fictioneer_post_chapter_to_discord', 99, 3 );
add_action( 'save_post', 'fictioneer_post_chapter_to_discord', 99, 3 );
}
// =============================================================================

View File

@ -115,38 +115,6 @@ if ( get_option( 'fictioneer_count_characters_as_words' ) ) {
add_action( 'save_post', 'fictioneer_characters_as_word_count' );
}
// =============================================================================
// STORE ORIGINAL PUBLISH DATE
// =============================================================================
/**
* Stores the original publish date of a post in post meta
*
* @since 5.6.0
*
* @param int $post_id The ID of the post being saved.
* @param WP_Post $post The post object being saved.
*/
function fictioneer_store_original_publish_date( $post_id, $post ) {
// Prevent miss-fire
if (
fictioneer_multi_save_guard( $post_id ) ||
$post->post_status !== 'publish'
) {
return;
}
// Get first publish date (if set)
$first_publish_date = get_post_meta( $post_id, 'fictioneer_first_publish_date', true );
// Set if missing
if ( empty( $first_publish_date ) || strtotime( $first_publish_date ) === false ) {
update_post_meta( $post_id, 'fictioneer_first_publish_date', current_time( 'mysql', true ) );
}
}
add_action( 'save_post', 'fictioneer_store_original_publish_date', 10, 2 );
// =============================================================================
// STORY CHANGELOG
// =============================================================================

View File

@ -87,7 +87,7 @@ function fictioneer_admin_scripts( $hook_suffix ) {
if ( $hook_suffix === 'post.php' || $hook_suffix === 'post-new.php' ) {
wp_enqueue_script(
'fictioneer-sortablejs',
get_template_directory_uri() . '/js/Sortable-1.15.2.min.js',
get_template_directory_uri() . '/js/sortable.min.js',
['jquery', 'fictioneer-utility-scripts'],
FICTIONEER_VERSION,
true
@ -1118,6 +1118,21 @@ function fictioneer_look_for_issues() {
);
}
// Orphaned post meta
$orphaned_post_meta_count = $wpdb->get_var("
SELECT COUNT(*)
FROM $wpdb->postmeta pm
LEFT JOIN $wpdb->posts p ON pm.post_id = p.ID
WHERE p.ID IS NULL
");
if ( $orphaned_post_meta_count > 500 ) {
$issues[] = sprintf(
__( 'You currently have <strong>%s orphaned post meta fields stored</strong> in your database. This is obsolete data that can slow down your site. Optimize your database under <strong>Fictioneer > Tools</strong> or use a plugin to clean them up.', 'fictioneer' ),
$orphaned_post_meta_count
);
}
// Results
return $issues;
}

View File

@ -13,6 +13,50 @@ if ( ! defined( 'FICTIONEER_EXAMPLE_CHAPTER_ICONS' ) ) {
);
}
// =============================================================================
// VALIDATORS
// =============================================================================
/**
* Validates save action
*
* @since 5.24.1
*
* @param int $post_id ID of the updated post.
* @param string $post_type Type of the updated post.
*
* @return bool True if valid, false if not.
*/
function fictioneer_validate_save_action_user( $post_id, $post_type ) {
// Capability substring
$substring = $post_type === 'fcn_story' ? 'fcn_stories' : "{$post_type}s";
// Check post permission
if ( ! current_user_can( "edit_{$substring}", $post_id ) ) {
return false;
}
// Check post ownership
if (
absint( get_post_field( 'post_author', $post_id ) ) !== get_current_user_id() &&
! current_user_can( "edit_others_{$substring}" )
) {
return false;
}
// Check post status
if (
get_post_status( $post_id ) === 'publish' &&
! current_user_can( "edit_published_{$substring}", $post_id )
) {
return false;
}
// Valid
return true;
}
// =============================================================================
// SANITIZERS
// =============================================================================
@ -729,6 +773,7 @@ function fictioneer_get_metabox_tokens( $post, $meta_key, $options, $args = [] )
function fictioneer_get_metabox_icons( $post, $meta_key, $args = [] ) {
// Setup
$meta_value = esc_attr( get_post_meta( $post->ID, $meta_key, true ) );
$meta_value = $meta_value ? $meta_value : FICTIONEER_DEFAULT_CHAPTER_ICON;
$label = strval( $args['label'] ?? '' );
$description = strval( $args['description'] ?? '' );
$placeholder = strval( $args['placeholder'] ?? '' );
@ -2254,16 +2299,8 @@ function fictioneer_save_story_metaboxes( $post_id ) {
if (
! wp_verify_nonce( ( $_POST['fictioneer_story_nonce'] ?? '' ), "story_meta_data_{$post_id}" ) ||
fictioneer_multi_save_guard( $post_id ) ||
get_post_type( $post_id ) !== 'fcn_story'
) {
return;
}
// --- Permissions? ----------------------------------------------------------
if (
! current_user_can( 'edit_fcn_stories', $post_id ) ||
( get_post_status( $post_id ) === 'publish' && ! current_user_can( 'edit_published_fcn_stories', $post_id ) )
get_post_type( $post_id ) !== 'fcn_story' ||
! fictioneer_validate_save_action_user( $post_id, 'fcn_story' )
) {
return;
}
@ -2578,7 +2615,7 @@ function fictioneer_render_chapter_meta_metabox( $post ) {
);
}
if ( get_option( 'fictioneer_enable_advanced_meta_fields' ) ) {
if ( get_option( 'fictioneer_enable_advanced_meta_fields' ) && ! get_option( 'fictioneer_hide_chapter_icons' ) ) {
$output['fictioneer_chapter_text_icon'] = fictioneer_get_metabox_text(
$post,
'fictioneer_chapter_text_icon',
@ -2910,16 +2947,8 @@ function fictioneer_save_chapter_metaboxes( $post_id ) {
if (
! wp_verify_nonce( ( $_POST['fictioneer_chapter_nonce'] ?? '' ), "chapter_meta_data_{$post_id}" ) ||
fictioneer_multi_save_guard( $post_id ) ||
get_post_type( $post_id ) !== 'fcn_chapter'
) {
return;
}
// --- Permissions? ----------------------------------------------------------
if (
! current_user_can( 'edit_fcn_chapters', $post_id ) ||
( get_post_status( $post_id ) === 'publish' && ! current_user_can( 'edit_published_fcn_chapters', $post_id ) )
get_post_type( $post_id ) !== 'fcn_chapter' ||
! fictioneer_validate_save_action_user( $post_id, 'fcn_chapter' )
) {
return;
}
@ -2973,18 +3002,26 @@ function fictioneer_save_chapter_metaboxes( $post_id ) {
// Valid?
if ( ! $icon_object && ( empty( $icon ) || strpos( $icon, 'fa-' ) !== 0 ) ) {
$icon = FICTIONEER_DEFAULT_CHAPTER_ICON;
$icon = '';
}
if ( $icon_object && ( ! property_exists( $icon_object, 'style' ) || ! property_exists( $icon_object, 'id' ) ) ) {
$icon = FICTIONEER_DEFAULT_CHAPTER_ICON;
$icon = '';
}
if ( $icon === FICTIONEER_DEFAULT_CHAPTER_ICON ) {
$icon = ''; // Do not save default icon
}
$fields['fictioneer_chapter_icon'] = $icon;
}
// Text icon
if ( isset( $_POST['fictioneer_chapter_text_icon'] ) && get_option( 'fictioneer_enable_advanced_meta_fields' ) ) {
if (
isset( $_POST['fictioneer_chapter_text_icon'] ) &&
get_option( 'fictioneer_enable_advanced_meta_fields' ) &&
! get_option( 'fictioneer_hide_chapter_icons' )
) {
$text_icon = sanitize_text_field( $_POST['fictioneer_chapter_text_icon'] );
$fields['fictioneer_chapter_text_icon'] = mb_substr( $text_icon, 0, 10, 'UTF-8' ); // Icon codes, etc.
}
@ -3023,7 +3060,7 @@ function fictioneer_save_chapter_metaboxes( $post_id ) {
// Story
if ( isset( $_POST['fictioneer_chapter_story'] ) ) {
$story_id = absint( $_POST['fictioneer_chapter_story'] );
$story_id = fictioneer_validate_id( $_POST['fictioneer_chapter_story'], 'fcn_story' );
$current_story_id = absint( get_post_meta( $post_id, 'fictioneer_chapter_story', true ) );
if ( $current_story_id && $story_id !== $current_story_id ) {
@ -3051,7 +3088,7 @@ function fictioneer_save_chapter_metaboxes( $post_id ) {
}
}
$fields['fictioneer_chapter_story'] = strval( $story_id );
$fields['fictioneer_chapter_story'] = strval( $story_id ?: 0 );
}
// Card/List title
@ -3379,25 +3416,8 @@ function fictioneer_save_extra_metabox( $post_id ) {
if (
! wp_verify_nonce( ( $_POST['fictioneer_advanced_meta_nonce'] ?? '' ), "advanced_meta_{$post_id}" ) ||
fictioneer_multi_save_guard( $post_id ) ||
! in_array( $post_type, ['post', 'page', 'fcn_story', 'fcn_chapter', 'fcn_recommendation', 'fcn_collection'] )
) {
return;
}
// --- Permissions? ------------------------------------------------------------
$permission_list = array(
'post' => ['edit_posts', 'edit_published_posts'],
'page' => ['edit_pages', 'edit_published_pages'],
'fcn_story' => ['edit_fcn_stories', 'edit_published_fcn_stories'],
'fcn_chapter' => ['edit_fcn_chapters', 'edit_published_fcn_chapters'],
'fcn_collection' => ['edit_fcn_collections', 'edit_published_fcn_collections'],
'fcn_recommendation' => ['edit_fcn_recommendations', 'edit_published_fcn_recommendations']
);
if (
! current_user_can( $permission_list[ $post_type ][0], $post_id ) ||
( get_post_status( $post_id ) === 'publish' && ! current_user_can( $permission_list[ $post_type ][1], $post_id ) )
! in_array( $post_type, ['post', 'page', 'fcn_story', 'fcn_chapter', 'fcn_recommendation', 'fcn_collection'] ) ||
! fictioneer_validate_save_action_user( $post_id, $post_type )
) {
return;
}
@ -3678,22 +3698,8 @@ function fictioneer_save_support_links_metabox( $post_id ) {
if (
! wp_verify_nonce( ( $_POST['fictioneer_support_links_nonce'] ?? '' ), "support_links_{$post_id}" ) ||
fictioneer_multi_save_guard( $post_id ) ||
! in_array( $post_type, ['post', 'fcn_story', 'fcn_chapter'] )
) {
return;
}
// --- Permissions? ------------------------------------------------------------
$permission_list = array(
'post' => ['edit_posts', 'edit_published_posts'],
'fcn_story' => ['edit_fcn_stories', 'edit_published_fcn_stories'],
'fcn_chapter' => ['edit_fcn_chapters', 'edit_published_fcn_chapters']
);
if (
! current_user_can( $permission_list[ $post_type ][0], $post_id ) ||
( get_post_status( $post_id ) === 'publish' && ! current_user_can( $permission_list[ $post_type ][1], $post_id ) )
! in_array( $post_type, ['post', 'fcn_story', 'fcn_chapter'] ) ||
! fictioneer_validate_save_action_user( $post_id, $post_type )
) {
return;
}
@ -3838,16 +3844,8 @@ function fictioneer_save_post_metaboxes( $post_id ) {
if (
! wp_verify_nonce( ( $_POST['fictioneer_post_nonce'] ?? '' ), "post_data_{$post_id}" ) ||
fictioneer_multi_save_guard( $post_id ) ||
get_post_type( $post_id ) !== 'post'
) {
return;
}
// --- Permissions? ------------------------------------------------------------
if (
! current_user_can( 'edit_posts', $post_id ) ||
( get_post_status( $post_id ) === 'publish' && ! current_user_can( 'edit_published_posts', $post_id ) )
get_post_type( $post_id ) !== 'post' ||
! fictioneer_validate_save_action_user( $post_id, 'post' )
) {
return;
}
@ -4073,16 +4071,8 @@ function fictioneer_save_collection_metaboxes( $post_id ) {
if (
! wp_verify_nonce( ( $_POST['fictioneer_collection_nonce'] ?? '' ), "collection_data_{$post_id}" ) ||
fictioneer_multi_save_guard( $post_id ) ||
get_post_type( $post_id ) !== 'fcn_collection'
) {
return;
}
// --- Permissions? ------------------------------------------------------------
if (
! current_user_can( 'edit_fcn_collections', $post_id ) ||
( get_post_status( $post_id ) === 'publish' && ! current_user_can( 'edit_published_fcn_collections', $post_id ) )
get_post_type( $post_id ) !== 'fcn_collection' ||
! fictioneer_validate_save_action_user( $post_id, 'fcn_collection' )
) {
return;
}
@ -4282,16 +4272,8 @@ function fictioneer_save_recommendation_metaboxes( $post_id ) {
if (
! wp_verify_nonce( ( $_POST['fictioneer_recommendation_nonce'] ?? '' ), "recommendation_data_{$post_id}" ) ||
fictioneer_multi_save_guard( $post_id ) ||
get_post_type( $post_id ) !== 'fcn_recommendation'
) {
return;
}
// --- Permissions? ------------------------------------------------------------
if (
! current_user_can( 'edit_fcn_recommendations', $post_id ) ||
( get_post_status( $post_id ) === 'publish' && ! current_user_can( 'edit_published_fcn_recommendations', $post_id ) )
get_post_type( $post_id ) !== 'fcn_recommendation' ||
! fictioneer_validate_save_action_user( $post_id, 'fcn_recommendation' )
) {
return;
}
@ -4355,7 +4337,7 @@ function fictioneer_save_recommendation_metaboxes( $post_id ) {
add_action( 'save_post', 'fictioneer_save_recommendation_metaboxes' );
// =============================================================================
// ADD META FIELDS TO BULK EDIT
// PATREON LIST VIEW AND BULK EDIT
// =============================================================================
/**
@ -4394,7 +4376,7 @@ add_filter( 'default_hidden_columns', 'fictioneer_default_hide_patreon_posts_col
* @return array Updated associative array of column headings.
*/
function fictioneer_add_patreon_posts_columns( $post_columns ) {
function fictioneer_add_posts_columns_patreon( $post_columns ) {
$post_columns[ 'fictioneer_patreon_lock_tiers' ] =
_x( 'Patreon Tiers', 'Patreon tiers list table column title.', 'fictioneer' );
@ -4413,7 +4395,7 @@ function fictioneer_add_patreon_posts_columns( $post_columns ) {
* @param int $post_id The current post ID.
*/
function fictioneer_manage_posts_custom_column( $column_name, $post_id ) {
function fictioneer_manage_posts_column_patreon( $column_name, $post_id ) {
// Setup
$post = get_post( $post_id );
$class = $post->post_password ? 'has-password' : 'no-password';
@ -4565,7 +4547,7 @@ function fictioneer_add_patreon_bulk_edit_amount( $column_name, $post_type ) {
* @param int $post_id ID of the updated post.
*/
function fictioneer_save_patreon_bulk_edit( $post_id ) {
function fictioneer_bulk_edit_save_patreon( $post_id ) {
// Abort if...
if (
! wp_verify_nonce( $_REQUEST['_wpnonce'] ?? 0, 'bulk-posts' ) ||
@ -4614,12 +4596,153 @@ if (
( current_user_can( 'manage_options' ) || current_user_can( 'fcn_assign_patreon_tiers' ) )
) {
foreach ( ['post', 'page', 'fcn_story', 'fcn_chapter', 'fcn_collection', 'fcn_recommendation'] as $type ) {
add_filter( "manage_{$type}_posts_columns", 'fictioneer_add_patreon_posts_columns' );
add_action( "manage_{$type}_posts_custom_column", 'fictioneer_manage_posts_custom_column', 10, 2 );
add_filter( "manage_{$type}_posts_columns", 'fictioneer_add_posts_columns_patreon' );
add_action( "manage_{$type}_posts_custom_column", 'fictioneer_manage_posts_column_patreon', 10, 2 );
}
add_action( 'bulk_edit_custom_box', 'fictioneer_add_patreon_bulk_edit_tiers', 10, 2 );
add_action( 'bulk_edit_custom_box', 'fictioneer_add_patreon_bulk_edit_amount', 10, 2 );
add_action( 'save_post', 'fictioneer_save_patreon_bulk_edit' );
add_action( 'save_post', 'fictioneer_bulk_edit_save_patreon' );
}
// =============================================================================
// CHAPTER LIST VIEW AND BULK EDIT
// =============================================================================
/**
* Add chapter meta fields to bulk edit
*
* @since 5.24.1
*
* @param string $column_name Name of the column to edit.
* @param string $post_type The post type slug.
*/
function fictioneer_add_bulk_edit_chapter_meta( $column_name, $post_type ) {
// Check post type
if ( $post_type !== 'fcn_chapter' ) {
return;
}
// Make sure this function is only executed once
static $added = false;
if ( $added ) {
return;
}
$added = true;
// Start HTML ---> ?>
<p class="bulk-edit-help"><?php _e( 'Use <code>_remove</code> to remove current values.', 'fictioneer' ); ?></p>
<?php if ( ! get_option( 'fictioneer_hide_chapter_icons' ) ) : ?>
<fieldset class="inline-edit-col-right">
<div class="inline-edit-chapter-icon-wrap">
<label class="inline-edit-chapter-icon">
<span class="title"><?php _ex( 'Icon', 'Chapter icon meta field label.', 'fictioneer' ); ?></span>
<input type="text" name="bulk_edit_fictioneer_chapter_icon" autocomplete="off" autocorrect="off">
</label>
</div>
</fieldset>
<?php if ( get_option( 'fictioneer_enable_advanced_meta_fields' ) ) : ?>
<fieldset class="inline-edit-col-right">
<div class="inline-edit-chapter-text-icon-wrap">
<label class="inline-edit-chapter-text-icon">
<span class="title"><?php _ex( 'Text Icon', 'Chapter text icon meta field label.', 'fictioneer' ); ?></span>
<input type="text" name="bulk_edit_fictioneer_chapter_text_icon" autocomplete="off" autocorrect="off">
</label>
</div>
</fieldset>
<?php endif; ?>
<?php endif; ?>
<?php if ( get_option( 'fictioneer_enable_advanced_meta_fields' ) ) : ?>
<fieldset class="inline-edit-col-right">
<div class="inline-edit-chapter-prefix-wrap">
<label class="inline-edit-chapter-prefix">
<span class="title"><?php _ex( 'Prefix', 'Chapter prefix meta field label.', 'fictioneer' ); ?></span>
<input type="text" name="bulk_edit_fictioneer_chapter_prefix" autocomplete="off" autocorrect="off">
</label>
</div>
</fieldset>
<?php endif; ?>
<fieldset class="inline-edit-col-right">
<div class="inline-edit-chapter-group-wrap">
<label class="inline-edit-chapter-group">
<span class="title"><?php _ex( 'Group', 'Chapter group meta field label.', 'fictioneer' ); ?></span>
<input type="text" name="bulk_edit_fictioneer_chapter_group" autocomplete="off" autocorrect="off">
</label>
</div>
</fieldset>
<?php // <--- End HTML
}
add_action( 'bulk_edit_custom_box', 'fictioneer_add_bulk_edit_chapter_meta', 10, 2 );
/**
* Save chapter bulk edit fields
*
* @since 5.24.1
*
* @param int $post_id ID of the updated post.
*/
function fictioneer_bulk_edit_save_chapter_fields( $post_id ) {
// Abort if...
if (
! wp_verify_nonce( $_REQUEST['_wpnonce'] ?? 0, 'bulk-posts' ) ||
( $_REQUEST['action2'] ?? 0 ) === 'trash' ||
! fictioneer_validate_save_action_user( $post_id, 'fcn_chapter' )
) {
return;
}
// Setup
$icon = sanitize_text_field( $_REQUEST['bulk_edit_fictioneer_chapter_icon'] ?? '' );
$text_icon = sanitize_text_field( $_REQUEST['bulk_edit_fictioneer_chapter_text_icon'] ?? '' );
$prefix = sanitize_text_field( $_REQUEST['bulk_edit_fictioneer_chapter_prefix'] ?? '' );
$group = sanitize_text_field( $_REQUEST['bulk_edit_fictioneer_chapter_group'] ?? '' );
// Update icon
if ( $icon && ! get_option( 'fictioneer_hide_chapter_icons' ) ) {
if ( strpos( $icon, 'fa-' ) === 0 && $icon !== FICTIONEER_DEFAULT_CHAPTER_ICON ) {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_icon', $icon );
} elseif ( $icon === '_remove' ) {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_icon', 0 );
}
}
// Update text icon
if (
$text_icon &&
! get_option( 'fictioneer_hide_chapter_icons' ) &&
get_option( 'fictioneer_enable_advanced_meta_fields' )
) {
if ( $text_icon === '_remove' ) {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_text_icon', 0 );
} else {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_text_icon', mb_substr( $text_icon, 0, 10, 'UTF-8' ) );
}
}
// Update prefix
if ( $prefix && get_option( 'fictioneer_enable_advanced_meta_fields' ) ) {
if ( $prefix === '_remove' ) {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_prefix', 0 );
} else {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_prefix', $prefix );
}
}
// Update group
if ( $group ) {
if ( $group === '_remove' ) {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_group', 0 );
} else {
fictioneer_update_post_meta( $post_id, 'fictioneer_chapter_group', $group );
}
}
}
add_action( 'save_post', 'fictioneer_bulk_edit_save_chapter_fields' );

View File

@ -1073,8 +1073,8 @@ if ( ! current_user_can( 'manage_options' ) ) {
// Only affect media library on admin side
if (
'admin-ajax.php' != $pagenow ||
$_REQUEST['action'] != 'query-attachments'
'admin-ajax.php' !== $pagenow ||
( $_REQUEST['action'] ?? 0 ) !== 'query-attachments'
) {
return;
}
@ -1528,10 +1528,10 @@ if ( ! current_user_can( 'manage_options' ) ) {
function fictioneer_prevent_publish_date_update( $data, $postarr ) {
// Setup
$first_publish_date = get_post_meta( $postarr['ID'], 'fictioneer_first_publish_date', true );
$current_post_date_gmt = get_post_time( 'Y-m-d H:i:s', 1, $postarr['ID'] );
// Remove from update array if already published once
if ( ! empty( $first_publish_date ) ) {
if ( $current_post_date_gmt !== $data['post_date_gmt'] ) {
unset( $data['post_date'] );
unset( $data['post_date_gmt'] );
}

View File

@ -154,11 +154,6 @@ if ( FICTIONEER_RELATIONSHIP_PURGE_ASSIST ) {
/**
* Returns sanitized arguments extracted from shortcode attributes
*
* Checks for 'count', 'offset', 'order', 'orderby', 'page', 'per_page', 'post_ids',
* 'author', 'author_ids', 'exclude_author_ids', 'exclude_tag_ids', 'exclude_cat_ids',
* 'rel', 'ignore_sticky', 'ignore_protected', 'class', and taxonomies with the
* fictioneer_get_shortcode_taxonomies() helper functions.
*
* @since 5.7.3
*
* @param array $attr Attributes passed to the shortcode.
@ -196,6 +191,7 @@ function fictioneer_get_default_shortcode_args( $attr, $def_count = -1 ) {
'relation' => strtolower( $attr['rel'] ?? 'and' ) === 'or' ? 'OR' : 'AND',
'ignore_sticky' => filter_var( $attr['ignore_sticky'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'only_protected' => filter_var( $attr['only_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'vertical' => filter_var( $attr['vertical'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'seamless' => filter_var( $attr['seamless'] ?? $seamless_default, FILTER_VALIDATE_BOOLEAN ),
'aspect_ratio' => sanitize_css_aspect_ratio( $attr['aspect_ratio'] ?? '' ),
@ -389,6 +385,7 @@ function fictioneer_get_shortcode_tax_query( $args ) {
* @param string|null $attr['orderby'] Optional. Order argument. Default 'date'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
@ -503,6 +500,7 @@ add_shortcode( 'fictioneer_showcase', 'fictioneer_shortcode_showcase' );
* @param string|null $attr['source'] Optional. Whether to show the author and story.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
@ -607,6 +605,7 @@ add_shortcode( 'fictioneer_chapter_cards', 'fictioneer_shortcode_latest_chapters
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
@ -712,6 +711,7 @@ add_shortcode( 'fictioneer_story_cards', 'fictioneer_shortcode_latest_stories' )
* @param string|null $attr['single'] Optional. Whether to show only one chapter item. Default false.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
@ -822,6 +822,7 @@ add_shortcode( 'fictioneer_update_cards', 'fictioneer_shortcode_latest_story_upd
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
@ -911,6 +912,7 @@ add_shortcode( 'fictioneer_recommendation_cards', 'fictioneer_shortcode_latest_r
* @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
@ -1511,6 +1513,7 @@ add_shortcode( 'fictioneer_search', 'fictioneer_shortcode_search' );
* @param string|null $attr['per_page'] Optional. Number of posts per page.
* @param string|null $attr['ignore_sticky'] Optional. Whether to ignore sticky posts. Default false.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
@ -1570,7 +1573,7 @@ function fictioneer_shortcode_blog( $attr ) {
// Exclude protected
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Apply filters
@ -1590,9 +1593,6 @@ function fictioneer_shortcode_blog( $attr ) {
// Query
$blog_query = new WP_Query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Prime author cache
if ( function_exists( 'update_post_author_caches' ) ) {
update_post_author_caches( $blog_query->posts );
@ -1664,6 +1664,7 @@ add_shortcode( 'fictioneer_blog', 'fictioneer_shortcode_blog' );
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
* @param string|null $attr['ignore_sticky'] Optional. Whether to ignore sticky posts. Default false.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.

View File

@ -348,6 +348,47 @@ function fictioneer_purge_caches_after_update() {
}
add_action( 'fictioneer_after_update', 'fictioneer_purge_caches_after_update' );
/**
* Removes default chapter icons from post meta table
*
* @since 5.24.1
*/
function fictioneer_remove_default_chapter_icons_from_meta() {
global $wpdb;
$wpdb->query(
$wpdb->prepare(
"
DELETE FROM $wpdb->postmeta
WHERE meta_key = %s
AND meta_value = %s
",
'fictioneer_chapter_icon',
FICTIONEER_DEFAULT_CHAPTER_ICON
)
);
}
add_action( 'fictioneer_after_update', 'fictioneer_remove_default_chapter_icons_from_meta' );
/**
* Removes obsolete fictioneer_first_publish_date from post meta table
*
* @since 5.24.1
*/
function fictioneer_remove_first_publish_date_from_meta() {
global $wpdb;
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->postmeta} WHERE meta_key = %s",
'fictioneer_first_publish_date'
)
);
}
add_action( 'fictioneer_after_update', 'fictioneer_remove_first_publish_date_from_meta' );
// =============================================================================
// PROTECT META FIELDS
// =============================================================================
@ -553,7 +594,7 @@ function fictioneer_root_attributes() {
// Setup
$post_author_id = ( $post instanceof WP_Post ) ? $post->post_author : 0;
$output = [];
$classes = ['no-js'];
$classes = ['fictioneer-theme', 'no-js'];
if ( is_archive() || is_search() || is_404() ) {
$post_author_id = 0;
@ -596,7 +637,7 @@ function fictioneer_root_attributes() {
// Prepare
$output['class'] = implode( ' ', $classes );
$output['data-mode-default'] = get_option( 'fictioneer_dark_mode_as_default', false ) ? 'dark' : 'light';
$output['data-site-width-default'] = get_theme_mod( 'site_width', 960 );
$output['data-site-width-default'] = get_theme_mod( 'site_width', FICTIONEER_DEFAULT_SITE_WIDTH );
$output['data-theme'] = 'default';
$output['data-mode'] = $output['data-mode-default'];
$output['data-font-weight'] = 'default';
@ -1387,6 +1428,26 @@ function fictioneer_add_custom_scripts() {
}
add_action( 'wp_enqueue_scripts', 'fictioneer_add_custom_scripts' );
/**
* Exclude theme scripts from Jetpack Boost
*
* @since 5.24.1
*
* @param string $tag The <script> tag for the enqueued script.
* @param string $handle The scripts registered handle.
*
* @return string The filtered <script> tag.
*/
function fictioneer_data_jetpack_boost_tag( $tag, $handle ) {
if ( strpos( $handle, 'fictioneer-' ) !== 0 ) {
return $tag;
}
return str_replace( ' src', ' data-jetpack-boost="ignore" src', $tag );
}
add_filter( 'script_loader_tag', 'fictioneer_data_jetpack_boost_tag', 10, 2 );
/**
* Enqueue block editor scripts
*
@ -1702,7 +1763,7 @@ if ( get_option( 'fictioneer_enable_anti_flicker' ) ) {
function fictioneer_output_head_critical_scripts() {
// Start HTML ---> ?>
<script id="fictioneer-critical-scripts" data-no-optimize="1" data-no-defer="1" data-no-minify="1">!function(){if("undefined"!=typeof localStorage){const e=localStorage.getItem("fcnLightmode"),t=document.documentElement;let a,o=localStorage.getItem("fcnSiteSettings");if(o&&(o=JSON.parse(o))&&null!==o&&"object"==typeof o){Object.entries(o).forEach((([e,s])=>{switch(e){case"minimal":t.classList.toggle("minimal",s);break;case"darken":a=s>=0?1+s**2:1-s**2,t.style.setProperty("--darken",`(${a} + var(--lightness-offset))`);break;case"saturation":case"font-lightness":case"font-saturation":a=s>=0?1+s**2:1-s**2,t.style.setProperty(`--${e}`,`(${a} + var(--${e}-offset))`);break;case"hue-rotate":a=Number.isInteger(o["hue-rotate"])?o["hue-rotate"]:0,t.style.setProperty("--hue-rotate",`(${a}deg + var(--hue-offset))`);break;default:t.classList.toggle(`no-${e}`,!s)}})),t.dataset.fontWeight=o["font-weight"]?o["font-weight"]:"default",t.dataset.theme=o["site-theme"]&&!t.dataset.forceChildTheme?o["site-theme"]:"default";let e=getComputedStyle(document.documentElement).getPropertyValue("--theme-color-base").trim().split(" ");const s=o.darken?o.darken:0,r=o.saturation?o.saturation:0,n=o["hue-rotate"]?o["hue-rotate"]:0,l=s>=0?1+s**2:1-s**2;o=r>=0?1+r**2:1-r**2,e=`hsl(${(parseInt(e[0])+n)%360}deg ${(parseInt(e[1])*o).toFixed(2)}% ${(parseInt(e[2])*l).toFixed(2)}%)`,document.querySelector("meta[name=theme-color]").setAttribute("content",e)}e&&(t.dataset.mode="true"==e?"light":"dark")}}(),document.documentElement.classList.remove("no-js");</script>
<script id="fictioneer-critical-scripts" data-jetpack-boost="ignore" data-no-optimize="1" data-no-defer="1" data-no-minify="1">!function(){if("undefined"!=typeof localStorage){const e=localStorage.getItem("fcnLightmode"),t=document.documentElement;let a,o=localStorage.getItem("fcnSiteSettings");if(o&&(o=JSON.parse(o))&&null!==o&&"object"==typeof o){Object.entries(o).forEach((([e,s])=>{switch(e){case"minimal":t.classList.toggle("minimal",s);break;case"darken":a=s>=0?1+s**2:1-s**2,t.style.setProperty("--darken",`(${a} + var(--lightness-offset))`);break;case"saturation":case"font-lightness":case"font-saturation":a=s>=0?1+s**2:1-s**2,t.style.setProperty(`--${e}`,`(${a} + var(--${e}-offset))`);break;case"hue-rotate":a=Number.isInteger(o["hue-rotate"])?o["hue-rotate"]:0,t.style.setProperty("--hue-rotate",`(${a}deg + var(--hue-offset))`);break;default:t.classList.toggle(`no-${e}`,!s)}})),t.dataset.fontWeight=o["font-weight"]?o["font-weight"]:"default",t.dataset.theme=o["site-theme"]&&!t.dataset.forceChildTheme?o["site-theme"]:"default";let e=getComputedStyle(document.documentElement).getPropertyValue("--theme-color-base").trim().split(" ");const s=o.darken?o.darken:0,r=o.saturation?o.saturation:0,n=o["hue-rotate"]?o["hue-rotate"]:0,l=s>=0?1+s**2:1-s**2;o=r>=0?1+r**2:1-r**2,e=`hsl(${(parseInt(e[0])+n)%360}deg ${(parseInt(e[1])*o).toFixed(2)}% ${(parseInt(e[2])*l).toFixed(2)}%)`,document.querySelector("meta[name=theme-color]").setAttribute("content",e)}e&&(t.dataset.mode="true"==e?"light":"dark")}}(),document.documentElement.classList.remove("no-js");</script>
<?php // <--- End HTML
}
add_action( 'wp_head', 'fictioneer_output_head_critical_scripts', 9999 );
@ -2303,3 +2364,38 @@ function fictioneer_default_cover( $thumbnail_id, $post ) {
if ( ! is_admin() && get_theme_mod( 'default_story_cover' ) ) {
add_filter( 'post_thumbnail_id', 'fictioneer_default_cover', 10, 2 );
}
// =============================================================================
// DISABLE INCOMPATIBLE PLUGINS
// =============================================================================
/**
* Disables the incompatible Page Optimize plugin
*
* @since 5.24.1
*/
function fictioneer_disable_page_optimize_plugin() {
if ( is_plugin_active( 'page-optimize/page-optimize.php' ) ) {
deactivate_plugins( 'page-optimize/page-optimize.php' );
add_action( 'admin_notices', 'show_page_optimize_deactivated_notice' );
}
}
add_action( 'admin_init', 'fictioneer_disable_page_optimize_plugin' );
/**
* Shows notice when the Page Optimize plugin is disabled
*
* @since 5.24.1
*/
function show_page_optimize_deactivated_notice() {
wp_admin_notice(
__( 'The Page Optimize plugin has been disabled due to compatibility issues.', 'fictioneer' ),
array(
'type' => 'info',
'dismissible' => true,
'additional_classes' => ['fictioneer-disabled-plugin-notice']
)
);
}

View File

@ -1950,7 +1950,14 @@ function fcntr( $key, $escape = false ) {
'future_prefix' => _x( 'Scheduled:', 'Chapter list status prefix.', 'fictioneer' ),
'trashed_prefix' => _x( 'Trashed:', 'Chapter list status prefix.', 'fictioneer' ),
'private_prefix' => _x( 'Private:', 'Chapter list status prefix.', 'fictioneer' ),
'free_patreon_tier' => _x( 'Follower (Free)', 'Free Patreon tier (follower).', 'fictioneer' )
'free_patreon_tier' => _x( 'Follower (Free)', 'Free Patreon tier (follower).', 'fictioneer' ),
'private_comment' => _x( 'Private Comment', 'Comment type translation.', 'fictioneer' ),
'comment_comment' => _x( 'Public Comment', 'Comment type translation.', 'fictioneer' ),
'approved_comment_status' => _x( 'Approved', 'Comment status translation.', 'fictioneer' ),
'hold_comment_status' => _x( 'Hold', 'Comment status translation.', 'fictioneer' ),
'unapproved_comment_status' => _x( 'Unapproved', 'Comment status translation.', 'fictioneer' ),
'spam_comment_status' => _x( 'Spam', 'Comment status translation.', 'fictioneer' ),
'trash_comment_status' => _x( 'Trash', 'Comment status translation.', 'fictioneer' ),
);
// Filter static translations
@ -2156,8 +2163,8 @@ if ( ! function_exists( 'fictioneer_bbcodes' ) ) {
function fictioneer_bbcodes( $content ) {
// Setup
$img_search = 'https:[^\"\'|;<>\[\]]+?\.(?:png|jpg|jpeg|gif|webp|svg|avif|tiff).*?';
$url_search = '(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?';
$img_search = '\s*https:[^\"\'|;<>\[\]]+?\.(?:png|jpg|jpeg|gif|webp|svg|avif|tiff).*?\s*';
$url_search = '\s*(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?\s*';
// Deal with some multi-line spoiler issues
if ( preg_match_all( '/\[spoiler](.+?)\[\/spoiler]/is', $content, $spoilers, PREG_PATTERN_ORDER ) ) {
@ -2181,11 +2188,11 @@ if ( ! function_exists( 'fictioneer_bbcodes' ) ) {
'/\[ins](.+?)\[\/ins]/is',
'/\[del](.+?)\[\/del]/is',
'/\[li](.+?)\[\/li]/i',
"/\[link.*]\[img]($img_search)\[\/img]\[\/link]/i",
"/\[img]($img_search)\[\/img]/i",
"/\[link\]($url_search)\[\/link\]/",
"(\[link\=[\"']?($url_search)[\"']?\](.+?)\[/link\])",
'/\[anchor]([^\"\'|;<>\[\]]+?)\[\/anchor]/i'
"/\[link.*]\[img]\s*($img_search)\s*\[\/img]\[\/link]/i",
"/\[img]\s*($img_search)\s*\[\/img]/i",
"/\[link\]\s*($url_search)\s*\[\/link\]/i",
"/\[link=\s*[\"']?\s*($url_search)\s*[\"']?\s*\](.+?)\[\/link\]/i",
'/\[anchor]\s*([^\"\'|;<>\[\]]+?)\s*\[\/anchor]/i'
);
// HTML replacements
@ -2204,7 +2211,7 @@ if ( ! function_exists( 'fictioneer_bbcodes' ) ) {
'<span class="comment-image-consent-wrapper"><button type="button" class="button _secondary consent-button" title="$1">' . _x( '<i class="fa-solid fa-image"></i> Show Image', 'Comment image consent wrapper button.', 'fictioneer' ) . '</button><img class="comment-image" data-src="$1"></span>',
"<a href=\"$1\" rel=\"noreferrer noopener nofollow\">$1</a>",
"<a href=\"$1\" rel=\"noreferrer noopener nofollow\">$5</a>",
'<a href="#$1" data-block="start" class="comment-anchor">:anchor:</a>'
'<a href="#$1" rel="noreferrer noopener nofollow" data-block="start" class="comment-anchor">:anchor:</a>'
);
// Pattern replace

View File

@ -636,14 +636,14 @@ if ( ! function_exists( 'fictioneer_theme_comment' ) ) {
}
?>
<div class="fictioneer-comment__meta">
<div class="fictioneer-comment__author truncate _1-1"><?php
<div class="fictioneer-comment__author"><?php
if ( fictioneer_is_author( $comment->user_id ) ) {
echo '<a href="' . get_author_posts_url( $comment->user_id ) . '">' . $comment->comment_author . '</a>';
} else {
echo "<span>{$comment_author}</span>";
}
echo $badge;
echo ' ' . $badge;
?></div>
<div class="fictioneer-comment__info truncate _1-1">
<?php if ( $parent_comment ) : ?>

View File

@ -49,7 +49,7 @@ if ( ! function_exists( 'fictioneer_build_story_comment' ) ) {
echo get_avatar( $id_or_email, 32 ) ?: '';
?>
<div class="fictioneer-comment__meta">
<div class="fictioneer-comment__author truncate _1-1"><span><?php echo $name; ?></span> <?php echo $badge; ?></div>
<div class="fictioneer-comment__author"><span><?php echo $name; ?></span> <?php echo $badge; ?></div>
<div class="fictioneer-comment__info truncate _1-1">
<?php
printf(

View File

@ -480,10 +480,13 @@ add_action( 'fictioneer_site', 'fictioneer_post_content_header', 20 );
* Outputs the HTML for the header background
*
* @since 5.0.0
* @since 5.24.1 - Considered additional arguments.
*
* @param int|null $args['post_id'] Optional. Current post ID.
* @param string|null $args['post_type'] Optional. Current post type.
* @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 string $args['header_image_source'] Either default, post, or story.
* @param array $args['header_args'] Arguments passed to the header.php partial.
*/
@ -495,7 +498,11 @@ function fictioneer_inner_header_background( $args ) {
// Setup
$header_image_style = get_theme_mod( 'header_image_style', 'default' );
$extra_classes = [ "_style-{$header_image_style}" ];
$extra_classes = array(
"_style-{$header_image_style}",
"_image-source-{$args['header_image_source']}",
"_post-{$args['post_id']}"
);
if ( absint( get_theme_mod( 'header_image_fading_start', 0 ) ) > 0 ) {
$extra_classes[] = '_fading-bottom';
@ -505,6 +512,10 @@ function fictioneer_inner_header_background( $args ) {
$extra_classes[] = '_shadow';
}
if ( $args['post_type'] ) {
$extra_classes[] = '_' . $args['post_type'];
}
// Start HTML ---> ?>
<div class="header-background hide-on-fullscreen polygon <?php echo implode( ' ', $extra_classes ); ?>">
<div class="header-background__wrapper polygon">
@ -1022,12 +1033,22 @@ if ( FICTIONEER_MU_REGISTRATION ) {
* Note: The ID of the template element is "term-submenu-{$type}".
*
* @since 5.22.1
* @since 5.24.1 - Added Transient.
*
* @param string $type Optional. The taxonomy type to build the menu for. Default 'fcn_genre'.
* @param bool $hide_empty Optional. Whether to include empty taxonomies. Default true.
*/
function fictioneer_render_taxonomy_submenu( $type = 'fcn_genre', $hide_empty = true ) {
// Transient cache
$key = "fictioneer_taxonomy_submenu_{$type}" . ( $hide_empty ? '_1' : '' );
$transient = get_transient( $key );
if ( $transient ) {
echo apply_filters( 'fictioneer_filter_cached_taxonomy_submenu_html', $transient, $type, $hide_empty );
return;
}
// Query terms
$terms = get_terms(
apply_filters(
@ -1066,8 +1087,14 @@ function fictioneer_render_taxonomy_submenu( $type = 'fcn_genre', $hide_empty =
$html .= '</div></div></template>';
// Apply filters
$html = apply_filters( 'fictioneer_filter_taxonomy_submenu_html', $html, $terms, $type, $hide_empty );
// Cache as Transient
set_transient( $key, $html, HOUR_IN_SECONDS );
// Render
echo apply_filters( 'fictioneer_filter_taxonomy_submenu_html', $html, $terms, $type, $hide_empty );
echo $html;
}
/**
@ -1154,3 +1181,30 @@ function fictioneer_render_character_submenu() {
function fictioneer_render_warning_submenu() {
fictioneer_render_taxonomy_submenu( 'fcn_content_warning' );
}
// =============================================================================
// DISCORD META FIELD CLEANUP
// =============================================================================
/**
* Removes Discord trigger meta field if outdated
*
* @since 5.24.1
* @global WP_Post $post
*/
function fictioneer_cleanup_discord_meta() {
global $post;
if ( ! is_singular() || ! $post || ! get_post_meta( $post->ID, 'fictioneer_discord_post_trigger' ) ) {
return;
}
$post_timestamp = get_post_time( 'U', true, $post->ID );
$current_timestamp = current_time( 'U', true );
if ( $current_timestamp - $post_timestamp > DAY_IN_SECONDS ) {
delete_post_meta( $post->ID, 'fictioneer_discord_post_trigger' );
}
}
add_action( 'wp_head', 'fictioneer_cleanup_discord_meta' );

View File

@ -701,6 +701,18 @@ define( 'FICTIONEER_OPTIONS', array(
'group' => 'fictioneer-settings-general-group',
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
'default' => 0
),
'fictioneer_log_posts' => array(
'name' => 'fictioneer_log_posts',
'group' => 'fictioneer-settings-general-group',
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
'default' => 0
),
'fictioneer_disable_menu_transients' => array(
'name' => 'fictioneer_disable_menu_transients',
'group' => 'fictioneer-settings-general-group',
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
'default' => 0
)
),
'integers' => array(
@ -1169,6 +1181,8 @@ function fictioneer_get_option_label( $option ) {
'fictioneer_enable_query_result_caching' => __( 'Enable caching of large query results', 'fictioneer' ),
'fictioneer_allow_rest_save_actions' => __( 'Allow REST requests to trigger save actions', 'fictioneer' ),
'fictioneer_enable_global_splide' => __( 'Enable Splide slider globally', 'fictioneer' ),
'fictioneer_log_posts' => __( 'Log all post updates', 'fictioneer' ),
'fictioneer_disable_menu_transients' => __( 'Disable menu Transient caching', 'fictioneer' ),
);
}

View File

@ -128,8 +128,8 @@ if ( ! defined( 'FICTIONEER_ADMIN_SETTINGS_NOTICES' ) ) {
'fictioneer-not-renamed-role' => __( 'Error. Role could not be renamed.', 'fictioneer' ),
'fictioneer-removed-role' => __( 'Role removed.', 'fictioneer' ),
'fictioneer-not-removed-role' => __( 'Error. Role could not be removed.', 'fictioneer' ),
'fictioneer-db-optimization-preview' => __( '%s superfluous post meta rows found. %s superfluous comment meta rows found. %s superfluous option rows found. Please backup your database before performing any optimization.', 'fictioneer' ),
'fictioneer-db-optimization' => __( '%s superfluous rows have been deleted.', 'fictioneer' ),
'fictioneer-db-optimization-preview' => __( '%s superfluous and %s orphaned post meta rows found. %s superfluous comment meta rows found. %s superfluous option rows found. Please backup your database before performing any optimization.', 'fictioneer' ),
'fictioneer-db-optimization' => __( '%s superfluous or orphaned rows have been deleted.', 'fictioneer' ),
'fictioneer-add-story-hidden' => __( 'The "fictioneer_story_hidden" meta field has been appended with value 0.', 'fictioneer' ),
'fictioneer-add-story-sticky' => __( 'The "fictioneer_story_sticky" meta field has been appended with value 0.', 'fictioneer' ),
'fictioneer-add-chapter-hidden' => __( 'The "fictioneer_chapter_hidden" meta field has been appended with value 0.', 'fictioneer' ),
@ -1288,6 +1288,14 @@ function fictioneer_tools_optimize_database() {
AND (meta_value = '' OR meta_value IS NULL OR meta_value = '0')
$not_like_sql
)
OR meta_key IN ('_edit_last', '_edit_lock')
");
$orphaned_post_meta_count = $wpdb->query("
DELETE pm
FROM $wpdb->postmeta pm
LEFT JOIN $wpdb->posts p ON pm.post_id = p.ID
WHERE p.ID IS NULL
");
// Delete comment meta
@ -1311,12 +1319,12 @@ function fictioneer_tools_optimize_database() {
");
// Total rows
$total = $post_meta_count + $comment_meta_count + $options_meta_count;
$total = $post_meta_count + $orphaned_post_meta_count + $comment_meta_count + $options_meta_count;
// Log
fictioneer_log(
sprintf(
__( 'Optimized database and removed %s superfluous rows.', 'fictioneer' ),
__( 'Optimized database and removed %s superfluous or orphaned rows.', 'fictioneer' ),
$total
)
);
@ -1372,6 +1380,14 @@ function fictioneer_tools_optimize_database_preview() {
AND (meta_value = '' OR meta_value IS NULL OR meta_value = '0')
$not_like_sql
)
OR meta_key IN ('_edit_last', '_edit_lock')
");
$orphaned_post_meta_count = $wpdb->get_var("
SELECT COUNT(*)
FROM $wpdb->postmeta pm
LEFT JOIN $wpdb->posts p ON pm.post_id = p.ID
WHERE p.ID IS NULL
");
// Comment meta
@ -1399,7 +1415,7 @@ function fictioneer_tools_optimize_database_preview() {
add_query_arg(
array(
'info' => 'fictioneer-db-optimization-preview',
'data' => "{$post_meta_count},{$comment_meta_count},{$options_meta_count}"
'data' => "{$post_meta_count},{$orphaned_post_meta_count},{$comment_meta_count},{$options_meta_count}"
),
wp_get_referer()
)

View File

@ -4,6 +4,28 @@
// LOGS
// =============================================================================
/**
* Returns (or creates) secret log hash used to obscure the log file name
*
* @since 5.24.1
*
* @return string The log hash.
*/
function fictioneer_get_log_hash() {
$hash = strval( get_option( 'fictioneer_log_hash' ) );
if ( ! empty( $hash ) ) {
return $hash;
}
$hash = wp_generate_password( 32, false );
update_option( 'fictioneer_log_hash', $hash, 'no' );
return $hash;
}
/**
* Logs a message to the theme log file
*
@ -17,7 +39,8 @@ function fictioneer_log( $message, $current_user = null ) {
// Setup
$current_user = $current_user ?? wp_get_current_user();
$username = _x( 'System', 'Default name in logs.', 'fictioneer' );
$log_file = WP_CONTENT_DIR . '/fictioneer-logs.log';
$log_hash = fictioneer_get_log_hash();
$log_file = WP_CONTENT_DIR . "/fictioneer-{$log_hash}-log.log";
$log_limit = 5000;
$date = current_time( 'mysql', true );
@ -57,6 +80,14 @@ function fictioneer_log( $message, $current_user = null ) {
// Set file permissions
chmod( $log_file, 0600 );
// Security
$silence = WP_CONTENT_DIR . '/index.php';
if ( ! file_exists( $silence ) ) {
file_put_contents( $silence, "<?php\n// Silence is golden.\n" );
chmod( $silence, 0600 );
}
}
/**
@ -67,7 +98,8 @@ function fictioneer_log( $message, $current_user = null ) {
function fictioneer_get_log() {
// Setup
$log_file = WP_CONTENT_DIR . '/fictioneer-logs.log';
$log_hash = fictioneer_get_log_hash();
$log_file = WP_CONTENT_DIR . "/fictioneer-{$log_hash}-log.log";
$output = '';
// Check whether log file exists
@ -141,12 +173,18 @@ function fictioneer_get_wp_debug_log() {
* Logs post update
*
* @since 5.0.0
* @since 5.24.1 - Make dependant on option.
*
* @param int $post_id The post ID.
* @param string $action The action performed.
*/
function fictioneer_log_post_update( $post_id, $action ) {
// Log posts?
if ( ! get_option( 'fictioneer_log_posts' ) ) {
return;
}
// Setup
$type_object = get_post_type_object( get_post_type( $post_id ) );
$post_type_name = $type_object->labels->singular_name;

View File

@ -1155,6 +1155,18 @@ $images = get_template_directory_uri() . '/img/documentation/';
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(
'fictioneer_log_posts',
__( 'Log all post updates', 'fictioneer' ),
__( 'If you want to track any and all changes.', 'fictioneer' ),
'Enable this option if you want to track every action made to any post: publishing, updating, trashing, and deleting. This may be useful if you have concerns about content changes, but it is not recommended for sites with a high throughput of posts.',
'<div class="helper-modal-image"><img src="' . $images . 'fictioneer_log_posts.jpg"></div>'
);
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(
@ -1333,6 +1345,17 @@ $images = get_template_directory_uri() . '/img/documentation/';
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(
'fictioneer_disable_menu_transients',
__( 'Disable menu Transient caching', 'fictioneer' ),
__( 'Only do this if you render dynamic content in the menus.', 'fictioneer' ),
__( 'Compiling navigation menus is an extensive operation that involves multiple database queries. If you are not displaying dynamic content, such as points or other constantly changing data, it is best to cache the menus to avoid repeating the same queries for identical results.', 'fictioneer' )
);
?>
</div>
<div class="fictioneer-card__row">
<?php
fictioneer_settings_label_checkbox(

View File

@ -6,6 +6,10 @@
* @subpackage Fictioneer
* @since 4.7.0
*/
global $wpdb;
?>
<div class="fictioneer-settings">
@ -193,6 +197,22 @@
<p><?php _e( '<strong>Optimize and clean up the database to boost performance.</strong> This action removes any superfluous rows added by the theme, such as empty or obsolete values. Core, plugin, and custom rows are not affected. While generally considered safe, you should <a href="https://developer.wordpress.org/advanced-administration/security/backup/database/#using-wordpress-database-backup-plugin" target="_blank">always make a backup</a> before performing database operations.', 'fictioneer' ); ?></p>
</div>
<div class="fictioneer-card__row">
<p><?php
printf(
__( '<strong>Post Meta Rows:</strong> %d', 'fictioneer' ),
$wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->postmeta" )
);
echo ' | ';
printf(
__( '<strong>Comment Meta Rows:</strong> %d', 'fictioneer' ),
$wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->commentmeta" )
);
?></p>
</div>
<div class="fictioneer-card__row fictioneer-card__row--buttons">
<a class="button button--secondary" href="<?php echo fictioneer_admin_action( 'fictioneer_tools_optimize_database_preview' ); ?>"><?php _e( 'Scan', 'fictioneer' ); ?></a>
<a class="button button--secondary" href="<?php echo fictioneer_admin_action( 'fictioneer_tools_optimize_database' ); ?>" data-click="warning-dialog" data-dialog="<?php _e( 'This operation is safe, but making a database backup is still recommended to account for the unexpected.', 'fictioneer' ); ?>"><?php _e( 'Optimize', 'fictioneer' ); ?></a>

View File

@ -26,6 +26,8 @@ get_header();
get_template_part( 'partials/_loop' );
?></div>
<?php do_action( 'fictioneer_main_end', 'index' ); ?>
</main>
<?php

File diff suppressed because one or more lines are too long

2
js/complete.min.js vendored

File diff suppressed because one or more lines are too long

2
js/sortable.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
js/utility.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@
* @internal $args['post_type'] Array of post types to query. Default 'post'.
* @internal $args['ignore_sticky'] Whether to ignore sticky flags. Default false.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['count'] Number of posts to display. Default -1.
* @internal $args['author'] Author to query posts for. Default empty.
* @internal $args['order'] Order of posts. Default 'DESC'.
@ -96,11 +97,16 @@ if ( ! empty( $args['excluded_tags'] ) ) {
}
// Ignore protected?
if ( ! $args['ignore_protected'] ) {
if ( ! $args['ignore_protected'] || $args['only_protected'] ) {
$obfuscation = str_repeat( _x( '&#183; ', 'Protected post content obfuscation character.', 'fictioneer' ), 256 );
$obfuscation = apply_filters( 'fictioneer_filter_obfuscation_string', $obfuscation, $post );
} else {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -109,9 +115,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_article_cards_query_ar
// Query
$query = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Unique ID
$unique_id = wp_unique_id( 'article-block-' );

View File

@ -30,6 +30,10 @@ $text_icon = get_post_meta( $post_id, 'fictioneer_chapter_text_icon', true );
$excerpt = fictioneer_get_forced_excerpt( $post, 512, true );
$card_classes = [];
if ( ! $chapter_rating && $story_id ) {
$chapter_rating = get_post_meta( $story_id, 'fictioneer_story_rating', true );
}
// Taxonomies
$tags = false;
$fandoms = false;

View File

@ -21,6 +21,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['vertical'] Whether to show the vertical variant.
@ -108,7 +109,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -117,9 +123,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_
// Query chapters
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
@ -113,7 +114,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -122,9 +128,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_
// Query chapters
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];
@ -171,6 +174,10 @@ if ( $splide ) {
$chapter_rating = get_post_meta( $post_id, 'fictioneer_chapter_rating', true );
$words = fictioneer_get_word_count( $post_id );
if ( ! $chapter_rating && $story_id ) {
$chapter_rating = get_post_meta( $story_id, 'fictioneer_story_rating', true );
}
// Thumbnail
$thumbnail = null;

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
@ -113,7 +114,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -122,9 +128,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_
// Query chapters
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];
@ -166,6 +169,10 @@ if ( $splide ) {
$grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid';
$card_classes = [];
if ( ! $chapter_rating && $story_id ) {
$chapter_rating = get_post_meta( $story_id, 'fictioneer_story_rating', true );
}
// Extra card classes
if ( ! empty( $post->post_password ) ) {
$card_classes[] = '_password';

View File

@ -17,6 +17,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['classes'] Array of additional CSS classes. Default empty.
@ -72,7 +73,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -81,9 +87,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_posts_query_arg
// Query post
$latest_entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
?>
<section class="latest-posts <?php echo $args['classes']; ?>">

View File

@ -19,6 +19,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['vertical'] Whether to show the vertical variant.
@ -87,7 +88,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -96,9 +102,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations
// Query chapters
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -19,6 +19,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['vertical'] Whether to show the vertical variant.
@ -84,7 +85,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -93,9 +99,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations
// Query recommendations
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show the author. Default true.
@ -112,7 +113,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -121,9 +127,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_a
// Query stories
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story. Default true.
@ -113,7 +114,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -122,9 +128,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_a
// Query stories
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show the author. Default true.
@ -113,7 +114,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -122,9 +128,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_a
// Query stories
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -22,6 +22,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story.
@ -121,7 +122,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -130,9 +136,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_a
// Query stories
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -22,6 +22,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story.
@ -124,7 +125,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -133,9 +139,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_a
// Query stories
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -23,6 +23,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story.
@ -127,7 +128,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -136,9 +142,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_a
// Query stories
$entries = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -22,6 +22,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['classes'] String of additional CSS classes. Default empty.
@ -84,7 +85,12 @@ if ( ! empty( $args['excluded_authors'] ) ) {
// Ignore protected?
if ( $args['ignore_protected'] ) {
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
@ -93,9 +99,6 @@ $query_args = apply_filters( 'fictioneer_filter_shortcode_showcase_query_args',
// Query collections
$query = fictioneer_shortcode_query( $query_args );
// Remove temporary filters
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
// Extra attributes
$attributes = [];

View File

@ -98,9 +98,9 @@ $badge = fictioneer_get_comment_badge( $current_user, null );
<?php if ( $avatar ) echo $avatar; ?>
<div class="fictioneer-comment__meta">
<div class="fictioneer-comment__author truncate _1-1">
<div class="fictioneer-comment__author">
<span><?php echo $current_user->display_name; ?></span>
<?php if ( $badge ) echo $badge; ?>
<?php if ( $badge ) echo ' ' . $badge; ?>
</div>
<div class="fictioneer-comment__info truncate _1-1">
<div class="fictioneer-comment__date"><?php

View File

@ -5,9 +5,9 @@ Author URI: https://github.com/Tetrakern
Donate link: [Support me on Ko-Fi](https://ko-fi.com/tetrakern)
Contributors: tetrakern
Requires at least: 6.1.0
Tested up to: 6.6.1
Tested up to: 6.6.2
Requires PHP: 7.4
Stable tag: 5.24.0
Stable tag: 5.24.1
License: GNU General Public License v3.0 or later
License URI: http://www.gnu.org/licenses/gpl.html

View File

@ -488,7 +488,7 @@ function fcn_removeLastClick(target) {
}
/**
* Clicks on elements with the 'toggle-last-clicked' class are handles by the
* Clicks on elements with the 'toggle-last-clicked' class are handled by the
* global click handler in application.js to avoid rebinding cases.
*/
@ -496,14 +496,16 @@ function fcn_removeLastClick(target) {
_$('body').addEventListener(
'click',
e => {
const target = e.target.closest('.toggle-last-clicked');
if (
(!['BUTTON', 'A'].includes(e.target.tagName) && e.target.closest('.toggle-last-clicked')) ||
(!['BUTTON', 'A'].includes(e.target.tagName) && target) ||
e.target.closest('.escape-last-click') !== null
) {
return;
}
if (fcn_lastClicked && e.currentTarget != fcn_lastClicked) {
if (fcn_lastClicked && target != fcn_lastClicked) {
fcn_removeLastClick(fcn_lastClicked);
}
}

View File

@ -77,7 +77,9 @@
}
.card__info-toggle {
display: none;
.fa-chevron-down:before {
content: "\f00d";
}
}
.card__overlay-infobox {
@ -190,7 +192,7 @@
position: absolute;
top: 0;
right: 0;
z-index: 2;
z-index: 100;
color: var(--fg-600);
font-size: 14px;
line-height: 1;
@ -556,7 +558,7 @@
&__overlay-infobox {
position: absolute;
inset: min(var(--card-overlay-inset, 3cqw), 14px);
inset: var(--card-overlay-inset, 5px);
display: none;
content-visibility: hidden; // Improve performance
flex-direction: column;
@ -582,6 +584,14 @@
&._pills {
--this-mask-offset: 0px;
}
&::before {
content: '';
display: block;
float: right;
height: 20px;
width: 20px;
}
}
.card__footer {
@ -676,7 +686,7 @@
}
}
.card__info-toggle {
.card__info-toggle:not(.last-clicked) {
color: #fff;
opacity: .5;
@ -1019,7 +1029,7 @@
}
}
:root:not(.no-covers) .card._vertical:not(._seamless) .card__info-toggle {
:root:not(.no-covers) .card._vertical:not(._seamless) .card__info-toggle:not(.last-clicked) {
padding-top: calc(2 * var(--this-spacing));
padding-right: calc(2 * var(--this-spacing));
}

View File

@ -248,7 +248,7 @@
}
}
:where(a, label):where(:not(._no-menu-item-style)) {
> :where(:first-child:not(._no-menu-item-style)) {
position: relative;
display: flex;
align-items: center;

View File

@ -39,6 +39,7 @@
border-radius: var(--layout-border-radius-small);
box-shadow: var(--showcase-box-shadow, var(--box-shadow-m));
overflow: hidden;
height: fit-content; // Fix for Safari
max-width: max(420px, 100%);
contain: layout paint style; // Improve performance

View File

@ -331,13 +331,15 @@ $header_breakpoint: 640px;
margin-top: 24px;
.chapter-group__list-item._folding-toggle {
display: block;
grid-template-columns: 1fr;
grid-template-rows: auto;
content-visibility: visible;
padding: 0 !important;
}
&__folding-toggle {
display: block;
grid-template-columns: 1fr;
grid-template-rows: auto;
content-visibility: visible;
color: var(--fg-800);
line-height: 1.125;

View File

@ -1183,6 +1183,11 @@ td.fictioneer_patreon_lock_amount {
}
}
.bulk-edit-help {
float: left;
margin: 1em 0 .5em !important;
}
// ==============================================================================
// FICTIONEER DIALOG MODALS
// ==============================================================================

View File

@ -439,13 +439,14 @@
&__header {
display: flex;
align-items: center;
align-items: flex-start;
gap: 8px;
line-height: 1;
margin-bottom: .75rem;
img {
.avatar {
border-radius: var(--layout-border-radius-small);
transform: translateY(1.5px);
}
}
@ -471,7 +472,7 @@
text-shadow: none;
border-radius: 2px;
padding: 0 4px;
margin-left: 4px;
margin-left: 1px;
height: 16px;
transform: translateY(-1px);

View File

@ -108,6 +108,8 @@ p a:not(.wp-element-button),
}
p {
font-size: inherit; // Deal with some plugins
img {
display: inline-block;
height: auto;

View File

@ -72,7 +72,7 @@ select {
background: var(--input-background);
color: var(--input-color);
border: none;
border-radius: var(--layout-border-radius-small);
border-radius: var(--input-border-radius, var(--layout-border-radius-small));
box-shadow: var(--input-shadow);
// Only iOS
@ -106,7 +106,7 @@ input[type=range] {
cursor: pointer;
-webkit-appearance: none;
background: var(--input-range-thumb);
border-radius: 1px;
border-radius: var(--input-border-radius, var(--layout-border-radius-small));
width: 18px;
height: 18px;
transition: background-color var(--transition-duration);
@ -125,7 +125,7 @@ input[type=range] {
cursor: pointer;
background: var(--input-range-thumb);
border: none;
border-radius: 2px;
border-radius: var(--input-border-radius, var(--layout-border-radius-small));
width: 14px;
height: 14px;
transition: background-color var(--transition-duration);
@ -155,7 +155,7 @@ input[type=radio] {
flex-shrink: 0;
line-height: 1;
border: 1px solid transparent;
border-radius: 2px;
border-radius: min(5px, var(--input-border-radius, var(--layout-border-radius-small)));
margin: 0;
height: 16px;
width: 16px;
@ -228,6 +228,7 @@ input[type=radio] {
&__operator {
--focus-offset: -2px;
--this-border-radius: var(--input-border-radius, var(--layout-border-radius-small));
position: absolute;
top: 0;
right: 0;
@ -240,7 +241,7 @@ input[type=radio] {
font-weight: 400;
line-height: 1;
padding: 4px 6px;
border-radius: var(--layout-border-radius-small) var(--layout-border-radius-small) 0 0;
border-radius: var(--this-border-radius) var(--this-border-radius) 0 0;
width: 40px;
transform: translateY(-100%);
@ -271,7 +272,7 @@ input[type=radio] {
flex-wrap: wrap;
gap: 8px;
background: var(--input-background);
border-radius: var(--layout-border-radius-small);
border-radius: var(--input-border-radius, var(--layout-border-radius-small));
padding: 6px 8px;
width: 100%;
@ -289,7 +290,7 @@ input[type=radio] {
text-shadow: none;
white-space: nowrap;
text-transform: capitalize;
border-radius: var(--layout-border-radius-small);
border-radius: var(--input-border-radius, var(--layout-border-radius-small));
padding: 0 20px 0 6px;
width: fit-content;
overflow: hidden;

View File

@ -75,7 +75,7 @@
// --litrpg-ins: var(--green-600);
// --litrpg-del: var(--red-600);
// --litrpg-polygon: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
--litrpg-drop-shadow: var(--drop-shadow-xs);
--litrpg-drop-shadow: var(--drop-shadow-s);
// === CONTENT LISTS =========================================================
@ -112,26 +112,6 @@
--bg-900-free: #{hsl_code_free(210, 39, 11)}; // #111c27
--bg-950-free: #{hsl_code_free(210, 71, 4)}; // #030a11
// === FOREGROUNDS ===========================================================
&,
.chapter-formatting {
// Needs to be repeated to force recalculation in chapters
--fg-100: #{hsl_font_code(225, 80, 2)}; // #010309 | Contrast ratio vs bg-100 ~ 19.72
--fg-200: #{hsl_font_code(224, 71, 4)}; // #030712 (Tailwind Gray 950) | Contrast ratio vs bg-100 ~ 19.28
--fg-300: #{hsl_font_code(220, 55, 7)}; // #080f1c | Contrast ratio vs bg-100 ~ 18.38
--fg-400: #{hsl_font_code(221, 39, 11)}; // #111827 (Tailwind Gray 900) | Contrast ratio vs bg-100 ~ 16.96
--fg-500: #{hsl_font_code(225, 26, 16)}; // #1e2333 | Contrast ratio vs bg-100 ~ 14.87
--fg-600: #{hsl_font_code(217, 19, 27)}; // #374151 (Tailwind Gray 700) | Contrast ratio vs bg-100 ~ 9.74
--fg-700: #{hsl_font_code(223, 11, 39)}; // #595f6e | Contrast ratio vs bg-100 ~ 6.11
--fg-800: #{hsl_font_code(220, 9, 46)}; // #6b7280 (Tailwind Gray 500) | Contrast ratio vs bg-100 ~ 4.64
--fg-900: #{hsl_font_code(218, 11, 58)}; // #8891a0 | Contrast ratio vs bg-100 ~ 3.04
--fg-950: #{hsl_font_code(218, 11, 65)}; // #9ca3af (Tailwind Gray 400) | Contrast ratio vs bg-100 ~ 2.42
--fg-tinted: #{hsl_font_code(217, 33, 17)}; // #1e293b (Tailwind Gray 800) | Contrast ratio vs bg-100 ~ 14.18
--fg-inverted: #{hsl_font_code(210, 20, 99)};
}
// === LAYOUT ================================================================
// --layout-spacing-vertical: #{get_clamp(24, 48, 480, $full-width)};
@ -456,6 +436,28 @@
--badge-override-color: var(--fg-inverted);
--badge-override-background: #64748b;
// === FOREGROUNDS ===========================================================
// Placed here due to SCSS/CSS nesting rules
&,
.chapter-formatting {
// Needs to be repeated to force recalculation in chapters
--fg-100: #{hsl_font_code(225, 80, 2)}; // #010309 | Contrast ratio vs bg-100 ~ 19.72
--fg-200: #{hsl_font_code(224, 71, 4)}; // #030712 (Tailwind Gray 950) | Contrast ratio vs bg-100 ~ 19.28
--fg-300: #{hsl_font_code(220, 55, 7)}; // #080f1c | Contrast ratio vs bg-100 ~ 18.38
--fg-400: #{hsl_font_code(221, 39, 11)}; // #111827 (Tailwind Gray 900) | Contrast ratio vs bg-100 ~ 16.96
--fg-500: #{hsl_font_code(225, 26, 16)}; // #1e2333 | Contrast ratio vs bg-100 ~ 14.87
--fg-600: #{hsl_font_code(217, 19, 27)}; // #374151 (Tailwind Gray 700) | Contrast ratio vs bg-100 ~ 9.74
--fg-700: #{hsl_font_code(223, 11, 39)}; // #595f6e | Contrast ratio vs bg-100 ~ 6.11
--fg-800: #{hsl_font_code(220, 9, 46)}; // #6b7280 (Tailwind Gray 500) | Contrast ratio vs bg-100 ~ 4.64
--fg-900: #{hsl_font_code(218, 11, 58)}; // #8891a0 | Contrast ratio vs bg-100 ~ 3.04
--fg-950: #{hsl_font_code(218, 11, 65)}; // #9ca3af (Tailwind Gray 400) | Contrast ratio vs bg-100 ~ 2.42
--fg-tinted: #{hsl_font_code(217, 33, 17)}; // #1e293b (Tailwind Gray 800) | Contrast ratio vs bg-100 ~ 14.18
--fg-inverted: #{hsl_font_code(210, 20, 99)};
}
// === SCOPES ================================================================
.consent-banner {

View File

@ -207,7 +207,7 @@
background-color: var(--modal-bg-color);
padding: 0;
border: none;
border-radius: var(--layout-border-radius-large);
border-radius: min(20px, var(--layout-border-radius-large));
max-height: calc(100% - 20px);
width: var(--modal-width, 300px);
max-width: calc(100vw - 20px);

View File

@ -25,14 +25,6 @@
--hue-rotate: 0deg + var(--hue-offset);
--wp--style--block-gap: 1.5rem;
// === NAVIGATION ============================================================
--navigation-height: 48px;
@include bp(desktop) {
--navigation-height: 40px;
}
// === SIDEBAR ===============================================================
--sidebar-width: 256px; // Overridden by theme customizer
@ -72,6 +64,14 @@
// === ASSETS ================================================================
--data-image-2x2-black: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAAAAACMmsGiAAAAC0lEQVQI12NgwAQAABQAAeWGsEoAAAAASUVORK5CYII=");
// === NAVIGATION ============================================================
--navigation-height: 48px;
@include bp(desktop) {
--navigation-height: 40px;
}
}
// =============================================================================
@ -240,26 +240,6 @@
--bg-900: hsl(var(--bg-900-free));
--bg-950: hsl(var(--bg-950-free));
// === FOREGROUNDS ===========================================================
&,
.chapter-formatting {
// Needs to be repeated to force recalculation in chapters
// Contrast vs bg-700
--fg-100: #{hsl_font_code(222, 40, 93)}; // Contrast ratio vs bg-700 ~ 11
--fg-200: #{hsl_font_code(222, 26, 89)}; // Contrast ratio vs bg-700 ~ 10
--fg-300: #{hsl_font_code(224, 20, 85)}; // Contrast ratio vs bg-700 ~ 9.02
--fg-400: #{hsl_font_code(222, 18, 80.5)}; // Contrast ratio vs bg-700 ~ 8.02
--fg-500: #{hsl_font_code(222, 18, 77)}; // Contrast ratio vs bg-700 ~ 7.26
--fg-600: #{hsl_font_code(224, 18, 71)}; // Contrast ratio vs bg-700 ~ 6.01
--fg-700: #{hsl_font_code(224, 16, 65)}; // Contrast ratio vs bg-700 ~ 5
--fg-800: #{hsl_font_code(222, 12, 61)}; // Contrast ratio vs bg-700 ~ 4.5
--fg-900: #{hsl_font_code(222, 11, 54)}; // Contrast ratio vs bg-700 ~ 3.55
--fg-950: #{hsl_font_code(222, 9, 49)}; // Contrast ratio vs bg-700 ~ 3
--fg-tinted: #{hsl_font_code(224, 22, 76)}; // Contrast ratio vs bg-700 ~ 6.92
--fg-inverted: #{hsl_font_code(222, 20, 5)}; // Contrast ratio vs bg-200 ~ 4.51
}
// === CUSTOMIZER (FOR REFERENCE) ============================================
// --top-header-background: transparent;
@ -618,6 +598,28 @@
--badge-override-color: var(--fg-300);
--badge-override-background: #5a5a7f;
// === FOREGROUNDS ===========================================================
// Placed here due to SCSS/CSS nesting rules
&,
.chapter-formatting {
// Needs to be repeated to force recalculation in chapters
// Contrast vs bg-700
--fg-100: #{hsl_font_code(222, 40, 93)}; // Contrast ratio vs bg-700 ~ 11
--fg-200: #{hsl_font_code(222, 26, 89)}; // Contrast ratio vs bg-700 ~ 10
--fg-300: #{hsl_font_code(224, 20, 85)}; // Contrast ratio vs bg-700 ~ 9.02
--fg-400: #{hsl_font_code(222, 18, 80.5)}; // Contrast ratio vs bg-700 ~ 8.02
--fg-500: #{hsl_font_code(222, 18, 77)}; // Contrast ratio vs bg-700 ~ 7.26
--fg-600: #{hsl_font_code(224, 18, 71)}; // Contrast ratio vs bg-700 ~ 6.01
--fg-700: #{hsl_font_code(224, 16, 65)}; // Contrast ratio vs bg-700 ~ 5
--fg-800: #{hsl_font_code(222, 12, 61)}; // Contrast ratio vs bg-700 ~ 4.5
--fg-900: #{hsl_font_code(222, 11, 54)}; // Contrast ratio vs bg-700 ~ 3.55
--fg-950: #{hsl_font_code(222, 9, 49)}; // Contrast ratio vs bg-700 ~ 3
--fg-tinted: #{hsl_font_code(224, 22, 76)}; // Contrast ratio vs bg-700 ~ 6.92
--fg-inverted: #{hsl_font_code(222, 20, 5)}; // Contrast ratio vs bg-200 ~ 4.51
}
// === SCOPES ================================================================
.consent-banner {

View File

@ -22,7 +22,7 @@
}
:root.no-covers .site {
:is(.card__image, .card__text-icon) {
:is(.card__image, .card__text-icon, .post-list-item__image) {
display: none !important;
content-visibility: hidden !important;
}

View File

@ -13,6 +13,10 @@ html:is(:root) {
outline: none;
}
[hidden] {
display: none !important;
}
*:not(input, textarea, select, .wp-block-file a, .button-unset-oauth):focus-visible,
input:is([type=checkbox], [type=radio], [type=range], [type=submit]):focus-visible,
.user-is-tabbing select:focus-visible,

View File

@ -7,6 +7,8 @@
--this-rotation-s: calc(1.75deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));
--this-rotation-xs: calc(1.5deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));
--this-rotation-xxs: calc(1.25deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));
--this-rotation-xxxs: calc(1deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));
--this-rotation-xxxxs: calc(0.75deg * var(--this-rotation-mod, 1) * var(--this-flip, 1));
box-shadow: 0 0 0 var(--card-frame-border-thickness, 2.5px) var(--card-frame-border-color);
&::before {
@ -35,6 +37,14 @@
@container (min-width: 750px) {
transform: translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xxs)));
}
@container (min-width: 900px) {
transform: translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xxxs)));
}
@container (min-width: 1050px) {
transform: translate(-50%, -50%) rotate(var(--card-frame-rotation, var(--this-rotation-xxxxs)));
}
}
.card__body {

View File

@ -30,6 +30,7 @@
height: var(--header-logo-height);
max-height: calc(var(--site-title-font-size) + var(--site-title-tagline-font-size) + 1rem);
width: auto;
max-width: 100%;
object-fit: contain;
}

View File

@ -26,6 +26,7 @@
height: var(--header-logo-height);
max-height: var(--header-logo-height);
width: fit-content;
max-width: 100%;
object-fit: contain;
}
}

View File

@ -44,7 +44,7 @@
}
&._seamless {
grid-template-rows: .5rem auto auto .5rem;
grid-template-rows: minmax(.5rem, 1fr) auto auto minmax(.5rem, 1fr);
padding: 0 8px 0 0;
.post-list-item__image {
@ -58,7 +58,7 @@
}
&:is(._latest-updates, ._latest-stories):not(._no-tax) {
grid-template-rows: .5rem auto auto auto .5rem;
grid-template-rows: minmax(.5rem, 1fr) auto auto auto minmax(.5rem, 1fr);
}
&._full {

View File

@ -9,9 +9,9 @@ License: GNU General Public License v3.0 or later
License URI: http://www.gnu.org/licenses/gpl.html
Requires at least: 6.1.0
Tested up to: 6.6.1
Tested up to: 6.6.2
Requires PHP: 7.4
Version: 5.24.0
Version: 5.24.1
Text Domain: fictioneer
Description: Standalone solution for publishing and reading web fictions.

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"version": 3,
"settings": {
"appearanceTools": true,
"color": {
@ -41,6 +41,7 @@
"customFontSize": false,
"fluid": false,
"fontFamilies": [],
"defaultFontSizes": false,
"fontSizes": [
{
"size": "var(--fs-em-xxs)",