PageRenderTime 47ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-admin/plugin-install.php

https://bitbucket.org/julianelve/vendor-wordpress
PHP | 72 lines | 51 code | 13 blank | 8 comment | 9 complexity | c9a1db17381038ccaa70994841191f78 MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1, GPL-2.0
  1. <?php
  2. /**
  3. * Install plugin administration panel.
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. */
  8. // TODO route this pages via a specific iframe handler instead of the do_action below
  9. if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
  10. define( 'IFRAME_REQUEST', true );
  11. /** WordPress Administration Bootstrap */
  12. require_once('./admin.php');
  13. if ( ! current_user_can('install_plugins') )
  14. wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
  15. if ( is_multisite() && ! is_network_admin() ) {
  16. wp_redirect( network_admin_url( 'plugin-install.php' ) );
  17. exit();
  18. }
  19. $wp_list_table = _get_list_table('WP_Plugin_Install_List_Table');
  20. $pagenum = $wp_list_table->get_pagenum();
  21. $wp_list_table->prepare_items();
  22. $title = __('Install Plugins');
  23. $parent_file = 'plugins.php';
  24. wp_enqueue_script( 'plugin-install' );
  25. if ( 'plugin-information' != $tab )
  26. add_thickbox();
  27. $body_id = $tab;
  28. do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information.
  29. get_current_screen()->add_help_tab( array(
  30. 'id' => 'overview',
  31. 'title' => __('Overview'),
  32. 'content' =>
  33. '<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/extend/plugins/') . '</p>'
  34. ) );
  35. get_current_screen()->add_help_tab( array(
  36. 'id' => 'adding-plugins',
  37. 'title' => __('Adding Plugins'),
  38. 'content' =>
  39. '<p>' . __('If you know what you&#8217;re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>' .
  40. '<p>' . __('If you just want to get an idea of what&#8217;s available, you can browse Featured, Popular, and Newest plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '</p>' .
  41. '<p>' . __('You can also browse a user&#8217;s favorite plugins, by using the Favorites link in the upper left of the screen and entering their WordPress.org username.') . '</p>' .
  42. '<p>' . __('If you want to install a plugin that you&#8217;ve downloaded elsewhere, click the Upload link in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '</p>'
  43. ) );
  44. get_current_screen()->set_help_sidebar(
  45. '<p><strong>' . __('For more information:') . '</strong></p>' .
  46. '<p>' . __('<a href="http://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>') . '</p>' .
  47. '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
  48. );
  49. include(ABSPATH . 'wp-admin/admin-header.php');
  50. ?>
  51. <div class="wrap">
  52. <?php screen_icon( 'plugins' ); ?>
  53. <h2><?php echo esc_html( $title ); ?></h2>
  54. <?php $wp_list_table->views(); ?>
  55. <br class="clear" />
  56. <?php do_action('install_plugins_' . $tab, $paged); ?>
  57. </div>
  58. <?php
  59. include(ABSPATH . 'wp-admin/admin-footer.php');