wp/wp-admin/includes/admin-filters.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
    17 add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
    17 add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
    18 
    18 
    19 add_action( 'media_upload_image', 'wp_media_upload_handler' );
    19 add_action( 'media_upload_image', 'wp_media_upload_handler' );
    20 add_action( 'media_upload_audio', 'wp_media_upload_handler' );
    20 add_action( 'media_upload_audio', 'wp_media_upload_handler' );
    21 add_action( 'media_upload_video', 'wp_media_upload_handler' );
    21 add_action( 'media_upload_video', 'wp_media_upload_handler' );
    22 add_action( 'media_upload_file',  'wp_media_upload_handler' );
    22 add_action( 'media_upload_file', 'wp_media_upload_handler' );
    23 
    23 
    24 add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );
    24 add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );
    25 
    25 
    26 add_action( 'post-html-upload-ui', 'media_upload_html_bypass'  );
    26 add_action( 'post-html-upload-ui', 'media_upload_html_bypass' );
    27 
    27 
    28 add_filter( 'async_upload_image', 'get_media_item', 10, 2 );
    28 add_filter( 'async_upload_image', 'get_media_item', 10, 2 );
    29 add_filter( 'async_upload_audio', 'get_media_item', 10, 2 );
    29 add_filter( 'async_upload_audio', 'get_media_item', 10, 2 );
    30 add_filter( 'async_upload_video', 'get_media_item', 10, 2 );
    30 add_filter( 'async_upload_video', 'get_media_item', 10, 2 );
    31 add_filter( 'async_upload_file',  'get_media_item', 10, 2 );
    31 add_filter( 'async_upload_file', 'get_media_item', 10, 2 );
    32 
    32 
    33 add_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );
    33 add_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );
    34 
    34 
    35 add_filter( 'media_upload_gallery', 'media_upload_gallery' );
    35 add_filter( 'media_upload_gallery', 'media_upload_gallery' );
    36 add_filter( 'media_upload_library', 'media_upload_library' );
    36 add_filter( 'media_upload_library', 'media_upload_library' );
    37 
    37 
    38 add_filter( 'media_upload_tabs', 'update_gallery_tab' );
    38 add_filter( 'media_upload_tabs', 'update_gallery_tab' );
    39 
    39 
    40 // Misc hooks.
    40 // Misc hooks.
    41 add_action( 'admin_init', 'wp_admin_headers'         );
    41 add_action( 'admin_init', 'wp_admin_headers' );
    42 add_action( 'login_init', 'wp_admin_headers'         );
    42 add_action( 'login_init', 'wp_admin_headers' );
    43 add_action( 'admin_head', 'wp_admin_canonical_url'   );
    43 add_action( 'admin_head', 'wp_admin_canonical_url' );
    44 add_action( 'admin_head', 'wp_color_scheme_settings' );
    44 add_action( 'admin_head', 'wp_color_scheme_settings' );
    45 add_action( 'admin_head', 'wp_site_icon'             );
    45 add_action( 'admin_head', 'wp_site_icon' );
    46 add_action( 'admin_head', '_ipad_meta'               );
    46 add_action( 'admin_head', '_ipad_meta' );
    47 
    47 
    48 // Privacy tools
    48 // Privacy tools
    49 add_action( 'admin_menu', '_wp_privacy_hook_requests_page' );
    49 add_action( 'admin_menu', '_wp_privacy_hook_requests_page' );
    50 add_action( 'load-tools_page_export_personal_data', '_wp_privacy_requests_screen_options' );
    50 add_action( 'load-tools_page_export_personal_data', '_wp_privacy_requests_screen_options' );
    51 add_action( 'load-tools_page_remove_personal_data', '_wp_privacy_requests_screen_options' );
    51 add_action( 'load-tools_page_remove_personal_data', '_wp_privacy_requests_screen_options' );
    53 // Prerendering.
    53 // Prerendering.
    54 if ( ! is_customize_preview() ) {
    54 if ( ! is_customize_preview() ) {
    55 	add_filter( 'admin_print_styles', 'wp_resource_hints', 1 );
    55 	add_filter( 'admin_print_styles', 'wp_resource_hints', 1 );
    56 }
    56 }
    57 
    57 
    58 add_action( 'admin_print_scripts-post.php',     'wp_page_reload_on_back_button_js' );
    58 add_action( 'admin_print_scripts-post.php', 'wp_page_reload_on_back_button_js' );
    59 add_action( 'admin_print_scripts-post-new.php', 'wp_page_reload_on_back_button_js' );
    59 add_action( 'admin_print_scripts-post-new.php', 'wp_page_reload_on_back_button_js' );
    60 
    60 
    61 add_action( 'update_option_home',          'update_home_siteurl', 10, 2 );
    61 add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
    62 add_action( 'update_option_siteurl',       'update_home_siteurl', 10, 2 );
    62 add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
    63 add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
    63 add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
    64 add_action( 'update_option_admin_email',   'wp_site_admin_email_change_notification', 10, 3 );
    64 add_action( 'update_option_admin_email', 'wp_site_admin_email_change_notification', 10, 3 );
    65 
    65 
    66 add_action( 'add_option_new_admin_email',    'update_option_new_admin_email', 10, 2 );
    66 add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
    67 add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
    67 add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
    68 
    68 
    69 add_filter( 'heartbeat_received', 'wp_check_locked_posts',  10,  3 );
    69 add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 3 );
    70 add_filter( 'heartbeat_received', 'wp_refresh_post_lock',   10,  3 );
    70 add_filter( 'heartbeat_received', 'wp_refresh_post_lock', 10, 3 );
    71 add_filter( 'wp_refresh_nonces', 'wp_refresh_post_nonces', 10,  3 );
    71 add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
    72 add_filter( 'heartbeat_received', 'heartbeat_autosave',     500, 2 );
    72 
       
    73 add_filter( 'wp_refresh_nonces', 'wp_refresh_post_nonces', 10, 3 );
       
    74 add_filter( 'wp_refresh_nonces', 'wp_refresh_heartbeat_nonces' );
    73 
    75 
    74 add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
    76 add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
    75 
    77 
    76 // Nav Menu hooks.
    78 // Nav Menu hooks.
    77 add_action( 'admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items' );
    79 add_action( 'admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items' );
    78 
    80 
    79 // Plugin hooks.
    81 // Plugin hooks.
    80 add_filter( 'whitelist_options', 'option_update_filter' );
    82 add_filter( 'whitelist_options', 'option_update_filter' );
    81 
    83 
    82 // Plugin Install hooks.
    84 // Plugin Install hooks.
    83 add_action( 'install_plugins_featured',               'install_dashboard' );
    85 add_action( 'install_plugins_featured', 'install_dashboard' );
    84 add_action( 'install_plugins_upload',                 'install_plugins_upload' );
    86 add_action( 'install_plugins_upload', 'install_plugins_upload' );
    85 add_action( 'install_plugins_search',                 'display_plugins_table' );
    87 add_action( 'install_plugins_search', 'display_plugins_table' );
    86 add_action( 'install_plugins_popular',                'display_plugins_table' );
    88 add_action( 'install_plugins_popular', 'display_plugins_table' );
    87 add_action( 'install_plugins_recommended',            'display_plugins_table' );
    89 add_action( 'install_plugins_recommended', 'display_plugins_table' );
    88 add_action( 'install_plugins_new',                    'display_plugins_table' );
    90 add_action( 'install_plugins_new', 'display_plugins_table' );
    89 add_action( 'install_plugins_beta',                   'display_plugins_table' );
    91 add_action( 'install_plugins_beta', 'display_plugins_table' );
    90 add_action( 'install_plugins_favorites',              'display_plugins_table' );
    92 add_action( 'install_plugins_favorites', 'display_plugins_table' );
    91 add_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );
    93 add_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );
    92 
    94 
    93 // Template hooks.
    95 // Template hooks.
    94 add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts'                ) );
    96 add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
    95 add_action( 'user_register',         array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );
    97 add_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );
    96 
    98 
    97 // Theme hooks.
    99 // Theme hooks.
    98 add_action( 'customize_controls_print_footer_scripts', 'customize_themes_print_templates' );
   100 add_action( 'customize_controls_print_footer_scripts', 'customize_themes_print_templates' );
    99 
   101 
   100 // Theme Install hooks.
   102 // Theme Install hooks.
   101 // add_action('install_themes_dashboard', 'install_themes_dashboard');
       
   102 // add_action('install_themes_upload', 'install_themes_upload', 10, 0);
       
   103 // add_action('install_themes_search', 'display_themes');
       
   104 // add_action('install_themes_featured', 'display_themes');
       
   105 // add_action('install_themes_new', 'display_themes');
       
   106 // add_action('install_themes_updated', 'display_themes');
       
   107 add_action( 'install_themes_pre_theme-information', 'install_theme_information' );
   103 add_action( 'install_themes_pre_theme-information', 'install_theme_information' );
   108 
   104 
   109 // User hooks.
   105 // User hooks.
   110 add_action( 'admin_init', 'default_password_nag_handler' );
   106 add_action( 'admin_init', 'default_password_nag_handler' );
   111 
   107 
   118 
   114 
   119 // Update hooks.
   115 // Update hooks.
   120 add_action( 'load-plugins.php', 'wp_plugin_update_rows', 20 ); // After wp_update_plugins() is called.
   116 add_action( 'load-plugins.php', 'wp_plugin_update_rows', 20 ); // After wp_update_plugins() is called.
   121 add_action( 'load-themes.php', 'wp_theme_update_rows', 20 ); // After wp_update_themes() is called.
   117 add_action( 'load-themes.php', 'wp_theme_update_rows', 20 ); // After wp_update_themes() is called.
   122 
   118 
   123 add_action( 'admin_notices', 'update_nag',      3  );
   119 add_action( 'admin_notices', 'update_nag', 3 );
       
   120 add_action( 'admin_notices', 'paused_plugins_notice', 5 );
       
   121 add_action( 'admin_notices', 'paused_themes_notice', 5 );
   124 add_action( 'admin_notices', 'maintenance_nag', 10 );
   122 add_action( 'admin_notices', 'maintenance_nag', 10 );
       
   123 add_action( 'admin_notices', 'wp_recovery_mode_nag', 1 );
   125 
   124 
   126 add_filter( 'update_footer', 'core_update_footer' );
   125 add_filter( 'update_footer', 'core_update_footer' );
   127 
   126 
   128 // Update Core hooks.
   127 // Update Core hooks.
   129 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
   128 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
   142 
   141 
   143 // Privacy policy text changes check.
   142 // Privacy policy text changes check.
   144 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 100 );
   143 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 100 );
   145 
   144 
   146 // Show a "postbox" with the text suggestions for a privacy policy.
   145 // Show a "postbox" with the text suggestions for a privacy policy.
   147 add_action( 'edit_form_after_title', array( 'WP_Privacy_Policy_Content', 'notice' ) );
   146 add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) );
   148 
   147 
   149 // Add the suggested policy text from WordPress.
   148 // Add the suggested policy text from WordPress.
   150 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 );
   149 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 );
   151 
   150 
   152 // Update the cached policy info when the policy page is updated.
   151 // Update the cached policy info when the policy page is updated.