Skip to content

Added explanation of isEmpty function; extra line removed #61300

Closed
Lovor01 wants to merge 4 commits intoWordPress:trunkfrom
Lovor01:patch-2
Closed

Added explanation of isEmpty function; extra line removed #61300
Lovor01 wants to merge 4 commits intoWordPress:trunkfrom
Lovor01:patch-2

Conversation

@Lovor01
Copy link
Copy Markdown
Contributor

@Lovor01 Lovor01 commented May 1, 2024

isEmpty method of RichText object was not documented

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 1, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Lovor01 <lovor@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Lovor01 Lovor01 marked this pull request as draft May 1, 2024 23:45
@Lovor01 Lovor01 changed the title Added explanation of isEmpty function; extra line removed May 2, 2024
@Lovor01 Lovor01 changed the title Added explanation of isEmpty function; extra line removed [Type] Developer Documentation May 2, 2024

Helper function to test if supplied variable (e.g. content of RichText) is empty. It tests if value of variable is empty or if variable is an empty array.

### `value: String | Array`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array is deprecated so I wouldn't document it here. Note that it can also be RichTextData

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I had urgent matters and I forgot about this request - it seems to me that it could be RichTextValue, not RichTextData, but only in React native version. Deprecation notice on array is also only specified in React native version. Nevertheless, I agree with your comments.


## RichText.isEmpty

Helper function to test if supplied variable (e.g. content of RichText) is empty. It tests if value of variable is empty or if variable is an empty array.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the first line is explanatory enough?

@ellatrix
Copy link
Copy Markdown
Member

ellatrix commented May 2, 2024

Thank you for the PR! Looks good, just left some comments.

@ellatrix ellatrix added the [Type] Developer Documentation Documentation for developers label May 2, 2024
@Lovor01
Copy link
Copy Markdown
Contributor Author

Lovor01 commented Aug 27, 2024

Thank you for the PR! Looks good, just left some comments.

I think it is fixed now according to suggestions. Sorry for being so late.

@dcalhoun dcalhoun removed their request for review August 28, 2024 18:56
@Lovor01 Lovor01 closed this by deleting the head repository Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Developer Documentation Documentation for developers

2 participants