Skip to content

Instantly share code, notes, and snippets.

@aristath
Last active October 6, 2022 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aristath/50844d4d669670dc781b53f8510d0646 to your computer and use it in GitHub Desktop.
Save aristath/50844d4d669670dc781b53f8510d0646 to your computer and use it in GitHub Desktop.
  • WP_Hooks()->resort_active_iterations() - add documentation
  • WP_Hooks()->remove_filter() - Maybe the $exists var can be removed?
  • WP_Hooks()->remove_all_filters() - Maybe remove the isset() check?
  • WP_Hooks()->apply_filters() - Remove the array_splice condition.
  • WP_Hooks - Change is_null() to null ===

Maybe add a check to prevent the use of is_null() and recommend null ===? - EDIT: These are now opcode-cached in PHP7+, so it doesn't make a lot of sense to refactor them

Check the conditions in get_user_locale(). Something doesn't feel right.

determine_locale() - We don't need to use sanitize_text_field. Maybe switch to sanitize_key. Check the same for other files.

Check if before_last_bar can be deprecated

load_script_textdomain - Check if we can move some code inside the if ($path ) condition. Maybe check all the $relative etc conditions and see if we can make the code a bit more readable.

Is there something faster than md5() we can use?

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