Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions experimental/gp-hide-perks-from-plugins-page.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
<?php
/**
* Gravity Perks // Hide Perks from Plugins Page
* https://gravitywiz.com/documentation/
* We're no longer using the experimental folder for experimental snippets. 🚧
* You can now find the snippet here:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gp-hide-perks-from-plugins-page.php
*/
add_filter( 'all_plugins', function( $plugins ) {

if ( ! is_callable( 'get_current_screen' ) || get_current_screen()->id !== 'plugins' ) {
return $plugins;
}

$filtered_plugins = array();

foreach ( $plugins as $slug => $plugin ) {
if ( ! wp_validate_boolean( rgar( $plugin, 'Perk' ) ) ) {
$filtered_plugins[ $slug ] = $plugin;
}
}

return $filtered_plugins;
} );
Loading