6148ba5ea8b5">77628cf8bf first comm 3 年之前 css-text-orientation.js 77628cf8bf first comm 3 年之前 css-text-spacing.js 77628cf8bf first comm 3 年之前 css-textshadow.js 77628cf8bf first comm 3 年之前 css-touch-action.js 77628cf8bf first comm 3 年之前 css-transitions.js 77628cf8bf first comm 3 年之前 css-unicode-bidi.js 77628cf8bf first comm 3 年之前 css-unset-value.js 77628cf8bf first comm 3 年之前 css-variables.js 77628cf8bf first comm 3 年之前 css-when-else.js 77628cf8bf first comm 3 年之前 css-widows-orphans.js 77628cf8bf first comm 3 年之前 css-width-stretch.js 77628cf8bf first comm 3 年之前 css-writing-mode.js 77628cf8bf first comm 3 年之前 css-zoom.js 77628cf8bf first comm 3 年之前 css3-attr.js 77628cf8bf first comm 3 年之前 css3-boxsizing.js 77628cf8bf first comm 3 年之前 css3-colors.js 77628cf8bf first comm 3 年之前 css3-cursors-grab.js 77628cf8bf first comm 3 年之前 css3-cursors-newer.js 77628cf8bf first comm 3 年之前 css3-cursors.js 77628cf8bf first comm 3 年之前 css3-tabsize.js 77628cf8bf first comm 3 年之前 currentcolor.js 77628cf8bf first comm 3 年之前 custom-elements.js 77628cf8bf first comm 3 年之前 custom-elementsv1.js 77628cf8bf first comm 3 年之前 customevent.js 77628cf8bf first comm 3 年之前 datalist.js 77628cf8bf first comm 3 年之前 dataset.js 77628cf8bf first comm 3 年之前 datauri.js 77628cf8bf first comm 3 年之前 date-tolocaledatestring.js 77628cf8bf first comm 3 年之前 declarative-shadow-dom.js 77628cf8bf first comm 3 年之前 decorators.js 77628cf8bf first comm 3 年之前 details.js 77628cf8bf first comm 3 年之前 deviceorientation.js 77628cf8bf first comm 3 年之前 devicepixelratio.js 77628cf8bf first comm 3 年之前 dialog.js 77628cf8bf first comm 3 年之前 dispatchevent.js 77628cf8bf first comm 3 年之前 dnssec.js 77628cf8bf first comm 3 年之前 do-not-track.js 77628cf8bf first comm 3 年之前 document-currentscript.js 77628cf8bf first comm 3 年之前 document-evaluate-xpath.js 77628cf8bf first comm 3 年之前 document-execcommand.js 77628cf8bf first comm 3 年之前 document-policy.js 77628cf8bf first comm 3 年之前 document-scrollingelement.js 77628cf8bf first comm 3 年之前 documenthead.js 77628cf8bf first comm 3 年之前 dom-manip-convenience.js 77628cf8bf first comm 3 年之前 dom-range.js 77628cf8bf first comm 3 年之前 domcontentloaded.js 77628cf8bf first comm 3 年之前 dommatrix.js 77628cf8bf first comm 3 年之前 download.js 77628cf8bf first comm 3 年之前 dragndrop.js 77628cf8bf first comm 3 年之前 element-closest.js 77628cf8bf first comm 3 年之前 element-from-point.js 77628cf8bf first comm 3 年之前 element-scroll-methods.js 77628cf8bf first comm 3 年之前 eme.js 77628cf8bf first comm 3 年之前 eot.js 77628cf8bf first comm 3 年之前 es5.js 77628cf8bf first comm 3 年之前 es6-class.js 77628cf8bf first comm 3 年之前 es6-generators.js 77628cf8bf first comm 3 年之前 es6-module-dynamic-import.js 77628cf8bf first comm 3 年之前 es6-module.js 77628cf8bf first comm 3 年之前 es6-number.js 77628cf8bf first comm 3 年之前 es6-string-includes.js 77628cf8bf first comm 3 年之前 es6.js 77628cf8bf first comm 3 年之前 eventsource.js 77628cf8bf first comm 3 年之前 extended-system-fonts.js 77628cf8bf first comm 3 年之前 feature-policy.js 77628cf8bf first comm 3 年之前 fetch.js 77628cf8bf first comm 3 年之前 fieldset-disabled.js 77628cf8bf first comm 3 年之前 fileapi.js 77628cf8bf first comm 3 年之前 filereader.js 77628cf8bf first comm 3 年之前 filereadersync.js 77628cf8bf first comm 3 年之前 filesystem.js 77628cf8bf first comm 3 年之前 flac.js 77628cf8bf first comm 3 年之前 flexbox-gap.js 77628cf8bf first comm 3 年之前 flexbox.js 77628cf8bf first comm 3 年之前 flow-root.js 77628cf8bf first comm 3 年之前 focusin-focusout-events.js 77628cf8bf first comm 3 年之前 font-family-system-ui.js 77628cf8bf first comm 3 年之前 font-feature.js 77628cf8bf first comm 3 年之前 font-kerning.js 77628cf8bf first comm 3 年之前 font-loading.js 77628cf8bf first comm 3 年之前 font-size-adjust.js 77628cf8bf first comm 3 年之前 font-smooth.js 77628cf8bf first comm 3 年之前 font-unicode-range.js 77628cf8bf first comm 3 年之前 font-variant-alternates.js 77628cf8bf first comm 3 年之前 font-variant-numeric.js 77628cf8bf first comm 3 年之前 fontface.js 77628cf8bf first comm 3 年之前 form-attribute.js 77628cf8bf first comm 3 年之前 form-submit-attributes.js 77628cf8bf first comm 3 年之前 form-validation.js 77628cf8bf first comm 3 年之前 forms.js 77628cf8bf first comm 3 年之前 fullscreen.js 77628cf8bf first comm 3 年之前 gamepad.js 77628cf8bf first comm 3 年之前 geolocation.js 77628cf8bf first comm 3 年之前 getboundingclientrect.js 77628cf8bf first comm 3 年之前 getcomputedstyle.js 77628cf8bf first comm 3 年之前 getelementsbyclassname.js 77628cf8bf first comm 3 年之前 getrandomvalues.js 77628cf8bf first comm 3 年之前 gyroscope.js 77628cf8bf first comm 3 年之前 hardwareconcurrency.js 77628cf8bf first comm 3 年之前 hashchange.js 77628cf8bf first comm 3 年之前 heif.js 77628cf8bf first comm 3 年之前 hevc.js 77628cf8bf first comm 3 年之前 hidden.js 77628cf8bf first comm 3 年之前 high-resolution-time.js 77628cf8bf first comm 3 年之前 history.js 77628cf8bf first comm 3 年之前 html-media-capture.js 77628cf8bf first comm 3 年之前 html5semantic.js 77628cf8bf first comm 3 年之前 http-live-streaming.js 77628cf8bf first comm 3 年之前 http2.js 77628cf8bf first comm 3 年之前 http3.js 77628cf8bf first comm 3 年之前 iframe-sandbox.js 77628cf8bf first comm 3 年之前 iframe-seamless.js 77628cf8bf first comm 3 年之前 iframe-srcdoc.js 77628cf8bf first comm 3 年之前 imagecapture.js 77628cf8bf first comm 3 年之前 ime.js 77628cf8bf first comm 3 年之前 img-naturalwidth-naturalheight.js 77628cf8bf first comm 3 年之前 import-maps.js 77628cf8bf first comm 3 年之前 imports.js 77628cf8bf first comm 3 年之前 indeterminate-checkbox.js 77628cf8bf first comm 3 年之前 indexeddb.js 77628cf8bf first comm 3 年之前 indexeddb2.js 77628cf8bf first comm 3 年之前 inline-block.js 77628cf8bf first comm 3 年之前 innertext.js 77628cf8bf first comm 3 年之前 input-autocomplete-onoff.js 77628cf8bf first comm 3 年之前 input-color.js 77628cf8bf first comm 3 年之前 input-datetime.js 77628cf8bf first comm 3 年之前 input-email-tel-url.js 77628cf8bf first comm 3 年之前 input-event.js 77628cf8bf first comm 3 年之前 input-file-accept.js 77628cf8bf first comm 3 年之前 input-file-directory.js 77628cf8bf first comm 3 年之前 input-file-multiple.js 77628cf8bf first comm 3 年之前 input-inputmode.js 77628cf8bf first comm 3 年之前 input-minlength.js 77628cf8bf first comm 3 年之前 input-number.js 77628cf8bf first comm 3 年之前 input-pattern.js 77628cf8bf first comm 3 年之前 input-placeholder.js 77628cf8bf first comm 3 年之前 input-range.js 77628cf8bf first comm 3 年之前 input-search.js 77628cf8bf first comm 3 年之前 input-selection.js 77628cf8bf first comm 3 年之前 insert-adjacent.js 77628cf8bf first comm 3 年之前 insertadjacenthtml.js 77628cf8bf first comm 3 年之前 internationalization.js 77628cf8bf first comm 3 年之前 intersectionobserver-v2.js 77628cf8bf first comm 3 年之前 intersectionobserver.js 77628cf8bf first comm 3 年之前 intl-pluralrules.js 77628cf8bf first comm 3 年之前 intrinsic-width.js 77628cf8bf first comm 3 年之前 jpeg2000.js 77628cf8bf first comm 3 年之前 jpegxl.js 77628cf8bf first comm 3 年之前 jpegxr.js 77628cf8bf first comm 3 年之前 js-regexp-lookbehind.js 77628cf8bf first comm 3 年之前 json.js 77628cf8bf first comm 3 年之前 justify-content-space-evenly.js 77628cf8bf first comm 3 年之前 kerning-pairs-ligatures.js 77628cf8bf first comm 3 年之前 keyboardevent-charcode.js 77628cf8bf first comm 3 年之前 keyboardevent-code.js 77628cf8bf first comm 3 年之前 keyboardevent-getmodifierstate.js 77628cf8bf first comm 3 年之前 keyboardevent-key.js 77628cf8bf first comm 3 年之前 keyboardevent-location.js 77628cf8bf first comm 3 年之前 keyboardevent-which.js 77628cf8bf first comm 3 年之前 lazyload.js 77628cf8bf first comm 3 年之前 let.js 77628cf8bf first comm 3 年之前 link-icon-png.js 77628cf8bf first comm 3 年之前 link-icon-svg.js 77628cf8bf first comm 3 年之前 link-rel-dns-prefetch.js 77628cf8bf first comm 3 年之前 link-rel-modulepreload.js 77628cf8bf first comm 3 年之前 link-rel-preconnect.js 77628cf8bf first comm 3 年之前 link-rel-prefetch.js 77628cf8bf first comm 3 年之前 link-rel-preload.js 77628cf8bf first comm 3 年之前 link-rel-prerender.js 77628cf8bf first comm 3 年之前 loading-lazy-attr.js 77628cf8bf first comm 3 年之前 localecompare.js 77628cf8bf first comm 3 年之前 magnetometer.js 77628cf8bf first comm 3 年之前 matchesselector.js 77628cf8bf first comm 3 年之前 matchmedia.js 77628cf8bf first comm 3 年之前 mathml.js 77628cf8bf first comm 3 年之前 maxlength.js 77628cf8bf first comm 3 年之前 mdn-css-unicode-bidi-isolate-override.js 77628cf8bf first comm 3 年之前 mdn-css-unicode-bidi-isolate.js 77628cf8bf first comm 3 年之前 mdn-css-unicode-bidi-plaintext.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-color.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-line.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-shorthand.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-style.js 77628cf8bf first comm 3 年之前 media-fragments.js 77628cf8bf first comm 3 年之前 mediacapture-fromelement.js 77628cf8bf first comm 3 年之前 mediarecorder.js 77628cf8bf first comm 3 年之前 mediasource.js 77628cf8bf first comm 3 年之前 menu.js 77628cf8bf first comm 3 年之前 meta-theme-color.js 77628cf8bf first comm 3 年之前 meter.js 77628cf8bf first comm 3 年之前 midi.js 77628cf8bf first comm 3 年之前 minmaxwh.js 77628cf8bf first comm 3 年之前 mp3.js 77628cf8bf first comm 3 年之前 mpeg-dash.js 77628cf8bf first comm 3 年之前 mpeg4.js 77628cf8bf first comm 3 年之前 multibackgrounds.js 77628cf8bf first comm 3 年之前 multicolumn.js 77628cf8bf first comm 3 年之前 mutation-events.js 77628cf8bf first comm 3 年之前 mutationobserver.js 77628cf8bf first comm 3 年之前 namevalue-storage.js 77628cf8bf first comm 3 年之前 native-filesystem-api.js 77628cf8bf first comm 3 年之前 nav-timing.js 77628cf8bf first comm 3 年之前 netinfo.js 77628cf8bf first comm 3 年之前 notifications.js 77628cf8bf first comm 3 年之前 object-entries.js 77628cf8bf first comm 3 年之前 object-fit.js 77628cf8bf first comm 3 年之前 object-observe.js 77628cf8bf first comm 3 年之前 object-values.js 77628cf8bf first comm 3 年之前 objectrtc.js 77628cf8bf first comm 3 年之前 offline-apps.js 77628cf8bf first comm 3 年之前 offscreencanvas.js 77628cf8bf first comm 3 年之前 ogg-vorbis.js 77628cf8bf first comm 3 年之前 ogv.js 77628cf8bf first comm 3 年之前 ol-reversed.js 77628cf8bf first comm 3 年之前 once-event-listener.js 77628cf8bf first comm 3 年之前 online-status.js 77628cf8bf first comm 3 年之前 opus.js 77628cf8bf first comm 3 年之前 orientation-sensor.js 77628cf8bf first comm 3 年之前 outline.js 77628cf8bf first comm 3 年之前 pad-start-end.js 77628cf8bf first comm 3 年之前 page-transition-events.js 77628cf8bf first comm 3 年之前 pagevisibility.js 77628cf8bf first comm 3 年之前 passive-event-listener.js 77628cf8bf first comm 3 年之前 passwordrules.js 77628cf8bf first comm 3 年之前 path2d.js 77628cf8bf first comm 3 年之前 payment-request.js 77628cf8bf first comm 3 年之前 pdf-viewer.js 77628cf8bf first comm 3 年之前 permissions-api.js 77628cf8bf first comm 3 年之前 permissions-policy.js 77628cf8bf first comm 3 年之前 picture-in-picture.js 77628cf8bf first comm 3 年之前 picture.js 77628cf8bf first comm 3 年之前 ping.js 77628cf8bf first comm 3 年之前 png-alpha.js 77628cf8bf first comm 3 年之前 pointer-events.js 77628cf8bf first comm 3 年之前 pointer.js 77628cf8bf first comm 3 年之前 pointerlock.js 77628cf8bf first comm 3 年之前 portals.js 77628cf8bf first comm 3 年之前 prefers-color-scheme.js 77628cf8bf first comm 3 年之前 prefers-reduced-motion.js 77628cf8bf first comm 3 年之前 progress.js 77628cf8bf first comm 3 年之前 promise-finally.js 77628cf8bf first comm 3 年之前 promises.js 77628cf8bf first comm 3 年之前 proximity.js 77628cf8bf first comm 3 年之前 proxy.js 77628cf8bf first comm 3 年之前 publickeypinning.js 77628cf8bf first comm 3 年之前 push-api.js 77628cf8bf first comm 3 年之前 queryselector.js 77628cf8bf first comm 3 年之前 readonly-attr.js 77628cf8bf first comm 3 年之前 referrer-policy.js 77628cf8bf first comm 3 年之前 registerprotocolhandler.js 77628cf8bf first comm 3 年之前 rel-noopener.js 77628cf8bf first comm 3 年之前 rel-noreferrer.js 77628cf8bf first comm 3 年之前 rellist.js 77628cf8bf first comm 3 年之前 rem.js 77628cf8bf first comm 3 年之前 requestanimationframe.js 77628cf8bf first comm 3 年之前 requestidlecallback.js 77628cf8bf first comm 3 年之前 resizeobserver.js 77628cf8bf first comm 3 年之前 resource-timing.js 77628cf8bf first comm 3 年之前 rest-parameters.js 77628cf8bf first comm 3 年之前 rtcpeerconnection.js 77628cf8bf first comm 3 年之前 ruby.js 77628cf8bf first comm 3 年之前 run-in.js 77628cf8bf first comm 3 年之前 same-site-cookie-attribute.js 77628cf8bf first comm 3 年之前 screen-orientation.js 77628cf8bf first comm 3 年之前 script-async.js 77628cf8bf first comm 3 年之前 script-defer.js 77628cf8bf first comm 3 年之前 scrollintoview.js 77628cf8bf first comm 3 年之前 scrollintoviewifneeded.js 77628cf8bf first comm 3 年之前 sdch.js 77628cf8bf first comm 3 年之前 selection-api.js 77628cf8bf first comm 3 年之前 server-timing.js 77628cf8bf first comm 3 年之前 serviceworkers.js 77628cf8bf first comm 3 年之前 setimmediate.js 77628cf8bf first comm 3 年之前 shadowdom.js 77628cf8bf first comm 3 年之前 shadowdomv1.js 77628cf8bf first comm 3 年之前 sharedarraybuffer.js 77628cf8bf first comm 3 年之前 sharedworkers.js 77628cf8bf first comm 3 年之前 sni.js 77628cf8bf first comm 3 年之前 spdy.js 77628cf8bf first comm 3 年之前 speech-recognition.js 77628cf8bf first comm 3 年之前 speech-synthesis.js 77628cf8bf first comm 3 年之前 spellcheck-attribute.js 77628cf8bf first comm 3 年之前 sql-storage.js 77628cf8bf first comm 3 年之前 srcset.js 77628cf8bf first comm 3 年之前 stream.js 77628cf8bf first comm 3 年之前 streams.js 77628cf8bf first comm 3 年之前 stricttransportsecurity.js 77628cf8bf first comm 3 年之前 style-scoped.js 77628cf8bf first comm 3 年之前 subresource-bundling.js 77628cf8bf first comm 3 年之前 subresource-integrity.js 77628cf8bf first comm 3 年之前 svg-css.js 77628cf8bf first comm 3 年之前 svg-filters.js 77628cf8bf first comm 3 年之前 svg-fonts.js 77628cf8bf first comm 3 年之前 svg-fragment.js 77628cf8bf first comm 3 年之前 svg-html.js 77628cf8bf first comm 3 年之前 svg-html5.js 77628cf8bf first comm 3 年之前 svg-img.js 77628cf8bf first comm 3 年之前 svg-smil.js 77628cf8bf first comm 3 年之前 svg.js 77628cf8bf first comm 3 年之前 sxg.js 77628cf8bf first comm 3 年之前 tabindex-attr.js 77628cf8bf first comm 3 年之前 template-literals.js 77628cf8bf first comm 3 年之前 template.js 77628cf8bf first comm 3 年之前 temporal.js 77628cf8bf first comm 3 年之前 testfeat.js 77628cf8bf first comm 3 年之前 text-decoration.js 77628cf8bf first comm 3 年之前 text-emphasis.js 77628cf8bf first comm 3 年之前 text-overflow.js 77628cf8bf first comm 3 年之前 text-size-adjust.js 77628cf8bf first comm 3 年之前 text-stroke.js 77628cf8bf first comm 3 年之前 textcontent.js 77628cf8bf first comm 3 年之前 textencoder.js 77628cf8bf first comm 3 年之前 tls1-1.js 77628cf8bf first comm 3 年之前 tls1-2.js 77628cf8bf first comm 3 年之前 tls1-3.js 77628cf8bf first comm 3 年之前 touch.js 77628cf8bf first comm 3 年之前 transforms2d.js 77628cf8bf first comm 3 年之前 transforms3d.js 77628cf8bf first comm 3 年之前 trusted-types.js 77628cf8bf first comm 3 年之前 ttf.js 77628cf8bf first comm 3 年之前 typedarrays.js 77628cf8bf first comm 3 年之前 u2f.js 77628cf8bf first comm 3 年之前 unhandledrejection.js 77628cf8bf first comm 3 年之前 upgradeinsecurerequests.js 77628cf8bf first comm 3 年之前 url-scroll-to-text-fragment.js 77628cf8bf first comm 3 年之前 url.js 77628cf8bf first comm 3 年之前 urlsearchparams.js 77628cf8bf first comm 3 年之前 use-strict.js 77628cf8bf first comm 3 年之前 user-select-none.js 77628cf8bf first comm 3 年之前 user-timing.js 77628cf8bf first comm 3 年之前 variable-fonts.js 77628cf8bf first comm 3 年之前 vector-effect.js 77628cf8bf first comm 3 年之前 vibration.js 77628cf8bf first comm 3 年之前 video.js 77628cf8bf first comm 3 年之前 videotracks.js 77628cf8bf first comm 3 年之前 viewport-unit-variants.js 77628cf8bf first comm 3 年之前 viewport-units.js 77628cf8bf first comm 3 年之前 wai-aria.js 77628cf8bf first comm 3 年之前 wake-lock.js 77628cf8bf first comm 3 年之前 wasm.js 77628cf8bf first comm 3 年之前 wav.js 77628cf8bf first comm 3 年之前 wbr-element.js 77628cf8bf first comm 3 年之前 web-animation.js 77628cf8bf first comm 3 年之前 web-app-manifest.js 77628cf8bf first comm 3 年之前 web-bluetooth.js 77628cf8bf first comm 3 年之前 web-serial.js 77628cf8bf first comm 3 年之前 web-share.js 77628cf8bf first comm 3 年之前 webauthn.js 77628cf8bf first comm 3 年之前 webcodecs.js 77628cf8bf first comm 3 年之前 webgl.js 77628cf8bf first comm 3 年之前 webgl2.js 77628cf8bf first comm 3 年之前 webgpu.js 77628cf8bf first comm 3 年之前 webhid.js 77628cf8bf first comm 3 年之前 webkit-user-drag.js 77628cf8bf first comm 3 年之前 webm.js 77628cf8bf first comm 3 年之前 webnfc.js 77628cf8bf first comm 3 年之前 webp.js 77628cf8bf first comm 3 年之前 websockets.js 77628cf8bf first comm 3 年之前 webtransport.js 77628cf8bf first comm 3 年之前 webusb.js 77628cf8bf first comm 3 年之前 webvr.js 77628cf8bf first comm 3 年之前 webvtt.js 77628cf8bf first comm 3 年之前 webworkers.js 77628cf8bf first comm 3 年之前 webxr.js 77628cf8bf first comm 3 年之前 will-change.js 77628cf8bf first comm 3 年之前 woff.js 77628cf8bf first comm 3 年之前 woff2.js 77628cf8bf first comm 3 年之前 word-break.js 77628cf8bf first comm 3 年之前 wordwrap.js 77628cf8bf first comm 3 年之前 x-doc-messaging.js 77628cf8bf first comm 3 年之前 x-frame-options.js 77628cf8bf first comm 3 年之前 xhr2.js 77628cf8bf first comm 3 年之前 xhtml.js 77628cf8bf first comm 3 年之前 xhtmlsmil.js 77628cf8bf first comm 3 年之前 xml-serializer.js 77628cf8bf first comm 3 年之前 tum/whitesports - Gogs: Simplico Git Service

No Description

block-patterns.php 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <?php
  2. /**
  3. * Register the block patterns and block patterns categories
  4. *
  5. * @package WordPress
  6. * @since 5.5.0
  7. */
  8. add_theme_support( 'core-block-patterns' );
  9. /**
  10. * Registers the core block patterns and categories.
  11. *
  12. * @since 5.5.0
  13. * @access private
  14. */
  15. function _register_core_block_patterns_and_categories() {
  16. $should_register_core_patterns = get_theme_support( 'core-block-patterns' );
  17. if ( $should_register_core_patterns ) {
  18. $core_block_patterns = array(
  19. 'query-standard-posts',
  20. 'query-medium-posts',
  21. 'query-small-posts',
  22. 'query-grid-posts',
  23. 'query-large-title-posts',
  24. 'query-offset-posts',
  25. 'social-links-shared-background-color',
  26. );
  27. foreach ( $core_block_patterns as $core_block_pattern ) {
  28. register_block_pattern(
  29. 'core/' . $core_block_pattern,
  30. require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php'
  31. );
  32. }
  33. }
  34. register_block_pattern_category( 'buttons', array( 'label' => _x( 'Buttons', 'Block pattern category' ) ) );
  35. register_block_pattern_category( 'columns', array( 'label' => _x( 'Columns', 'Block pattern category' ) ) );
  36. register_block_pattern_category( 'featured', array( 'label' => _x( 'Featured', 'Block pattern category' ) ) );
  37. register_block_pattern_category( 'gallery', array( 'label' => _x( 'Gallery', 'Block pattern category' ) ) );
  38. register_block_pattern_category( 'header', array( 'label' => _x( 'Headers', 'Block pattern category' ) ) );
  39. register_block_pattern_category( 'text', array( 'label' => _x( 'Text', 'Block pattern category' ) ) );
  40. register_block_pattern_category( 'query', array( 'label' => _x( 'Query', 'Block pattern category' ) ) );
  41. }
  42. /**
  43. * Register Core's official patterns from wordpress.org/patterns.
  44. *
  45. * @since 5.8.0
  46. * @since 5.9.0 The $current_screen argument was removed.
  47. *
  48. * @param WP_Screen $deprecated Unused. Formerly the screen that the current request was triggered from.
  49. */
  50. function _load_remote_block_patterns( $deprecated = null ) {
  51. if ( ! empty( $deprecated ) ) {
  52. _deprecated_argument( __FUNCTION__, '5.9.0' );
  53. $current_screen = $deprecated;
  54. if ( ! $current_screen->is_block_editor ) {
  55. return;
  56. }
  57. }
  58. $supports_core_patterns = get_theme_support( 'core-block-patterns' );
  59. /**
  60. * Filter to disable remote block patterns.
  61. *
  62. * @since 5.8.0
  63. *
  64. * @param bool $should_load_remote
  65. */
  66. $should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );
  67. if ( $supports_core_patterns && $should_load_remote ) {
  68. $request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
  69. $core_keyword_id = 11; // 11 is the ID for "core".
  70. $request->set_param( 'keyword', $core_keyword_id );
  71. $response = rest_do_request( $request );
  72. if ( $response->is_error() ) {
  73. return;
  74. }
  75. $patterns = $response->get_data();
  76. foreach ( $patterns as $settings ) {
  77. $pattern_name = 'core/' . sanitize_title( $settings['title'] );
  78. register_block_pattern( $pattern_name, (array) $settings );
  79. }
  80. }
  81. }
  82. /**
  83. * Register `Featured` (category) patterns from wordpress.org/patterns.
  84. *
  85. * @since 5.9.0
  86. */
  87. function _load_remote_featured_patterns() {
  88. $supports_core_patterns = get_theme_support( 'core-block-patterns' );
  89. /** This filter is documented in wp-includes/block-patterns.php */
  90. $should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );
  91. if ( ! $should_load_remote || ! $supports_core_patterns ) {
  92. return;
  93. }
  94. $request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
  95. $featured_cat_id = 26; // This is the `Featured` category id from pattern directory.
  96. $request->set_param( 'category', $featured_cat_id );
  97. $response = rest_do_request( $request );
  98. if ( $response->is_error() ) {
  99. return;
  100. }
  101. $patterns = $response->get_data();
  102. foreach ( $patterns as $pattern ) {
  103. $pattern_name = sanitize_title( $pattern['title'] );
  104. $registry = WP_Block_Patterns_Registry::get_instance();
  105. // Some patterns might be already registered as core patterns with the `core` prefix.
  106. $is_registered = $registry->is_registered( $pattern_name ) || $registry->is_registered( "core/$pattern_name" );
  107. if ( ! $is_registered ) {
  108. register_block_pattern( $pattern_name, (array) $pattern );
  109. }
  110. }
  111. }
  112. /**
  113. * Registers patterns from Pattern Directory provided by a theme's
  114. * `theme.json` file.
  115. *
  116. * @since 6.0.0
  117. * @access private
  118. */
  119. function _register_remote_theme_patterns() {
  120. if ( ! get_theme_support( 'core-block-patterns' ) ) {
  121. return;
  122. }
  123. /** This filter is documented in wp-includes/block-patterns.php */
  124. if ( ! apply_filters( 'should_load_remote_block_patterns', true ) ) {
  125. return;
  126. }
  127. if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
  128. return;
  129. }
  130. $pattern_settings = WP_Theme_JSON_Resolver::get_theme_data()->get_patterns();
  131. if ( empty( $pattern_settings ) ) {
  132. return;
  133. }
  134. $request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
  135. $request['slug'] = $pattern_settings;
  136. $response = rest_do_request( $request );
  137. if ( $response->is_error() ) {
  138. return;
  139. }
  140. $patterns = $response->get_data();
  141. $patterns_registry = WP_Block_Patterns_Registry::get_instance();
  142. foreach ( $patterns as $pattern ) {
  143. $pattern_name = sanitize_title( $pattern['title'] );
  144. // Some patterns might be already registered as core patterns with the `core` prefix.
  145. $is_registered = $patterns_registry->is_registered( $pattern_name ) || $patterns_registry->is_registered( "core/$pattern_name" );
  146. if ( ! $is_registered ) {
  147. register_block_pattern( $pattern_name, (array) $pattern );
  148. }
  149. }
  150. }
  151. /**
  152. * Register any patterns that the active theme may provide under its
  153. * `./patterns/` directory. Each pattern is defined as a PHP file and defines
  154. * its metadata using plugin-style headers. The minimum required definition is:
  155. *
  156. * /**
  157. * * Title: My Pattern
  158. * * Slug: my-theme/my-pattern
  159. * *
  160. *
  161. * The output of the PHP source corresponds to the content of the pattern, e.g.:
  162. *
  163. * <main><p><?php echo "Hello"; ?></p></main>
  164. *
  165. * If applicable, this will collect from both parent and child theme.
  166. *
  167. * Other settable fields include:
  168. *
  169. * - Description
  170. * - Viewport Width
  171. * - Categories (comma-separated values)
  172. * - Keywords (comma-separated values)
  173. * - Block Types (comma-separated values)
  174. * - Inserter (yes/no)
  175. *
  176. * @since 6.0.0
  177. * @access private
  178. */
  179. function _register_theme_block_patterns() {
  180. $default_headers = array(
  181. 'title' => 'Title',
  182. 'slug' => 'Slug',
  183. 'description' => 'Description',
  184. 'viewportWidth' => 'Viewport Width',
  185. 'categories' => 'Categories',
  186. 'keywords' => 'Keywords',
  187. 'blockTypes' => 'Block Types',
  188. 'inserter' => 'Inserter',
  189. );
  190. /*
  191. * Register patterns for the active theme. If the theme is a child theme,
  192. * let it override any patterns from the parent theme that shares the same slug.
  193. */
  194. $themes = array();
  195. $stylesheet = get_stylesheet();
  196. $template = get_template();
  197. if ( $stylesheet !== $template ) {
  198. $themes[] = wp_get_theme( $stylesheet );
  199. }
  200. $themes[] = wp_get_theme( $template );
  201. foreach ( $themes as $theme ) {
  202. $dirpath = $theme->get_stylesheet_directory() . '/patterns/';
  203. if ( ! is_dir( $dirpath ) || ! is_readable( $dirpath ) ) {
  204. continue;
  205. }
  206. if ( file_exists( $dirpath ) ) {
  207. $files = glob( $dirpath . '*.php' );
  208. if ( $files ) {
  209. foreach ( $files as $file ) {
  210. $pattern_data = get_file_data( $file, $default_headers );
  211. if ( empty( $pattern_data['slug'] ) ) {
  212. _doing_it_wrong(
  213. '_register_theme_block_patterns',
  214. sprintf(
  215. /* translators: %s: file name. */
  216. __( 'Could not register file "%s" as a block pattern ("Slug" field missing)' ),
  217. $file
  218. ),
  219. '6.0.0'
  220. );
  221. continue;
  222. }
  223. if ( ! preg_match( '/^[A-z0-9\/_-]+$/', $pattern_data['slug'] ) ) {
  224. _doing_it_wrong(
  225. '_register_theme_block_patterns',
  226. sprintf(
  227. /* translators: %1s: file name; %2s: slug value found. */
  228. __( 'Could not register file "%1$s" as a block pattern (invalid slug "%2$s")' ),
  229. $file,
  230. $pattern_data['slug']
  231. ),
  232. '6.0.0'
  233. );
  234. }
  235. if ( WP_Block_Patterns_Registry::get_instance()->is_registered( $pattern_data['slug'] ) ) {
  236. continue;
  237. }
  238. // Title is a required property.
  239. if ( ! $pattern_data['title'] ) {
  240. _doing_it_wrong(
  241. '_register_theme_block_patterns',
  242. sprintf(
  243. /* translators: %1s: file name; %2s: slug value found. */
  244. __( 'Could not register file "%s" as a block pattern ("Title" field missing)' ),
  245. $file
  246. ),
  247. '6.0.0'
  248. );
  249. continue;
  250. }
  251. // For properties of type array, parse data as comma-separated.
  252. foreach ( array( 'categories', 'keywords', 'blockTypes' ) as $property ) {
  253. if ( ! empty( $pattern_data[ $property ] ) ) {
  254. $pattern_data[ $property ] = array_filter(
  255. preg_split(
  256. '/[\s,]+/',
  257. (string) $pattern_data[ $property ]
  258. )
  259. );
  260. } else {
  261. unset( $pattern_data[ $property ] );
  262. }
  263. }
  264. // Parse properties of type int.
  265. foreach ( array( 'viewportWidth' ) as $property ) {
  266. if ( ! empty( $pattern_data[ $property ] ) ) {
  267. $pattern_data[ $property ] = (int) $pattern_data[ $property ];
  268. } else {
  269. unset( $pattern_data[ $property ] );
  270. }
  271. }
  272. // Parse properties of type bool.
  273. foreach ( array( 'inserter' ) as $property ) {
  274. if ( ! empty( $pattern_data[ $property ] ) ) {
  275. $pattern_data[ $property ] = in_array(
  276. strtolower( $pattern_data[ $property ] ),
  277. array( 'yes', 'true' ),
  278. true
  279. );
  280. } else {
  281. unset( $pattern_data[ $property ] );
  282. }
  283. }
  284. // Translate the pattern metadata.
  285. $text_domain = $theme->get( 'TextDomain' );
  286. //phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction
  287. $pattern_data['title'] = translate_with_gettext_context( $pattern_data['title'], 'Pattern title', $text_domain );
  288. if ( ! empty( $pattern_data['description'] ) ) {
  289. //phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction
  290. $pattern_data['description'] = translate_with_gettext_context( $pattern_data['description'], 'Pattern description', $text_domain );
  291. }
  292. // The actual pattern content is the output of the file.
  293. ob_start();
  294. include $file;
  295. $pattern_data['content'] = ob_get_clean();
  296. if ( ! $pattern_data['content'] ) {
  297. continue;
  298. }
  299. register_block_pattern( $pattern_data['slug'], $pattern_data );
  300. }
  301. }
  302. }
  303. }
  304. }
  305. add_action( 'init', '_register_theme_block_patterns' );