Created
June 7, 2019 03:58
-
-
Save seothemes/7bcd6a921eb3348861df0413eaf96c37 to your computer and use it in GitHub Desktop.
Add Genesis tab to plugins install screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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