Automattic / gutenberg-ramp

Control conditions under which Gutenberg loads - either from your theme code or from a UI
https://wordpress.org/plugins/gutenberg-ramp/
76 stars 15 forks source link

Code clean-up and style improvements #49

Closed pyronaur closed 6 years ago

pyronaur commented 6 years ago

I jumbled a few things together in this PR that I've been wanting to do for a while now:

  1. Improved whitespace in function calls, around functions, etc.
  2. Renamed $RFG to $gutenberg_ramp
  3. Added / Updated / Clarified comments throughout the code
  4. Removing Gutenberg filters now with gutenberg_ramp_remove_dashboard_links function instead of an anonymous function. Anonymous functions shouldn't be used with hooks for extensibility.
  5. Removed unused variable $criteria in gutenberg_ramp_load_gutenberg
  6. Refactored boolean transformation
  7. Moved filters that are relevant only to the Gutenberg_Ramp class to the Gutenberg_Ramp class constructor to keep things organized. Otherwise, the gutenberg-ramp.php file would become cluttered and disorganized by containing core Gutenberg Ramp functionality and tweaks/hacks that are aimed at compatibilities or other Gutenberg Ramp functionality (like the UI).