Skip to content

Returns empty string if null value is passed for gmt_date#4776

Closed
adi3890 wants to merge 3 commits intoWordPress:trunkfrom
adi3890:fix-php8-warning-gmt_offset-value
Closed

Returns empty string if null value is passed for gmt_date#4776
adi3890 wants to merge 3 commits intoWordPress:trunkfrom
adi3890:fix-php8-warning-gmt_offset-value

Conversation

@adi3890
Copy link
Copy Markdown

@adi3890 adi3890 commented Jul 2, 2023

Adding a check to verify data type
if $value is_string returns $value, or else returns empty string.
This prevents deprecation notice and also saves data as empty string as saved now.

Trac ticket: https://core.trac.wordpress.org/ticket/57728


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@adi3890 adi3890 changed the title returns empty string in value value is passed Returns empty string in null value is passed for gmt_date Jul 2, 2023
@adi3890 adi3890 changed the title Returns empty string in null value is passed for gmt_date Returns empty string if null value is passed for gmt_date Jul 2, 2023
@SergeyBiryukov
Copy link
Copy Markdown
Member

Thanks for the PR! Merged in r56132.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants