PluginProbe
Catch Gallery / 1.2
Catch Gallery v1.2
trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.5 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 All 27 releases
catch-gallery / inc / our-plugins.php

our-plugins.php in Catch Gallery 1.2, at inc/our-plugins.php

61 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /* Adds Catch Plugins tab in Add Plugin page to show all plugins by Catch Plugins in wordpress.org */
3 if( ! function_exists( 'add_our_plugins_tab' ) ) {
4 function add_our_plugins_tab($tabs) {
5 // Add our filter here
6 $tabs['catchplugins'] = _x( 'Catch Plugins', 'Plugin Installer' );
7
8 return $tabs;
9 }
10 add_filter( 'install_plugins_tabs', 'add_our_plugins_tab', 1 );
11 }
12
13 if( ! function_exists( 'catchplugins' ) ) {
14 function catchplugins() {
15 /* From CORE Start */
16 global $paged, $tab;
17 wp_reset_vars( array( 'tab' ) );
18
19 $defined_class = new WP_Plugin_Install_List_Table();
20 $paged = $defined_class->get_pagenum();
21
22 $per_page = 30;
23 //$installed_plugins = catch_get_installed_plugins();
24
25 $args = array(
26 'page' => $paged,
27 'per_page' => $per_page,
28 'fields' => array(
29 'last_updated' => true,
30 'icons' => true,
31 'active_installs' => true
32 ),
33 // Send the locale and installed plugin slugs to the API so it can provide context-sensitive results.
34 'locale' => get_user_locale(),
35 //'installed_plugins' => array_keys( $installed_plugins ),
36 );
37 /* From CORE End */
38
39 // Add author filter for our plugins
40 $args['author'] = 'catchplugins';
41
42 return $args;
43 }
44 add_filter( "install_plugins_table_api_args_catchplugins", 'catchplugins', 1 );
45 }
46
47 if( ! function_exists( 'cathcplugins_plugins_table' ) ) {
48 add_action( 'install_plugins_catchplugins', 'cathcplugins_plugins_table' );
49 function cathcplugins_plugins_table() {
50 global $wp_list_table;
51 printf(
52 '<p class="catch-plugins-list">' . __( 'You can use any of our free plugins or premium plugins from <a href="%s" target="_blank">Catch Plugins</a>' ) . '.</p>',
53 'https://catchplugins.com/'
54 );
55 ?>
56 <form id="plugin-filter" method="post">
57 <?php $wp_list_table->display(); ?>
58 </form>
59 <?php
60 }
61 }