Added FICTIONEER_DEFAULT_SITE_WIDTH

This commit is contained in:
Tetrakern 2024-09-20 22:46:34 +02:00
parent 97b90339f3
commit 68ea6eaa78
4 changed files with 9 additions and 3 deletions

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

@ -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 );

View File

@ -619,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' );
@ -705,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

@ -637,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';