ÿØÿà JFIF    ÿÛ „ !.%+&8&+/1555$;@;4?.451 4,$,44444444444414444444444444444444444444444444444444ÿÀ  á á" ÿÄ     ÿÄ ?    !1AQaq"2‘¡±ÁðBRbrÑá#‚’¢²3S CñÿÄ   ÿÄ !    !1QAa‘2ÿÚ   ? 5˜Z¯V¦cø)›t/? z¨±>Õ5€¶‹Á¤·¼z¼Ü¬+ñ®v¤¨_ˆR­BFn©—˜ý®ç̝P8gýt·ÉSTŦˆìät?þé¼íìN/Þa)ì–í6ô… Ï¿øÃj´¿KÇü]ÿ ªô¹-eKànëÕHTx}ýSÜ›ÿ ”7Ø×&µ<¦  ¥ÑO¶[Ù¯ä¨ÞÃÿ PZ-¬;#õ|•oaÿ ©CìÞz3˜öː/¤­ñTûIØ}š^ mÓ%ªxˆ¥ÉŸu=Z+ISe¿45™¼u;ú&WØ÷€æßQ™®{|íx*TC“#ZŠìZ§²‹ 6pv…³¿¡äª*áZÐ%ÒOáˆo"x«OHk w±æ+¬V(kMúŸ5Vö«$ ÁrÏbàb57/luR ¸ÑÛj Òµì`Мq­û žICÀÊ•©4€Âcà¨Ï€O´<èÐ:›ù(Ë^L8þ‘ÍÌ#¸Ð_Ì©ÙK(Öz 4¬û+¸;ü’V’84‘¬ÃŽ:[â‡ÔÌáõp¢~§ªlæ£ö{®G>J¼"°‡7¯ÆÉèßû ‹É‹§ÁòÃýâßî ^ƾÙõ‹×óH#«LP½ïX=xÑÍ$|W?•~• îëÔ©ª‹ {ÝT…Kÿ ”hûâá)J*ö˜–ÔU;iÇ€/ ÆþjóZ\ýwØ=Ìm ºèËL9 ýèÆð/¨’¥öo=nË.%Îì ŽÕ¯È|{Oj²ƒE6e/ßdÄõ²Ìâ1O®ò×TsəԸhOMýíMˆ¿¼H˜l²,7Â¥#MF/Úf°Ö½± ¸–dr‹NýÊ íjqx{œÉ ä-È ¦ øÄër¨q°ð †nцýÑÄÆ’mä…n<0È™;ÁÝá¯ÁZƒ7FÀmì­ É&9ˆîéi¶ùN§Y• ÃZãAâ?•‡©‰ , ó¾IŸŠc1 4â&y­&pŠ­6;M À 0¹qç»p.á …ŸÅáK@%6·y6ƒ‰3?”úºŽ‰éX5ªPT §µ!=Mž«Ú½‹ÅgÂSâÉaþÓoö–¯ÁÔìR>5éÿ üs¶ÆUcÌ kÇR ]ÿ ù¬¼«VŽ;Â|‡~¢¦”ÏŰæ {L™Õ°Óv¹ò¸írޡעCÃ!íVÕ {¶»sŒNPg/ "uÕbkm²“$ďå¿é¹§°½æz¯6 †s¿!s–wÚÝ“™Œ °.ûj>·+™Òa…©Œ&rÝÎtÛë긪Ît’LAVp%c Úý[ÄzJ¾ÇàXXç@˜ó<êL]·T˜¾¥1Ó©V‡g´æ½¦Ý@¹óø!_@´ÞâSÁ —S3™•& ]@JHÚý©ZŽ €×æÔr»Áf!‡yÞ4Mv*èÓã_{‘åóUuљØ«Oïé*®EvÑ Œ÷‡U \"㪒ÍK+À 4“M¡ï:0¥5í!'<@î´”>Ç»&Z–ïCCV˜Ì5Šo&îhè.žû |ÓK©h$s6KìŒëã)¹hI¦GïOåóI;ììü#É$Š0…Ææ¥TØ.5­¾gn´ “ÂÖ\:hœ89G)J@„}œ:’Ò{/Š"¦_Æ×7Æ3VÇŠÊa]ÚŒÙ€Ä–=®uÁßâACZƒ§§£ Qnâ:«,×{tyø¬iÛcœÜÄ€H½ÄÍCk´÷šß .W'b¤Íåh]÷€=,Žv×cÚEÚHXJX¶îo¨FÒtèöŸ>ªª6[J®Fµ£sGÁeqõfe\íjÒÐïÄÐGˆe1Ø‹.Ø”‘Ëuø Y­ˆÜ ŽG|zùªüMpDnQWÄ”%JŠ™)â*p@Örš«ÕT2Ð%ˆG#ª„ ·¤!°ŸOTÂT¸aÚ%4&h™LµšØüÐ.F¿²ÐÞ_Ç‚¾ÅÃaÜ÷09Æ q€öy˜v‡85õN÷]¬äѼóS{°_MެúÔ#°Ç¸0åÞè2ëôPcvÆw9®ií1Ä8F™˜à‰´+‰Ik1òÝ7“Ñ×ÒsÝ\x‚h`ÞÑ`ó"|µEcý£n˜h`}GÞ !±ù²Ápü²ß6 0ïi󜵩SÈÇ7˜-ÕURO˜¦´f$ªž-Í6(œ}<„ éc øs]ŽŽ„*—¾ ìdŽ„)méª\¿êÎIg¾ØÞ~I#C/¼¼´EÁÈŽi8“©õådô·>euä ƒ'Ê×लR1ÉJE1ÐAát`t;ÇР%Ý<‡¥„ÍÆ`×Oyó)õiI€ñQaŸ4Ûù\áàaÃÔ¹HÃu¹*k€¦<„e S‡&õÏ B!ŽhüÞ`yj}mªf×\¿ Ç~æ­9‡û\՞Ǖg²1Žû5V7 !àöšm° c`ܬøÇìµÒ'P"?…´Ö,"§^•õލsÔ)6˜sæéÍR¼ ò|Sl”‹7 nPW Gòú÷½§O¯‡„l¡kSÞŒr½PÊ@æ¢pŽ-mÿ #Ÿ˜Àº¶Áä¦;ïÔæ$1££`“Õ>„—·ž)ßð³ñ#Ï Ô$¶œ‰ÊE‹À;÷º ¯«P:Ñ”8–IÊtpÞ3ª“>ê“þës4ò2OÏÕ­±zô†Õ§‰.÷ä¸;¿˜“'œ›žª}«Œ{ª±Ì 9ÔóÞÕ‡0 $íWV3Üì¬ —@kÝ4@¿r¼±½¬™›?øØæ´'Áé®CË3-g$˜ö‡×auÚi´Žp/êÛ æF›Ú2v‹ã¿¿,nB1̨ƃqÞa5͝@&Æû“él÷ \C²½UÍc ¯k×¢U ÖéQå™—-r wô ÞÏ<Ò=&=ÿ Ôê Òêˈt,i—;LîÜ á¸*ÚÃ1$êL•LÍ <É)ýÐà’ ;F™{ƒ™˜€&'}‚ãÄK`¡ÞT@I;®žZóè‚s’7®°›+§O­Åq©é»²9<Ô J ¼9O’HL»Ùïì¸rk¼Ž_ý‘TŸu[²ßÚŒ·ü÷B%¯E ŸÔX5êO´ Ç•€’I0 ÉJX` ñ¹õ%;µŸD‘«´€àwÒ™U ûئžÖö\×®×´8 ½‡ºÐÆÓ§?Àkmœ=;d5*@-ì0F Rªýš[Ü6âö̃ڸr*KA9· u*µæ£?U¸Âêí†8@¦X4 e-ò„0s{ HâUpU?¼mñRa°®a%Ð'tÉ×’\¾ÊÉ]t›h>·(Ë@R¼¡Ãt h}’O÷au<+nT…Ö…MӐ??Óe95 q>í/;&JSû °¯ÊéÞ øƒ*Ã2½Ài&:nôUl=¾¿5eˆ3”ñc|Ú2V”>„»&eE;«ÚäC p¢Û úy 9š[ŒÌx¼擼A&DåÒ¯ˆ¤ÀÌ;"˜ ÏQä¸åhÊ}Ûq«Û0WžÒ|»€ø®öCm5•\ÇÀ§Pe3£]0ÃàLDÉ‰1øªxjgwT‚÷¿LΨK‹›ùs—xˆÜ±µ kæ¸f‰‰ÜGk/LÛØ6d9ò¶ùA{ƒA3š/¬D¬khÓk‰`˜"㯒r¿±Óã jx‡°e}<Ñø\3y:'À•/h½Í€Ç4~g ?Û(¼]v‘ªlKÎâ~?O‚W%{Ì:“'©úNq¾›úo(X’¥¯ˆ nFê{Ç€ü?º'ë ø‹ì Þ09ŒÌç9Æ —ËC`j@ÓÄ(+a‹un¸#ÂꟋ{K`‘ÑÍÍ'à´»/Û,KW;Þ4²þð ï Nm|~fGÏ(…³Ã)«1ö­Õ ¥‡¨©ƒÃ™ü-s=à=U66Ï«Ýc蓦W¹íž®›nÔ%êÇìŒ<#Ü×84ån®Ð ÒåOC` ñânÑs‡¢ç 1õ%Îhì½Ã½® e:ݼUZo™`  ÅZŸŒÊ«ê1ÏÄo$q¹Þ€©ˆhÐÉä¯ñ[!…Ú˜àJ:x2$Íß&PåT£6ç— ‡Í*4Ýšçjÿ ‰É nófÐ ó(L5C•åÆ\rMÒ@ò }y-W}™üýVù—ú¢=Ù”c®‘< M ž ´Phr ¦©TD ‘ù.$´÷O‡‘V2Æò.=IUŒ=ž‡â¬i™aþÓåÙ?òUø'ØÖ•.~* šTŒ!•-×áºTâ®ä#õü'´ eýlYÅÓeÕKÂrT"CÚ@u!Óxƒ{š3€}1¿(r}%«nËamjÑ%ÑNEò v ˜à  σöK³,*º.àzù¨™Ó ÚçâU¦*¿ 9{%Ö¹ njûdaXöb) kÛÆ±ûÓ\°M7ˆÂ=û›ç¿Ã‚­V»Cg–8ÙêE- j)k$º`Ã-ùEýeBÆÇ]c¡°ñty&Òd0nõ'¡W+ƒ*|–øµFa\GQªEAÔp5\Ǽ·¼Ç8·õ -â§Ú[ ‡ uZeÖ 3}×d'+¹:ð+K†Û®s!Ï$úe€<Û”x)1»a­¡LC]¸µík…ÚàA»AYº{†ªS[¦5HÒ7ù --,ísòDØ€èk ÞÀîÜ ò@â( ËNˆë›4ô½•/¦o‡€Û7 ê•ÆêòðÜy'Án½µ á˜ݦ ndeo…[ì¶Ê,¥R³Ä=À±—–ß;£™´ñSâ*g§”ïaið‘Jå~™ÓÞ ß³Õ¢»8x埒²52>AÊb&-÷\7´éÄù€T˜,w;3{ï˜k…à¹ÄqÀ«œ{€\ ˆ¾[´¨јr &Úé„Ívˆ±8†¿]|¬ņ4I×pÞS1ÈÖz‰#Ìv‡G!YNògñ:màTz¢Ý1ô©^O=~ë|5Bã™ç•¼µõ•bÆ@úÕS¬ÈŒ#¬zünrŸ û” Z²•èðV"ÁHÚý©wÝ €7¼Ìu1hÑa3Éä û f$o¿É ™Ú›ÝçnpÒ3äÌ3†Í§,Äï]$‰/pê †«À¼¸e9­Æê_C]žƒ·ý·frÁN«, E=›Çq -‰öŒ:aÏ¿±í&£Í:-} 84‘ÿ eƒQÑeëSsuiA ³g㟥ú£?ÿ ʼn*”“÷aühe:ÊWa@ÒÞk±eØ] F Ô—r.åä˜ @ö¥ªZoÐýYL·¥S²G/‡ñ <~*ZÆ´è>JlòàÛÆ½ÿ 窘ìGN¢:I®KšJp/`íIÁÀõ#Ä-€ö­šµŒoF4|ÆQØÆ@Ì|£Ô…¢À{9˜è½Üó›€ôYÒÎYsið;ís¤€à²ˆ‚4qÉVŒI$ ‰"° æµ8cXGjœˏ¡Aâý•ËÜ¢ûï e·çLx']á"oÅÎê3¯Ç—¹”ó0nå‚âg{Œñ> S´˜îè°g238‚ãköÝfÚd´6Ò€;ò÷±¢™¼›º ¢Æ'¥Ðx'e¬ç ]bÈÆV¢ó‹kýBO ðÊâ$Ÿ!×T 3Mýמ žìٍàÌü‘8÷€àæØ8æ©6‰©L´«…oãpð„~Çk‰!ñ;‹”ÛžÍ àž±z Ÿôû øŸÝužÏ;ÿ #|u6™Þ¬ÚˆÐõA4¶â|ôl|Ê2ŽÇ¤ÝÅÇY.<#Aí.k§hóF‚”Y; M½Ö4hŸ4&›­¿tès´%FìL¥£Ãk‰ÇT¤haÁ¤ÚxfÉ`ÑìË›>i 3t‚:,–+^÷´–{Û–Nxi"x‘Ûg î¨>¥Õ܁ùZH,2Û“:8xÊ¢Çí9.É-Ìâã-=çjwµS˜dütžçwýGòú®®ûº_ˆýx$–¡ãøO EÚÛÏ÷R„×w+3£Á£öUMyR²¹âŒ°š›¸Ñãò9§Ó_Dl+Ùßc›úšGÅÌc†Ž!Ko=¶.‘Îÿ c²(2®V mª.ÿ ¹B›¹å ù„öŸSV>™ü¯$y:G¢Z×àøúdî¹û­·ýÇ´:•c LÍõi_‹ö+ÎæGÊè>OŠ•äž´§Þ{X}¨1ÚTc›»Qþ•êô°t¿OP?eæ~É{5]•ÙR£r5†nZ\ã@ &îJõ ¾àC°þV>fé¥/ü5ñÊIº_é5 ;e­h<@ Ä&æÃëE%;X,ÒãÆÞ`Oò¦kŸm#˜!ÀyÄ¢| óLšò¥Ä` ¶R=|ÈCâh5ò3DˆïF†ðÒ#ÅìÛœ?¸yhBãœí ZxßÎÄhºRK„`Þödvײ™ÀÈÑÒgŒuY w³%†ƒÓzõ ÖÏp‚dH®¦A´ù§»ÓÇMæ~)ˆð‡û:ù&Ä •vGD´À n ݇¼Ö8Fö óáà£~Ë¥x`oK|Ä?fxiØü%pìR>éò+Û±éÎ>núlFŤ'tq8LZÏvÃ?„¡ß±È⽆¯³íü@x|PöUäèØã¡ð‚ŒAìÏ"vÍwóŸÍ{ ý0.z È•Ö{,N¡£¡ŸKÕÙž>Ýœþ ÍÀ°<×EA!Å‚D™IúOÍ¡>ôG}Â` ÍßkÜL™Ž Þð™ {IøF²¹òQ3&!ÃÂÞz.d&Ï-sH¸,Ôõ˜ŽP€ 77ˆÝ¼ÊëÜw =cÕ Ú,ØÐ5ÎYÐ)ì´öœgŒ[¤ßv㙑8心>h]§µháYš£²ºÑ.{Ï7Sð•?´~×SÃKýJÛ˜ ™Íäiúu<µX¶1õ^kâçIÑ£sZ4h>j*ÔšD:4­¿_ ÷¸ Õxæÿ ¸?Mù _•­ÊÐ ä ÷ý ÑwL œ­ïnTkÛUÍN©ë:¦fV ¶ÜÔÜMªÅâA½–¿R×TXš-%iTÊT•‡Ù‚JôϐZxWÑè‰f‰òG º ×Õû2aZ7OU3[“×AT–ÞŒ…-‘¤”Ì ì&(ˆ¿­•ƒkï’:ðY¦W‘ Å)“†‘˜³Åtcø˜ñTÂwÚÇ4|üLÇªí–v- qˆèU qPE.†â‘˜µ Æ,ÐÅs]8¾„oúÑ i>ÜxxÈó)ƒ ´æÁâØ$À‰vžŸf$Ž |ãw;ÀÁIJ»b` {¦Ó¤Ú$©YÀ‘n@Óïž«9J¼êG m¤ ܯ¹ÌW4€ÐÒÅÛ‡#褕Ÿn-?í|с¥÷Ú¹¬'´ÞÜ9ÓK `hê£SÄSà?7—Wí_´…óB›»:=Ãïq`<8ñÓŒÑlú2d¬ê³£hÖ[l|$vÝro~'R®‰§°ñmY ͧäP |PUª¹·:3Œ[Û{Xÿ ºâ@‚W–Äé u‚ ¯´*=íή.pûÒdt @G‰¬ s¸ ëÉücr ÞæÑ¨Ê@>¤¢Ö±. Þ'¯°ÌME[YéïĵÂCå½ Ué©Áû'Ê9%eÔðNU”ë‘ÌsD3/®+UI˜9h.WC”빓$#:pz:YÓ ¿xž* ³$Í +$kñAŠ‹†¢ Uê>¸)_š¬÷©ßAÂÔb9ÇU ¯¾á•9¯ÏÏ÷O÷¼¼Fähal1‰3Ì[Ïr•´UCksNÐ] R‘¸¥H+§Šé†c©vÖÞ0iÓ76s†î!§=ß ¼~Ô'°Ãmäoäš³ªøi1úÉ)³yV8 CLÄØÁ‘WYïi€H6ÖÑiámø^ÈY´°Ñ7¥Û*—Ñ©L«Qƒï—Ùrÿ ›£Ð*š¸ˆL©ˆ$ˆ ÷¾D§9È®«qbqC)–ˆïv´çñsÑVT­Ø, <àïºÀO«Jý·õ àfPìð .wFšir´þ’2_Y *Æ€x\« ì€9š@ Ž|F⇥ˆkZ@hÖÄ0t¿-<“‹qµ¾*ZL¤Ú)&BJpÓF5=$„at*Zš$’ÑtdûÝRI1 2މ$€$I$#‰SÞ’Hë¬ï;Á$¡t$’`<(ñÇt)$‡Ð.Êf¢X’Kt=Éé$‚ˆªè¢oÝëòI%Rgcª÷ŠyI%¡‰ÿ !ñ)´õ $¤ Ô’IIGÿÙ 1 ) ) { $breadcrumb_items[] = array( 'label' => __( 'Home' ), 'url' => home_url( '/' ), ); } else { $breadcrumb_items[] = block_core_breadcrumbs_create_item( __( 'Home' ), block_core_breadcrumbs_is_paged() ); } } // Handle home. if ( $is_home ) { // These checks are explicitly nested in order not to execute the `else` branch. if ( $page_for_posts ) { $breadcrumb_items[] = block_core_breadcrumbs_create_item( block_core_breadcrumbs_get_post_title( $page_for_posts ), block_core_breadcrumbs_is_paged() ); } if ( block_core_breadcrumbs_is_paged() ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } } elseif ( $is_front_page ) { // Handle front page. // This check is explicitly nested in order not to execute the `else` branch. // If front page is set to custom page and is paged, add the page number. if ( (int) get_query_var( 'page' ) > 1 ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( 'page' ); } } elseif ( is_search() ) { // Handle search results. $is_paged = block_core_breadcrumbs_is_paged(); /* translators: %s: search query */ $text = sprintf( __( 'Search results for: "%s"' ), wp_trim_words( get_search_query(), 10 ) ); $breadcrumb_items[] = block_core_breadcrumbs_create_item( $text, $is_paged ); // Add the "Page X" as the current page if paginated. if ( $is_paged ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } } elseif ( is_404() ) { // Handle 404 pages. $breadcrumb_items[] = array( 'label' => __( 'Page not found' ), ); } elseif ( is_archive() ) { // Handle archive pages (taxonomy, post type, date, author archives). $archive_breadcrumbs = block_core_breadcrumbs_get_archive_breadcrumbs(); if ( ! empty( $archive_breadcrumbs ) ) { $breadcrumb_items = array_merge( $breadcrumb_items, $archive_breadcrumbs ); } } else { // Handle single post/page breadcrumbs. if ( ! isset( $block->context['postId'] ) || ! isset( $block->context['postType'] ) ) { return ''; } $post_id = $block->context['postId']; $post_type = $block->context['postType']; $post = get_post( $post_id ); if ( ! $post ) { return ''; } // For non-hierarchical post types with parents (e.g., attachments), build trail for the parent. $post_parent = $post->post_parent; $parent_post = null; if ( ! is_post_type_hierarchical( $post_type ) && $post_parent ) { $parent_post = get_post( $post_parent ); if ( $parent_post ) { $post_id = $parent_post->ID; $post_type = $parent_post->post_type; $post_parent = $parent_post->post_parent; } } // Determine breadcrumb type. // Some non-hierarchical post types (e.g., attachments) can have parents. // Use hierarchical breadcrumbs if a parent exists, otherwise use taxonomy breadcrumbs. $show_terms = false; if ( ! is_post_type_hierarchical( $post_type ) && ! $post_parent ) { $show_terms = true; } elseif ( empty( get_object_taxonomies( $post_type, 'objects' ) ) ) { $show_terms = false; } else { $show_terms = $attributes['prefersTaxonomy']; } // Add post type archive link if applicable. $post_type_object = get_post_type_object( $post_type ); $archive_link = get_post_type_archive_link( $post_type ); if ( $archive_link && untrailingslashit( home_url() ) !== untrailingslashit( $archive_link ) ) { $label = $post_type_object->labels->archives; if ( 'post' === $post_type && $page_for_posts ) { $label = block_core_breadcrumbs_get_post_title( $page_for_posts ); } $breadcrumb_items[] = array( 'label' => $label, 'url' => $archive_link, ); } // Build breadcrumb trail based on hierarchical structure or taxonomy terms. if ( ! $show_terms ) { $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_hierarchical_post_type_breadcrumbs( $post_id ) ); } else { $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_terms_breadcrumbs( $post_id, $post_type ) ); } // Add post title: linked when viewing a paginated page, plain text otherwise. $is_paged = (int) get_query_var( 'page' ) > 1 || (int) get_query_var( 'cpage' ) > 1; $title = block_core_breadcrumbs_get_post_title( $post ); if ( $is_paged ) { $breadcrumb_items[] = array( 'label' => $title, 'url' => get_permalink( $post ), 'allow_html' => true, ); $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( (int) get_query_var( 'cpage' ) > 1 ? 'cpage' : 'page' ); } else { $breadcrumb_items[] = array( 'label' => $title, 'allow_html' => true, ); } } // Remove current item if disabled. if ( ! $attributes['showCurrentItem'] && ! empty( $breadcrumb_items ) ) { array_pop( $breadcrumb_items ); } /** * Filters the breadcrumb items array before rendering. * * Allows developers to modify, add, or remove breadcrumb items. * * @since 7.0.0 * * @param array[] $breadcrumb_items { * Array of breadcrumb item data. * * @type string $label The breadcrumb text. * @type string $url Optional. The breadcrumb link URL. * @type bool $allow_html Optional. Whether to allow HTML in the label. * When true, the label will be sanitized with wp_kses_post(), * allowing only safe HTML tags. When false or omitted, all HTML * will be escaped with esc_html(). Default false. * } */ $breadcrumb_items = apply_filters( 'block_core_breadcrumbs_items', $breadcrumb_items ); if ( empty( $breadcrumb_items ) ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => '--separator: "' . addcslashes( $attributes['separator'], '\\"' ) . '";', 'aria-label' => __( 'Breadcrumbs' ), ) ); $breadcrumb_html = sprintf( '', $wrapper_attributes, implode( '', array_map( static function ( $item ) { $label = ! empty( $item['allow_html'] ) ? wp_kses_post( $item['label'] ) : esc_html( $item['label'] ); if ( ! empty( $item['url'] ) ) { return '
  • ' . $label . '
  • '; } return '
  • ' . $label . '
  • '; }, $breadcrumb_items ) ) ); return $breadcrumb_html; } /** * Checks if we're on a paginated view (page 2 or higher). * * @since 7.0.0 * * @return bool True if paged > 1, false otherwise. */ function block_core_breadcrumbs_is_paged() { $paged = (int) get_query_var( 'paged' ); return $paged > 1; } /** * Creates a "Page X" breadcrumb item for paginated views. * * @since 7.0.0 * @param string $query_var Optional. Query variable to get current page number. Default 'paged'. * @return array The "Page X" breadcrumb item data. */ function block_core_breadcrumbs_create_page_number_item( $query_var = 'paged' ) { $paged = (int) get_query_var( $query_var ); if ( 'cpage' === $query_var ) { return array( 'label' => sprintf( /* translators: %s: comment page number */ __( 'Comments Page %s' ), number_format_i18n( $paged ) ), ); } return array( 'label' => sprintf( /* translators: %s: page number */ __( 'Page %s' ), number_format_i18n( $paged ) ), ); } /** * Creates a breadcrumb item that's either a link or current page item. * * When paginated (is_paged is true), creates a link to page 1. * Otherwise, creates a span marked as the current page. * * @since 7.0.0 * * @param string $text The text content. * @param bool $is_paged Whether we're on a paginated view. * * @return array The breadcrumb item data. */ function block_core_breadcrumbs_create_item( $text, $is_paged = false ) { $item = array( 'label' => $text ); if ( $is_paged ) { $item['url'] = get_pagenum_link( 1 ); } return $item; } /** * Gets a post title with fallback for empty titles. * * @since 7.0.0 * * @param int|WP_Post $post_id_or_object The post ID or post object. * * @return string The post title or fallback text. */ function block_core_breadcrumbs_get_post_title( $post_id_or_object ) { $title = get_the_title( $post_id_or_object ); if ( strlen( $title ) === 0 ) { $title = __( '(no title)' ); } return $title; } /** * Generates breadcrumb items from hierarchical post type ancestors. * * @since 7.0.0 * * @param int $post_id The post ID. * * @return array Array of breadcrumb item data. */ function block_core_breadcrumbs_get_hierarchical_post_type_breadcrumbs( $post_id ) { $breadcrumb_items = array(); $ancestors = get_post_ancestors( $post_id ); $ancestors = array_reverse( $ancestors ); foreach ( $ancestors as $ancestor_id ) { $breadcrumb_items[] = array( 'label' => block_core_breadcrumbs_get_post_title( $ancestor_id ), 'url' => get_permalink( $ancestor_id ), 'allow_html' => true, ); } return $breadcrumb_items; } /** * Generates breadcrumb items for hierarchical term ancestors. * * For hierarchical taxonomies, retrieves and formats ancestor terms as breadcrumb links. * * @since 7.0.0 * * @param int $term_id The term ID. * @param string $taxonomy The taxonomy name. * * @return array Array of breadcrumb item data for ancestors. */ function block_core_breadcrumbs_get_term_ancestors_items( $term_id, $taxonomy ) { $breadcrumb_items = array(); // Check if taxonomy is hierarchical and add ancestor term links. if ( is_taxonomy_hierarchical( $taxonomy ) ) { $term_ancestors = get_ancestors( $term_id, $taxonomy, 'taxonomy' ); $term_ancestors = array_reverse( $term_ancestors ); foreach ( $term_ancestors as $ancestor_id ) { $ancestor_term = get_term( $ancestor_id, $taxonomy ); if ( $ancestor_term && ! is_wp_error( $ancestor_term ) ) { $breadcrumb_items[] = array( 'label' => $ancestor_term->name, 'url' => get_term_link( $ancestor_term ), ); } } } return $breadcrumb_items; } /** * Generates breadcrumb items for archive pages. * * Handles taxonomy archives, post type archives, date archives, and author archives. * For hierarchical taxonomies, includes ancestor terms in the breadcrumb trail. * * @since 7.0.0 * * @return array Array of breadcrumb item data. */ function block_core_breadcrumbs_get_archive_breadcrumbs() { $breadcrumb_items = array(); // Date archive (check first since it doesn't have a queried object). if ( is_date() ) { $year = get_query_var( 'year' ); $month = get_query_var( 'monthnum' ); $day = get_query_var( 'day' ); // Fallback to 'm' query var for plain permalinks. // Plain permalinks use ?m=YYYYMMDD format instead of separate query vars. if ( ! $year ) { $m = get_query_var( 'm' ); if ( $m ) { $year = substr( $m, 0, 4 ); $month = substr( $m, 4, 2 ); $day = (int) substr( $m, 6, 2 ); } } $is_paged = block_core_breadcrumbs_is_paged(); if ( $year ) { if ( $month ) { // Year is linked if we have month. $breadcrumb_items[] = array( 'label' => $year, 'url' => get_year_link( $year ), ); if ( $day ) { // Month is linked if we have day. $breadcrumb_items[] = array( 'label' => date_i18n( 'F', mktime( 0, 0, 0, $month, 1, $year ) ), 'url' => get_month_link( $year, $month ), ); // Add day (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $day, $is_paged ); } else { // Add month (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( date_i18n( 'F', mktime( 0, 0, 0, $month, 1, $year ) ), $is_paged ); } } else { // Add year (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $year, $is_paged ); } } // Add pagination breadcrumb if on a paged date archive. if ( $is_paged ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } return $breadcrumb_items; } // For other archive types, we need a queried object. $queried_object = get_queried_object(); if ( ! $queried_object ) { return array(); } $is_paged = block_core_breadcrumbs_is_paged(); // Taxonomy archive (category, tag, custom taxonomy). if ( $queried_object instanceof WP_Term ) { $term = $queried_object; $taxonomy = $term->taxonomy; // Add hierarchical term ancestors if applicable. $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_term_ancestors_items( $term->term_id, $taxonomy ) ); // Add current term (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $term->name, $is_paged ); } elseif ( is_post_type_archive() ) { // Post type archive. $post_type = get_query_var( 'post_type' ); if ( is_array( $post_type ) ) { $post_type = reset( $post_type ); } $post_type_object = get_post_type_object( $post_type ); /** This filter is documented in wp-includes/general-template.php */ $title = apply_filters( 'post_type_archive_title', $post_type_object->labels->archives, $post_type ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound if ( $post_type_object ) { // Add post type (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $title ? $title : $post_type_object->labels->archives, $is_paged ); } } elseif ( is_author() ) { // Author archive. $author = $queried_object; // Add author (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $author->display_name, $is_paged ); } // Add pagination breadcrumb if on a paged archive. if ( $is_paged ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } return $breadcrumb_items; } /** * Generates breadcrumb items from taxonomy terms. * * Finds the first publicly queryable taxonomy with terms assigned to the post * and generates breadcrumb links, including hierarchical term ancestors if applicable. * * @since 7.0.0 * * @param int $post_id The post ID. * @param string $post_type The post type name. * * @return array Array of breadcrumb item data. */ function block_core_breadcrumbs_get_terms_breadcrumbs( $post_id, $post_type ) { $breadcrumb_items = array(); // Get public taxonomies for this post type. $taxonomies = wp_filter_object_list( get_object_taxonomies( $post_type, 'objects' ), array( 'publicly_queryable' => true, 'show_in_rest' => true, ) ); if ( empty( $taxonomies ) ) { return $breadcrumb_items; } /** * Filters breadcrumb settings (taxonomy and term selection) for a post or post type. * * Allows developers to specify which taxonomy and term should be used in the * breadcrumb trail when a post type has multiple taxonomies or when a post is * assigned to multiple terms within a taxonomy. * * @since 7.0.0 * * @param array $settings { * Array of breadcrumb settings. Default empty array. * * @type string $taxonomy Optional. Taxonomy slug to use for breadcrumbs. * The taxonomy must be registered for the post type and have * terms assigned to the post. If not found or has no terms, * fall back to the first available taxonomy with terms. * @type string $term Optional. Term slug to use when the post has multiple terms * in the selected taxonomy. If the term is not found or not * assigned to the post, fall back to the first term. If the * post has only one term, that term is used regardless. * } * @param string $post_type The post type slug. * @param int $post_id The post ID. */ $settings = apply_filters( 'block_core_breadcrumbs_post_type_settings', array(), $post_type, $post_id ); $taxonomy_name = null; $terms = array(); // Try preferred taxonomy first if specified. if ( ! empty( $settings['taxonomy'] ) ) { foreach ( $taxonomies as $taxonomy ) { if ( $taxonomy->name === $settings['taxonomy'] ) { $post_terms = get_the_terms( $post_id, $taxonomy->name ); if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { $taxonomy_name = $taxonomy->name; $terms = $post_terms; } break; } } } // If no preferred taxonomy or it didn't have terms, find the first taxonomy with terms. if ( empty( $terms ) ) { foreach ( $taxonomies as $taxonomy ) { $post_terms = get_the_terms( $post_id, $taxonomy->name ); if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { $taxonomy_name = $taxonomy->name; $terms = $post_terms; break; } } } if ( ! empty( $terms ) ) { // Select which term to use. $term = reset( $terms ); // Try preferred term if specified and post has multiple terms. if ( ! empty( $settings['term'] ) && count( $terms ) > 1 ) { foreach ( $terms as $candidate_term ) { if ( $candidate_term->slug === $settings['term'] ) { $term = $candidate_term; break; } } } // Add hierarchical term ancestors if applicable. $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_term_ancestors_items( $term->term_id, $taxonomy_name ) ); $breadcrumb_items[] = array( 'label' => $term->name, 'url' => get_term_link( $term ), ); } return $breadcrumb_items; } /** * Registers the `core/breadcrumbs` block on the server. * * @since 7.0.0 */ function register_block_core_breadcrumbs() { register_block_type_from_metadata( __DIR__ . '/breadcrumbs', array( 'render_callback' => 'render_block_core_breadcrumbs', ) ); } add_action( 'init', 'register_block_core_breadcrumbs' );