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

Add additional condition to "Available templates" logic #6955

Merged
merged 1 commit into from May 28, 2018

Conversation

Projects
None yet
3 participants
@kallehauge
Contributor

kallehauge commented May 25, 2018

Description

I have made a conditional check for the available template array_merge() so we do not get a template <select> in the post-attributes meta-box with only the default template as an option.

More information about the bug introduced in #6948 can be found here.

How has this been tested?

The change is very isolated and will only have any effect on the page-attributes meta box. I have run manual testing by testing the following scenarios:

  • Make sure we only append the default template logic if the page have any templates (done by using the Twentysixteen theme).
  • Make a child theme of Twentysixteen and add a template.
  • Save / update the post to make sure the value is "saved correctly" (more precisely the lack of a value since the value for the default template is an empty string).

Types of changes

I have corrected a bug introduced in #6948

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
@kallehauge

This comment has been minimized.

Contributor

kallehauge commented May 25, 2018

@danielbachhuber a quick correction for #6948 - but in all honesty: I'm not entirely sure that the way I have done the condition follows the PHP code standards for WordPress. I cannot seem to find if this is good or not (I might just be blind).

@danielbachhuber danielbachhuber added this to the 3.0 milestone May 25, 2018

@danielbachhuber

This comment has been minimized.

Member

danielbachhuber commented May 25, 2018

I'm not entirely sure that the way I have done the condition follows the PHP code standards for WordPress. I cannot seem to find if this is good or not (I might just be blind).

Passes the sniffs locally for me:

image

I think it's fine as-is.

@danielbachhuber

This comment has been minimized.

Member

danielbachhuber commented May 25, 2018

Build failing randomly because of #6956

@gziolo gziolo merged commit a721b57 into WordPress:master May 28, 2018

2 checks passed

codecov/project 46.18% remains the same compared to a5aad35
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kallehauge kallehauge deleted the kallehauge:update/correct-available-template-array branch May 28, 2018

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