Skip to content

Commit 2c47917

Browse files
Multiple updates
- Update Font Awesome to v6.6.0 - Update editor styles due to the Block Editor now being iFramed (under certain conditions) - Add Bluesky, Letterboxd, Pixiv & Threads social icons
1 parent b5e7d06 commit 2c47917

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

functions.php

+43-6
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function ephemeris_scripts_styles() {
278278

279279
// Register and enqueue our icon font
280280
// We're using the awesome Font Awesome icon font. https://fontawesome.com
281-
wp_enqueue_style( 'font-awesome-6', trailingslashit( get_template_directory_uri() ) . 'css/fontawesome-all.min.css', array( 'normalize' ), '6.5.1', 'all' );
281+
wp_enqueue_style( 'font-awesome-6', trailingslashit( get_template_directory_uri() ) . 'css/fontawesome-all.min.css', array( 'normalize' ), '6.6.0', 'all' );
282282

283283
// Our styles for setting up the grid. We're using Unsemantic. http://unsemantic.com
284284
wp_enqueue_style( 'unsemantic-grid', trailingslashit( get_template_directory_uri() ) . 'css/unsemantic.css', array( 'font-awesome-6' ), '1.2.3', 'all' );
@@ -339,7 +339,8 @@ function ephemeris_scripts_styles() {
339339
* Load our Block Editor styles to style the Editor like the front-end.
340340
* Increased the width of the Block Editor blocks to match the site width from the Customizer by dynamically loading our styles into the <head>
341341
*
342-
* Some styles are duplicated (with different classes) because Core Devs ignore backwards compatibility
342+
* Some styles are duplicated (with different classes) because Core Devs ignore backwards compatibility, and also because they've now added
343+
* everything within in an iframe (but only under certain conditions)
343344
*
344345
* @since Ephemeris 1.4
345346
*
@@ -354,29 +355,37 @@ function ephemeris_block_editor_styles() {
354355
// Enqueue our seperate Block Editor stylesheet with the rest of our styles
355356
wp_enqueue_style( 'ephemeris-blocks-style', trailingslashit( get_template_directory_uri() ) . 'css/blocks-style.css', array(), '1.0.1', 'all' );
356357

358+
// Make sure paragraph blocks within blocks are centered within
359+
$styles .= 'body.block-editor-iframe__body .block-editor-block-list__layout.is-root-container :where(:not(.alignleft):not(.alignright)) {margin-left: auto !important;margin-right: auto !important;}';
360+
357361
// Increase width of all Blocks & Block Appender
358362
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block {max-width: ' . esc_attr( $ephemeris_layout_width - 40 ) . 'px;}';
363+
$styles .= 'body.block-editor-iframe__body .block-editor-block-list__layout .wp-block {max-width: ' . esc_attr( $ephemeris_layout_width - 40 ) . 'px;}';
364+
365+
// Increase width of the post title wrapper when iframed
366+
$styles .= 'body.block-editor-iframe__body .editor-visual-editor__post-title-wrapper .wp-block {max-width: ' . esc_attr( $ephemeris_layout_width - 40 ) . 'px;}';
359367

360368
// Increase width of Wide blocks
361369
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block[data-align="wide"],body.block-editor-page .edit-post-visual-editor .wp-block.alignwide {max-width: ' . esc_attr( $ephemeris_layout_width - 40 + 400 ) . 'px;}';
362370
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block[data-align="wide"] .wp-block,body.block-editor-page .edit-post-visual-editor .wp-block.alignwide .wp-block {max-width: ' . esc_attr( $ephemeris_layout_width - 40 + 400 ) . 'px;}';
371+
$styles .= 'body.block-editor-iframe__body .block-editor-block-list__layout .wp-block[data-align="wide"] .wp-block,body.block-editor-iframe__body .block-editor-block-list__layout .wp-block.alignwide {max-width: ' . esc_attr( $ephemeris_layout_width - 40 + 400 ) . 'px;}';
363372

364373
// Remove max-width on Full blocks
365374
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block[data-align="full"],body.block-editor-page .edit-post-visual-editor .wp-block.alignfull {max-width: none;}';
366375
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block[data-align="full"] .wp-block,body.block-editor-page .edit-post-visual-editor .wp-block.alignfull .wp-block {max-width: none;}';
376+
$styles .= 'body.block-editor-iframe__body .block-editor-block-list__layout .wp-block[data-align="full"] .wp-block,body.block-editor-iframe__body .block-editor-block-list__layout .wp-block.alignfull {max-width: none;}';
367377

368378
// Constrain width of Wide and Full Group Containers
369379
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block-group.alignwide.is-layout-constrained {max-width: ' . esc_attr( $ephemeris_layout_width - 40 + 400 ) . 'px;}';
370380
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block-group.alignfull.is-layout-constrained {max-width: none;}';
381+
$styles .= 'body.block-editor-iframe__body .block-editor-block-list__layout .wp-block-group.alignfull.is-layout-constrained {max-width: none;}';
371382

372383
// Constrain width of Cover Block Inner Containers
373384
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block-cover .wp-block-cover__inner-container {max-width: ' . esc_attr( $ephemeris_layout_width - 40 ) . 'px;}';
374385
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block-cover.is-style-extended-inner-container .wp-block-cover__inner-container {max-width: ' . esc_attr( $ephemeris_layout_width - 40 + 400 ) . 'px;}';
375386
$styles .= 'body.block-editor-page .edit-post-visual-editor .wp-block-cover.is-style-extended-inner-container .wp-block-cover__inner-container .wp-block {max-width: 100%;}';
387+
$styles .= 'body.block-editor-iframe__body .block-editor-block-list__layout .wp-block-cover.is-style-extended-inner-container .wp-block-cover__inner-container .wp-block {max-width: 100%;}';
376388

377-
// Increase the size of the Modal Popup for the Classic Block
378-
// $styles .= 'body.block-editor-page .block-editor-freeform-modal .components-modal__frame {width: ' . esc_attr( $ephemeris_layout_width - 40 ) . 'px;}';
379-
380389
// Output our styles into the <head> whenever our block styles are enqueued
381390
wp_add_inline_style( 'ephemeris-blocks-style', $styles );
382391
}
@@ -444,7 +453,7 @@ function ephemeris_customize_controls_enqueue_scripts() {
444453

445454
// Register and enqueue our icon font
446455
// We're using the awesome Font Awesome icon font. https://fontawesome.com
447-
wp_enqueue_style( 'font-awesome-6', trailingslashit( get_template_directory_uri() ) . 'css/fontawesome-all.min.css', array(), '6.4.0', 'all' );
456+
wp_enqueue_style( 'font-awesome-6', trailingslashit( get_template_directory_uri() ) . 'css/fontawesome-all.min.css', array(), '6.6.0', 'all' );
448457

449458
if( ephemeris_is_plugin_active( 'woocommerce' ) ) {
450459
$shop_page_url = wc_get_page_permalink( 'shop' );
@@ -711,6 +720,30 @@ function ephemeris_fonts_url() {
711720
}
712721
}
713722

723+
/**
724+
* Get the container grid widths for all the major theme sections (i.e. announcement bar, header, body content, footer credits)
725+
* Note: The footer widths for the footer widgets are automatically calculated based on the numbmer of widgets in use
726+
*
727+
* @since Ephemeris 1.5.2
728+
*
729+
* @return array
730+
*/
731+
if ( ! function_exists( 'ephemeris_get_container_widths' ) ) {
732+
function ephemeris_get_container_widths() {
733+
$container_width_defaults = array(
734+
'ephemeris_announcement_bar_width' => 100,
735+
'ephemeris_header_site_title_width' => 40,
736+
'ephemeris_header_nav_width' => 60,
737+
'ephemeris_body_main_content_width' => 75,
738+
'ephemeris_body_sidebar_content_width' => 25,
739+
'ephemeris_body_fullwidth_content_width' => 100,
740+
'ephemeris_footer_credits_width' => 100,
741+
);
742+
743+
return apply_filters( 'ephemeris_container_width_defaults', $container_width_defaults );
744+
}
745+
}
746+
714747
/**
715748
* Register widgetized areas
716749
*
@@ -1662,6 +1695,7 @@ function ephemeris_generate_social_urls() {
16621695
array( 'url' => 'artstation.com', 'icon' => 'fab fa-artstation', 'title' => sprintf( __( 'Follow %s on ArtStation', 'ephemeris' ), $plurality ), 'class' => 'artstation' ),
16631696
array( 'url' => 'behance.net', 'icon' => 'fab fa-behance', 'title' => sprintf( __( 'Follow %s on Behance', 'ephemeris' ), $plurality ), 'class' => 'behance' ),
16641697
array( 'url' => 'bitbucket.org', 'icon' => 'fab fa-bitbucket', 'title' => sprintf( __( 'Fork %s on Bitbucket', 'ephemeris' ), $plurality ), 'class' => 'bitbucket' ),
1698+
array( 'url' => 'bsky.app', 'icon' => 'fab fa-bluesky', 'title' => sprintf( __( 'Follow %s on Bluesky', 'ephemeris' ), $plurality ), 'class' => 'bluesky' ),
16651699
array( 'url' => 'codepen.io', 'icon' => 'fab fa-codepen', 'title' => sprintf( __( 'Follow %s on CodePen', 'ephemeris' ), $plurality ), 'class' => 'codepen' ),
16661700
array( 'url' => 'deviantart.com', 'icon' => 'fab fa-deviantart', 'title' => sprintf( __( 'Watch %s on DeviantArt', 'ephemeris' ), $plurality ), 'class' => 'deviantart' ),
16671701
array( 'url' => 'discord.gg', 'icon' => 'fab fa-discord', 'title' => sprintf( __( 'Join %s on Discord', 'ephemeris' ), $plurality ), 'class' => 'discord' ),
@@ -1675,12 +1709,14 @@ function ephemeris_generate_social_urls() {
16751709
array( 'url' => 'instagram.com', 'icon' => 'fab fa-instagram', 'title' => sprintf( __( 'Follow %s on Instagram', 'ephemeris' ), $plurality ), 'class' => 'instagram' ),
16761710
array( 'url' => 'kickstarter.com', 'icon' => 'fab fa-kickstarter-k', 'title' => sprintf( __( 'Back %s on Kickstarter', 'ephemeris' ), $plurality ), 'class' => 'kickstarter' ),
16771711
array( 'url' => 'last.fm', 'icon' => 'fab fa-lastfm', 'title' => sprintf( __( 'Follow %s on Last.fm', 'ephemeris' ), $plurality ), 'class' => 'lastfm' ),
1712+
array( 'url' => 'letterboxd.com', 'icon' => 'fab fa-letterboxd', 'title' => sprintf( __( 'Follow %s on Letterboxd', 'ephemeris' ), $plurality ), 'class' => 'letterboxd' ),
16781713
array( 'url' => 'linkedin.com', 'icon' => 'fab fa-linkedin-in', 'title' => sprintf( __( 'Connect with %s on LinkedIn', 'ephemeris' ), $plurality ), 'class' => 'linkedin' ),
16791714
array( 'url' => 'mastodon.social', 'icon' => 'fab fa-mastodon', 'title' => sprintf( __( 'Follow %s on Mastodon', 'ephemeris' ), $plurality ), 'class' => 'mastodon' ),
16801715
array( 'url' => 'mastodon.art', 'icon' => 'fab fa-mastodon', 'title' => sprintf( __( 'Follow %s on Mastodon', 'ephemeris' ), $plurality ), 'class' => 'mastodon' ),
16811716
array( 'url' => 'medium.com', 'icon' => 'fab fa-medium-m', 'title' => sprintf( __( 'Follow %s on Medium', 'ephemeris' ), $plurality ), 'class' => 'medium' ),
16821717
array( 'url' => 'patreon.com', 'icon' => 'fab fa-patreon', 'title' => sprintf( __( 'Support %s on Patreon', 'ephemeris' ), $plurality ), 'class' => 'patreon' ),
16831718
array( 'url' => 'pinterest.com', 'icon' => 'fab fa-pinterest-p', 'title' => sprintf( __( 'Follow %s on Pinterest', 'ephemeris' ), $plurality ), 'class' => 'pinterest' ),
1719+
array( 'url' => 'pixiv.net', 'icon' => 'fab fa-pixiv', 'title' => sprintf( __( 'Follow %s on Pixiv', 'ephemeris' ), $plurality ), 'class' => 'pixiv' ),
16841720
array( 'url' => 'quora.com', 'icon' => 'fab fa-quora', 'title' => sprintf( __( 'Follow %s on Quora', 'ephemeris' ), $plurality ), 'class' => 'Quora' ),
16851721
array( 'url' => 'reddit.com', 'icon' => 'fab fa-reddit-alien', 'title' => sprintf( __( 'Join %s on Reddit', 'ephemeris' ), $plurality ), 'class' => 'reddit' ),
16861722
array( 'url' => 'slack.com', 'icon' => 'fab fa-slack-hash', 'title' => sprintf( __( 'Join %s on Slack', 'ephemeris' ), $plurality ), 'class' => 'slack.' ),
@@ -1691,6 +1727,7 @@ function ephemeris_generate_social_urls() {
16911727
array( 'url' => 'stackoverflow.com', 'icon' => 'fab fa-stack-overflow', 'title' => sprintf( __( 'Join %s on Stack Overflow', 'ephemeris' ), $plurality ), 'class' => 'stackoverflow' ),
16921728
array( 'url' => 'steamcommunity.com', 'icon' => 'fab fa-steam', 'title' => sprintf( __( 'Follow %s on Steam', 'ephemeris' ), $plurality ), 'class' => 'steam' ),
16931729
array( 'url' => 't.me', 'icon' => 'fab fa-telegram', 'title' => sprintf( __( 'Chat with %s on Telegram', 'ephemeris' ), $plurality ), 'class' => 'Telegram' ),
1730+
array( 'url' => 'threads.net', 'icon' => 'fab fa-threads', 'title' => sprintf( __( 'Follow %s on Threads', 'ephemeris' ), $plurality ), 'class' => 'threads' ),
16941731
array( 'url' => 'tiktok.com', 'icon' => 'fab fa-tiktok', 'title' => sprintf( __( 'Follow %s on TikTok', 'ephemeris' ), $plurality ), 'class' => 'tiktok' ),
16951732
array( 'url' => 'tumblr.com', 'icon' => 'fab fa-tumblr', 'title' => sprintf( __( 'Follow %s on Tumblr', 'ephemeris' ), $plurality ), 'class' => 'tumblr' ),
16961733
array( 'url' => 'twitch.tv', 'icon' => 'fab fa-twitch', 'title' => sprintf( __( 'Follow %s on Twitch', 'ephemeris' ), $plurality ), 'class' => 'twitch' ),

0 commit comments

Comments
 (0)