Skip to content

Instantly share code, notes, and snippets.

@seothemes
Created June 7, 2019 03:58
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 seothemes/7bcd6a921eb3348861df0413eaf96c37 to your computer and use it in GitHub Desktop.
Save seothemes/7bcd6a921eb3348861df0413eaf96c37 to your computer and use it in GitHub Desktop.
Add Genesis tab to plugins install screen
<?php
add_filter( 'install_plugins_tabs', __NAMESPACE__ . '\genesis_plugins_tab' );
/**
* Add Genesis to plugin tabs.
*
* @since 1.0.0
*
* @param array $tabs Default plugin tabs.
*
* @return array
*/
function genesis_plugins_tab( $tabs ) {
return array_merge( $tabs, [
'genesis' => 'Genesis',
] );
}
add_filter( 'install_plugins_table_api_args_genesis', __NAMESPACE__ . '\genesis_plugin_list_args' );
/**
* Set Genesis tab args.
*
* @since 1.0.0
*
* @param $args
*
* @return mixed
*/
function genesis_plugin_list_args( $args ) {
// Display plugins table on Genesis tab.
add_action( 'install_plugins_genesis', 'display_plugins_table' );
$args['author'] = 'studiopress';
$args['per_page'] = 20;
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment