Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

122 строки
5.1 KiB

  1. <?php
  2. /**
  3. * Administration API: Default admin hooks
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. * @since 4.3.0
  8. */
  9. // Bookmark hooks.
  10. add_action( 'admin_page_access_denied', 'wp_link_manager_disabled_message' );
  11. // Dashboard hooks.
  12. add_action( 'activity_box_end', 'wp_dashboard_quota' );
  13. // Media hooks.
  14. add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
  15. add_action( 'media_upload_image', 'wp_media_upload_handler' );
  16. add_action( 'media_upload_audio', 'wp_media_upload_handler' );
  17. add_action( 'media_upload_video', 'wp_media_upload_handler' );
  18. add_action( 'media_upload_file', 'wp_media_upload_handler' );
  19. add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );
  20. add_action( 'post-html-upload-ui', 'media_upload_html_bypass' );
  21. add_filter( 'async_upload_image', 'get_media_item', 10, 2 );
  22. add_filter( 'async_upload_audio', 'get_media_item', 10, 2 );
  23. add_filter( 'async_upload_video', 'get_media_item', 10, 2 );
  24. add_filter( 'async_upload_file', 'get_media_item', 10, 2 );
  25. add_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );
  26. add_filter( 'media_upload_gallery', 'media_upload_gallery' );
  27. add_filter( 'media_upload_library', 'media_upload_library' );
  28. add_filter( 'media_upload_tabs', 'update_gallery_tab' );
  29. // Misc hooks.
  30. add_action( 'admin_head', 'wp_admin_canonical_url' );
  31. add_action( 'admin_head', 'wp_color_scheme_settings' );
  32. add_action( 'admin_head', 'wp_site_icon' );
  33. add_action( 'admin_head', '_ipad_meta' );
  34. // Prerendering.
  35. if ( ! is_customize_preview() ) {
  36. add_filter( 'admin_print_styles', 'wp_resource_hints', 1 );
  37. }
  38. add_action( 'admin_print_scripts-post.php', 'wp_page_reload_on_back_button_js' );
  39. add_action( 'admin_print_scripts-post-new.php', 'wp_page_reload_on_back_button_js' );
  40. add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
  41. add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
  42. add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
  43. add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 3 );
  44. add_filter( 'heartbeat_received', 'wp_refresh_post_lock', 10, 3 );
  45. add_filter( 'wp_refresh_nonces', 'wp_refresh_post_nonces', 10, 3 );
  46. add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
  47. add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
  48. // Nav Menu hooks.
  49. add_action( 'admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items' );
  50. // Plugin hooks.
  51. add_filter( 'whitelist_options', 'option_update_filter' );
  52. // Plugin Install hooks.
  53. add_action( 'install_plugins_featured', 'install_dashboard' );
  54. add_action( 'install_plugins_upload', 'install_plugins_upload' );
  55. add_action( 'install_plugins_search', 'display_plugins_table' );
  56. add_action( 'install_plugins_popular', 'display_plugins_table' );
  57. add_action( 'install_plugins_recommended', 'display_plugins_table' );
  58. add_action( 'install_plugins_new', 'display_plugins_table' );
  59. add_action( 'install_plugins_beta', 'display_plugins_table' );
  60. add_action( 'install_plugins_favorites', 'display_plugins_table' );
  61. add_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );
  62. // Template hooks.
  63. add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
  64. add_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );
  65. // Theme hooks.
  66. add_action( 'customize_controls_print_footer_scripts', 'customize_themes_print_templates' );
  67. // Theme Install hooks.
  68. // add_action('install_themes_dashboard', 'install_themes_dashboard');
  69. // add_action('install_themes_upload', 'install_themes_upload', 10, 0);
  70. // add_action('install_themes_search', 'display_themes');
  71. // add_action('install_themes_featured', 'display_themes');
  72. // add_action('install_themes_new', 'display_themes');
  73. // add_action('install_themes_updated', 'display_themes');
  74. add_action( 'install_themes_pre_theme-information', 'install_theme_information' );
  75. // User hooks.
  76. add_action( 'admin_init', 'default_password_nag_handler' );
  77. add_action( 'admin_notices', 'default_password_nag' );
  78. add_action( 'profile_update', 'default_password_nag_edit_user', 10, 2 );
  79. // Update hooks.
  80. add_action( 'load-plugins.php', 'wp_plugin_update_rows', 20 ); // After wp_update_plugins() is called.
  81. add_action( 'load-themes.php', 'wp_theme_update_rows', 20 ); // After wp_update_themes() is called.
  82. add_action( 'admin_notices', 'update_nag', 3 );
  83. add_action( 'admin_notices', 'maintenance_nag', 10 );
  84. add_filter( 'update_footer', 'core_update_footer' );
  85. // Update Core hooks.
  86. add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
  87. // Upgrade hooks.
  88. add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
  89. add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );
  90. add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
  91. add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );