-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3773 add has block functions #8340
Closed
andreilupu
wants to merge
147
commits into
WordPress:master
from
andreilupu:3773-add-has-block-functions
Closed
Changes from 3 commits
Commits
Show all changes
147 commits
Select commit
Hold shift + click to select a range
6602399
Add gutenberg_content_has_block and gutenberg_post_has_block function…
andreilupu aa1e30b
fix phpcs warnings
andreilupu 3c44958
Merge remote-tracking branch 'upstream/master' into 3773-add-has-bloc…
andreilupu e493909
adds export getBlockTypes to be used in react native (#8457)
mzorz 426f484
Fixing the inner block link (#8476)
Ipstenu 3450273
Use @wordpress/compose instead of @wordpress/components (#8537)
Shelob9 3a52e52
Fix Custom HTML error when block is empty (#8556)
Rahmon b941b5e
Fix link to server-side-render component (#8546)
ajitbohra 00884ce
Export the description for server-registered blocks. (#8555)
bradyvercher 3fdaf3d
Docs: Update links to resources moved to packages folder (#8572)
gziolo b83b827
Polish focus and active styles, and do cleanups (#8385)
jasmussen 81bc778
Data Module: Adding The queried data handling into the entities abstr…
youknowriad fb03f0b
DomReady: Fix race condition (#8578)
youknowriad 4fc46e7
Translatable demo content (#8551)
swissspidy efea640
Fix awkward capitalisation in demo post content; fixes #8590. (#8591)
sarahmonster 576872f
API: Replace all withAPIData usage and deprecate the HoC (#8584)
youknowriad c59ca24
Inserter: Try making the inline tokens less important (#8587)
youknowriad ce6643a
Docs: Add @mirucon to CONTRIBUTORS.md
aduth 22ba56f
Reset previous changes, add CSS to do the job instead (#7751)
4fd5c20
Avoid using elt.remove because it's unavailable in ie11 (#8598)
youknowriad 4c28bd0
TinyMCE: Remove container assignment hack (#8465)
aduth f6fd8e5
Add a note about handling blocks with `save` (#8154)
designsimply c1ddfb2
Updated dependencies: `jest`, `npm-package-json-lint` and `read-pkg-u…
gziolo 41ff1f2
DOM: Restore horizontal edge traversal implementation (#8461)
aduth d54396c
swaps out the CSS2 :before with the CSS3 ::before, see #8618 (#8630)
tomjn 98274f0
Fix unrecognised `forwardedRef` prop (#8570)
noisysocks 38378c8
Fix issue with link dialog. (#8646)
jasmussen 1949e3a
Data: Add redux-routine package for synchronous generator flow (#8096)
aduth 8fdf226
Allow plugins to extend the block settings menu (#7895)
nosolosw d5eb120
Let Wordpress make images in gallery block responsive / add srcset at…
fabianpimminger 42b870c
RichText: Removing/merging richtext should only trigger if the select…
youknowriad 7d8e27e
Move embed API call out of block and into data (#6678)
notnownikki d9b3e6f
Redux Routine: Remove fake timers from tests (#8661)
aduth 248fc29
Fix thead colspan bug (#7899)
earnjam 17852d6
Initialize the Autosaves controller, even if revisions are disabled (…
9c75e47
Move CI back to latest WordPress version and bump minimum version to …
notnownikki d74a4fc
Remove REST API shims for code introduced in WP 4.9.8 (#8695)
danielbachhuber 47a69e1
chore: Add test for block mover (#8011) (#8392)
tofumatt e6fb5f6
Add `gutenberg_can_edit_post` filter (#8323)
wpscholar dd81e6b
Update `package-lock.json` (#8700)
ntwb d5c9b4b
Set babel dependencies to fixed version and added core-js2 support (#…
xyfi ea64a0f
Packages: Redux Routine: Add Babel runtime dependency (#8660)
aduth 8cbc988
Add stylelint for SCSS linting (#8647)
noisysocks 5b81cbc
Add components examples in README.md files - Part 2 (#8338)
mmtr ae2d929
Remove unused terms, taxonomies and categories code (#8250)
nosolosw e95026c
Framework: Remove deprecations slated for 3.5 removal (#8687)
aduth bec6a3c
DOM: Abort selection range set on unset range target (#8691)
aduth ac2fa9a
Add a warning when Cloudflare blocks REST API requests (#8640)
pento a529cc3
Add nosolosw as a Contributor (#8705)
nosolosw 0023eea
I18n: Consolidate similar strings (#8708)
dimadin 1b9af37
Try to rewrite e2e tests using jest-puppeter preset (#8301)
gziolo b1196b8
Add "components" docs (#8337)
wpscholar 09dc71c
NUX: Prevent duplicate DotTips from appearing (#8642)
noisysocks ee6060f
Polish the checkbox, update switch documentation (#8588)
jasmussen fb15328
Blocks: Render Button RichText as div (#8451)
aduth 8a8ba2a
onWriting Flow: Remove the provisional block behavior (#8706)
youknowriad 8380680
Bug fixes for full/wide image alignments. (#8464)
8deaf5e
Expand date filter select box width (#8335)
ianbelanger79 315ce7e
Improve pre-publish panel styling (#7879)
sarahmonster fcd0e87
Packages: update api-fetch package documentation (#8730)
vindl 4a78cae
Prevent Travis from running when changes are only made to .md files (…
earnjam abbd908
Additional keyboaard shortcuts for navigateRegions. (#8005)
afercia a0d9405
Manually print inline metabox initialization JavaScript when the `wp-…
desrosj 0298cff
Sort strikethrough after link (#8755)
jasmussen 93b6ac7
Fix 'Prevent duplicate DotTips from appearing' feedback (#8741)
noisysocks 2c0510e
Expose redux-routine to React Native (#8761)
koke 9bacc93
Testing: Trigger E2E test failure on console logging (#8721)
aduth 16d7a9d
Update Lerna to 3.0.0-rc.0 (#8759)
ntwb f02064f
chore(release): publish
ntwb 4f0a643
Publishes unknown-type handler methods for mobile. (#8688)
diegoreymendez 80d2d91
Capital P, dangit (#8772)
dimadin f5617ac
Element: Improve validation for attribute names in serializer (#8775)
gziolo 45e3391
RichText: Fix empty value delete behaviors (#8735)
aduth ed547f3
i18n: Add context to occurrences of 'More' string (#8766)
mcsf b66cc66
Update plugin version to 3.5 (#8784)
aduth 2b39ea9
Localization & Spelling fixes (#8795)
2b4bc5b
Add new keyboard shortcuts for block settings menu (#8279)
talldan 0a21147
Add new keyboard shortcuts help modal (#8316)
talldan 6e62e8a
Pad menus (#8758)
jasmussen dd78fd2
Port heading block to mobile (#8774)
koke 6627001
Audio Block: Avoid scrollbars when shown full-width (#8820)
youknowriad a88f379
Make active pill button look pressed. (#8819)
jasmussen 29ccdcb
Allow access to the WordPress installation if DOCKER_ENV=localwpdev (…
notnownikki ad889ba
Extract Core Blocks to the npm packages folder (#8287)
youknowriad 2d1e3e0
Updates docs for templatelock's `insert` option (#8843)
chrisvanpatten e95528d
Remove TinyMCE shim what was shimmed in WP 4.9.7 (#8832)
danielbachhuber 97dd134
Framework: Remove client-side document title updates (#8831)
aduth b5490a6
Fix deletion of custom block classes (#8232)
johngodley 2b83470
Ensure meta box functions are available in Gutenberg context (#8850)
danielbachhuber dab3fc1
Update Dashicons component. (#8811)
jasmussen fa3e58a
Add a package license checker (#8808)
pento eeda623
Fix unhandled error dialog styling (#8834)
youknowriad 6ce1a6b
Add styles for Spinner component (#8801)
mmtr fd6aa36
URLInput: Pass the the search result object to props.onChange (#8662)
roborourke 216f279
IE11: Fix default appender placeholder (#8837)
youknowriad e1811b2
chore(release): publish
gziolo 4c441d2
Data Module: Correctly handle per_page=-1 in the queried data state (…
youknowriad 35b2fb2
Test: Ensure the full content integration test is run (#8923)
youknowriad 0595c3e
Adds support for matching blocks with diacritics using lodash.deburr …
dsawardekar 28e00cd
PrePublishPanel: suggest tags and postformat (#8235)
nosolosw eeb298e
i18n: Use argument swapping instead of named arguments for string pla…
dimadin 070c26f
[Fix] Make sure Latest Posts alignment class behaviour (#8847)
a5b6126
Remove the workaround for intermittent multiple-tab preview test fail…
notnownikki 751a2fc
Fix paragraph splits on RN (#8915)
SergioEstevao acef68f
Add remove block keyboard shortcut (#8805)
talldan 2de40d8
Add the React Native entrypoint to all runtime packages (#8933)
hypest 8085f2e
Update & flesh out design handbook (#8924)
sarahmonster ca39dc5
Components: Deprecate `withContext` HOC and remove its usage (#8189)
gziolo 8dd93db
Inserter: take into account nested blocks to render the list of inser…
nosolosw fb27a2e
Fix the shortcode block UI in IE11 (#8922)
youknowriad 8762d3e
Tags: Fix the tags input in IE11 (#8918)
youknowriad 710cd9f
[Enhancement] Change color of links in gallery block caption (#8004)
3767009
Fix our custom element serializer in IE11 (#8967)
youknowriad 1759c92
Apply new checkbox CSS to radio buttons and fix border radius (#8835)
chrisvanpatten a6ae71e
Add new Insert Before/After menu items and shortcuts (#8909)
talldan b895f2f
Remove unnecessary comma ( , ) (#8910)
prajapatisagar a7ab5d8
Fix code block style regression. (#9011)
jasmussen dfada03
Refactor template select field to use SelectControl (#8987)
chrisvanpatten a0e0847
Preview: Open new window if prior preview window closed (#8446)
aduth ad5e8d3
Default Block Appender: Remove redundant event handlers (#8714)
aduth 859a8d2
Element: Create dummy context components for type switch (#8998)
aduth 7461f5d
Fix canvas jumb when navigation regions (#9014)
youknowriad d9ef0ed
Bring the preview tab to the front when clicking the preview button (…
youknowriad c72e8b7
toAsyncIterable: remove Promise.resolve call that's already done by t…
jsnajdr aefe0dd
Show drop zone background when file is dragged (#8752)
stoyan0v a234c34
Fix small typo (#9020)
5f84999
Edit Post: Reset active sidebar tab on initial load (#8995)
aduth 8d9b4b3
Add generic has_blocks() function (#8631)
obenland c647b05
Fix crashed block height and inserted order (#8926)
johngodley cbb44b6
Publish button: Avoid changing the label of the "publish" button if a…
youknowriad 0451142
Polish permalink UI and make it responsive (#9010)
jasmussen 966175f
Release font-size for code. (#8914)
jasmussen c3211fa
Let the menu grow (#8756)
jasmussen 837d908
Add styles for Notice component (#8856)
mmtr 3b9d23f
Data: Add RegistryConsumer export (#9042)
coderkevin 2399173
feat: Hide keyboard shortcuts on mobile screens (#9051)
tofumatt cbf3041
IE11: Fix The metaboxes area position (overlapping the content) (#8964)
youknowriad babc9e5
Fix the block styles in IE11 (#8962)
youknowriad f11b1eb
Fix the heading level buttons in IE11 (#8840)
youknowriad 3b33874
feat: Show sidebar in HTML edit mode for blocks (#8969)
tofumatt 63f0cf2
Framework: Remove deprecations slated for 3.6 removal (#8993)
aduth f9e82d0
Custom Block Icons (#8916)
mtias 72da0cd
Introduce strip_dynamic_blocks() for excerpts (#8984)
obenland 5d1df74
Add gutenberg_content_has_block and gutenberg_post_has_block function…
andreilupu ebb478f
fix phpcs warnings
andreilupu 17ae880
Remove prefix and make it consistent with has_blocks
andreilupu 2388042
merge
andreilupu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this magic behavior of
$content = null
. If I passed a$content
variable that was set tonull
, then I'd unexpectedly get the global$post->post_content
.Is there prior art in core that you're basing this on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to be consistent with
gutenberg_post_has_block
but now I'm having second thoughts.gutenberg_post_has_block
is related to$post
and prior in core, I can think ofhas_excerpt
.But in opposition, I think that
gutenberg_content_has_block
should be specific with params and no magic effects.I'll make it required. Do you think that
gutenberg_post_has_block
should keep theglobal $post
default?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't
gutenberg_post_has_block
a new function? I think it should be passed an explicit string instead of any dependency on the$post
object.Taking a step back though, I think we should wait until further progress on #8352 until we spend more time on this. It may be that the parser itself exposes an equivalent method.