WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 7 times in this file.
| Line | Code |
|---|---|
| 411 | |
| 412 | remove_filter('upgrader_source_selection', array(&$this, 'check_package') ); |
| 413 | |
| 414 | if ( ! $this->result || is_wp_error($this->result) ) |
| 415 | return $this->result; |
| 416 | |
| 417 | // Force refresh of plugin update information |
| 418 | delete_site_transient('update_plugins'); |
| 419 | wp_cache_delete( 'plugins', 'plugins' ); |
| 420 | do_action( 'upgrader_process_complete', $this, array( 'action' => 'install', 'type' => 'plugin' ), $package ); |
| 421 | |
| 422 | return true; |
| 423 | } |
| 424 | |
| 425 | function upgrade($plugin) { |
| 426 | |
| 427 | $this->init(); |
| 428 | $this->upgrade_strings(); |
| 429 | |
| Line | Code |
| 457 | remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade')); |
| 458 | remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); |
| 459 | |
| 460 | if ( ! $this->result || is_wp_error($this->result) ) |
| 461 | return $this->result; |
| 462 | |
| 463 | // Force refresh of plugin update information |
| 464 | delete_site_transient('update_plugins'); |
| 465 | wp_cache_delete( 'plugins', 'plugins' ); |
| 466 | do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'plugin' ), $plugin ); |
| 467 | } |
| 468 | |
| 469 | function bulk_upgrade($plugins) { |
| 470 | |
| 471 | $this->init(); |
| 472 | $this->bulk = true; |
| 473 | $this->upgrade_strings(); |
| 474 | |
| 475 | $current = get_site_transient( 'update_plugins' ); |
| Line | Code |
| 540 | |
| 541 | $this->skin->footer(); |
| 542 | |
| 543 | // Cleanup our hooks, in case something else does a upgrade on this connection. |
| 544 | remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); |
| 545 | |
| 546 | // Force refresh of plugin update information |
| 547 | delete_site_transient('update_plugins'); |
| 548 | wp_cache_delete( 'plugins', 'plugins' ); |
| 549 | do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'plugin', 'bulk' => true ), $plugins ); |
| 550 | |
| 551 | return $results; |
| 552 | } |
| 553 | |
| 554 | function check_package($source) { |
| 555 | global $wp_filesystem; |
| 556 | |
| 557 | if ( is_wp_error($source) ) |
| 558 | return $source; |
| Line | Code |
| 767 | |
| 768 | remove_filter('upgrader_source_selection', array(&$this, 'check_package') ); |
| 769 | remove_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter')); |
| 770 | |
| 771 | if ( ! $this->result || is_wp_error($this->result) ) |
| 772 | return $this->result; |
| 773 | |
| 774 | // Force refresh of theme update information |
| 775 | wp_clean_themes_cache(); |
| 776 | do_action( 'upgrader_process_complete', $this, array( 'action' => 'install', 'type' => 'theme' ), $package ); |
| 777 | |
| 778 | return true; |
| 779 | } |
| 780 | |
| 781 | function upgrade($theme) { |
| 782 | |
| 783 | $this->init(); |
| 784 | $this->upgrade_strings(); |
| 785 | |
| Line | Code |
| 814 | remove_filter('upgrader_pre_install', array(&$this, 'current_before')); |
| 815 | remove_filter('upgrader_post_install', array(&$this, 'current_after')); |
| 816 | remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme')); |
| 817 | |
| 818 | if ( ! $this->result || is_wp_error($this->result) ) |
| 819 | return $this->result; |
| 820 | |
| 821 | // Force refresh of theme update information |
| 822 | wp_clean_themes_cache(); |
| 823 | do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'theme' ), $theme ); |
| 824 | |
| 825 | return true; |
| 826 | } |
| 827 | |
| 828 | function bulk_upgrade($themes) { |
| 829 | |
| 830 | $this->init(); |
| 831 | $this->bulk = true; |
| 832 | $this->upgrade_strings(); |
| Line | Code |
| 902 | $this->skin->footer(); |
| 903 | |
| 904 | // Cleanup our hooks, in case something else does a upgrade on this connection. |
| 905 | remove_filter('upgrader_pre_install', array(&$this, 'current_before')); |
| 906 | remove_filter('upgrader_post_install', array(&$this, 'current_after')); |
| 907 | remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme')); |
| 908 | |
| 909 | // Force refresh of theme update information |
| 910 | wp_clean_themes_cache(); |
| 911 | do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'theme', 'bulk' => true ), $themes ); |
| 912 | |
| 913 | return $results; |
| 914 | } |
| 915 | |
| 916 | function check_package($source) { |
| 917 | global $wp_filesystem; |
| 918 | |
| 919 | if ( is_wp_error($source) ) |
| 920 | return $source; |
| Line | Code |
| 1071 | } |
| 1072 | $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE); |
| 1073 | |
| 1074 | require(ABSPATH . 'wp-admin/includes/update-core.php'); |
| 1075 | |
| 1076 | if ( ! function_exists( 'update_core' ) ) |
| 1077 | return new WP_Error( 'copy_failed_space', $this->strings['copy_failed_space'] ); |
| 1078 | |
| 1079 | $result = update_core( $working_dir, $wp_dir ); |
| 1080 | do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'core' ), $result ); |
| 1081 | return $result; |
| 1082 | } |
| 1083 | |
| 1084 | } |
| 1085 | |
| 1086 | /** |
| 1087 | * Generic Skin for the WordPress Upgrader classes. This skin is designed to be extended for specific purposes. |
| 1088 | * |
| 1089 | * @TODO More Detailed docs, for methods as well. |