Skip to content
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

Improve support for environment types and fix description of plugin #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mcaskill
Copy link

Fixed the description of the plugin in the README to indicate that it relies on the value of a DISALLOW_INDEXING constant and not WP_ENV. The latter constant only being used as a reference in an dashboard notice.

Also added support for WP_ENVIRONMENT_TYPE and support for omitting WP_ENV. Proposed behaviour:

  1. Resolve the environment type:
    1. Use the value of the WP_ENV constant if defined and palpable.
    2. Otherwise, use the value of the wp_get_environment_type() function if defined (introduced in WordPress 5.0.0).
    3. Otherwise, use NULL.
  2. Filter the environment type with the following hook:
    • roots/bedrock/disallow_indexing_environment_type
  3. Display the notice:
    1. If the environment type is palpable, display the notice with the filtered environment type.
    2. Otherwise, display a shorter notice that does not reference the environment type.

New behaviour:

1. Resolve the environment type:
	1. Use the value of the `WP_ENV` constant if defined and palpable.
	2. Otherwise, use the value of the `wp_get_environment_type()` function if defined (introduced in WordPress 5.0.0).
	3. Otherwise, use `NULL`.
2. Filter the environment type with the following hook:
	* `roots/bedrock/disallow_indexing_environment_type`
3. Display the notice:
	1. If the environment type is palpable, display the notice with the filtered environment type.
	2. Otherwise, display a shorter notice that does not reference the environment type.
Fixed the description of the plugin to indicate that it relies on the value of a `DISALLOW_INDEXING` constant and not `WP_ENV`. The latter constant only being used as a reference in an dashboard notice.
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.

1 participant