From 6038d78c06535c4bdfc6a64205d2cb40fdb3360f Mon Sep 17 00:00:00 2001 From: Rob Knight Date: Fri, 15 Dec 2023 10:52:38 -0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Add=20"singular()"=20?= =?UTF-8?q?to=20condition=20for=20filtering=20author=20blocks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index eed571b0..202f8d40 100644 --- a/functions.php +++ b/functions.php @@ -196,7 +196,7 @@ function ucsc_adjust_structure( $block_content = '', $block = array() ) { */ function ucsc_post_author_link( $block_content = '', $block = array() ) { // Check for single post; use `global $post` to access data outide the Loop. - if ( is_single() ) { + if ( is_singular() ) { if ( isset( $block['blockName'] ) && 'core/post-author' === $block['blockName'] ) { if ( function_exists( 'coauthors_posts_links' ) ) { $block_content = coauthors_posts_links( null, null, null, null, false ); @@ -251,7 +251,7 @@ function ucsc_breadcrumbs_constructor() { 'labels' => $labels, 'show_on_front' => true, 'show_trail_end' => false, - 'container_class'=> 'ucsc-page-header__breadcrumbs alignwide' + 'container_class'=> 'ucsc-page-header__breadcrumbs' ); return Hybrid\Breadcrumbs\Trail::render( $args ); } From ee19944f09d0a88a037e76a045b175652c0456c1 Mon Sep 17 00:00:00 2001 From: Rob Knight Date: Fri, 15 Dec 2023 11:08:12 -0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=F0=9F=9A=91=EF=B8=8F=20Support=20f?= =?UTF-8?q?or=20coauthors=20in=20query=20loops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions.php b/functions.php index 202f8d40..e527c35e 100644 --- a/functions.php +++ b/functions.php @@ -202,6 +202,11 @@ function ucsc_post_author_link( $block_content = '', $block = array() ) { $block_content = coauthors_posts_links( null, null, null, null, false ); } } + if ( isset( $block['blockName'] ) && 'core/post-author-name' === $block['blockName'] ) { + if ( function_exists( 'coauthors' ) ) { + $block_content = coauthors( null, null, null, null, false ); + } + } } return $block_content; } From d8e569b4a3037c34bd34783a78f1ccb6c5d028f2 Mon Sep 17 00:00:00 2001 From: Rob Knight Date: Tue, 19 Dec 2023 16:10:44 -0800 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20=E2=9C=A8=20CoAuthors=20Plus=20?= =?UTF-8?q?works=20with=20"author=20name"=20block=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Other post author blocks will be integrated later Some "author name" UI settings will not work when Coauthors Plus is turned on. --- functions.php | 9 ++------- templates/single.html | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index e527c35e..2aaffd29 100644 --- a/functions.php +++ b/functions.php @@ -197,14 +197,9 @@ function ucsc_adjust_structure( $block_content = '', $block = array() ) { function ucsc_post_author_link( $block_content = '', $block = array() ) { // Check for single post; use `global $post` to access data outide the Loop. if ( is_singular() ) { - if ( isset( $block['blockName'] ) && 'core/post-author' === $block['blockName'] ) { - if ( function_exists( 'coauthors_posts_links' ) ) { - $block_content = coauthors_posts_links( null, null, null, null, false ); - } - } if ( isset( $block['blockName'] ) && 'core/post-author-name' === $block['blockName'] ) { - if ( function_exists( 'coauthors' ) ) { - $block_content = coauthors( null, null, null, null, false ); + if ( function_exists( 'coauthors_posts_links' ) ) { + $block_content = coauthors_posts_links( null, null, null, null, false ); } } } diff --git a/templates/single.html b/templates/single.html index 2e866299..76bfdf46 100644 --- a/templates/single.html +++ b/templates/single.html @@ -9,7 +9,7 @@
- +