当前位置: 首页>>代码示例>>PHP>>正文


PHP WP_Upgrader_Skin::footer方法代码示例

本文整理汇总了PHP中WP_Upgrader_Skin::footer方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Upgrader_Skin::footer方法的具体用法?PHP WP_Upgrader_Skin::footer怎么用?PHP WP_Upgrader_Skin::footer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WP_Upgrader_Skin的用法示例。


在下文中一共展示了WP_Upgrader_Skin::footer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Run an upgrade/install.
  *
  * Attempts to download the package (if it is not a local file), unpack it, and
  * install it in the destination folder.
  *
  * @since 2.8.0
  *
  * @param array $options {
  *     Array or string of arguments for upgrading/installing a package.
  *
  *     @type string $package                     The full path or URI of the package to install.
  *                                               Default empty.
  *     @type string $destination                 The full path to the destination folder.
  *                                               Default empty.
  *     @type bool   $clear_destination           Whether to delete any files already in the
  *                                               destination folder. Default false.
  *     @type bool   $clear_working               Whether to delete the files form the working
  *                                               directory after copying to the destination.
  *                                               Default false.
  *     @type bool   $abort_if_destination_exists Whether to abort the installation if the destination
  *                                               folder already exists. When true, `$clear_destination`
  *                                               should be false. Default true.
  *     @type bool   $is_multi                    Whether this run is one of multiple upgrade/install
  *                                               actions being performed in bulk. When true, the skin
  *                                               {@see WP_Upgrader::header()} and {@see WP_Upgrader::footer()}
  *                                               aren't called. Default false.
  *     @type array  $hook_extra                  Extra arguments to pass to the filter hooks called by
  *                                               {@see WP_Upgrader::run()}.
  * }
  *
  * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
  *                              or false if unable to connect to the filesystem.
  */
 public function run($options)
 {
     $defaults = array('package' => '', 'destination' => '', 'clear_destination' => false, 'abort_if_destination_exists' => true, 'clear_working' => true, 'is_multi' => false, 'hook_extra' => array());
     $options = wp_parse_args($options, $defaults);
     if (!$options['is_multi']) {
         // call $this->header separately if running multiple times
         $this->skin->header();
     }
     // Connect to the Filesystem first.
     $res = $this->fs_connect(array(WP_CONTENT_DIR, $options['destination']));
     // Mainly for non-connected filesystem.
     if (!$res) {
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return false;
     }
     $this->skin->before();
     if (is_wp_error($res)) {
         $this->skin->error($res);
         $this->skin->after();
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return $res;
     }
     //Download the package (Note, This just returns the filename of the file if the package is a local file)
     $download = $this->download_package($options['package']);
     if (is_wp_error($download)) {
         $this->skin->error($download);
         $this->skin->after();
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return $download;
     }
     $delete_package = $download != $options['package'];
     // Do not delete a "local" file
     //Unzips the file into a temporary directory
     $working_dir = $this->unpack_package($download, $delete_package);
     if (is_wp_error($working_dir)) {
         $this->skin->error($working_dir);
         $this->skin->after();
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return $working_dir;
     }
     //With the given options, this installs it to the destination directory.
     $result = $this->install_package(array('source' => $working_dir, 'destination' => $options['destination'], 'clear_destination' => $options['clear_destination'], 'abort_if_destination_exists' => $options['abort_if_destination_exists'], 'clear_working' => $options['clear_working'], 'hook_extra' => $options['hook_extra']));
     $this->skin->set_result($result);
     if (is_wp_error($result)) {
         $this->skin->error($result);
         $this->skin->feedback('process_failed');
     } else {
         //Install Succeeded
         $this->skin->feedback('process_success');
     }
     $this->skin->after();
     if (!$options['is_multi']) {
         /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
         do_action('upgrader_process_complete', $this, $options['hook_extra']);
         $this->skin->footer();
     }
     return $result;
 }
开发者ID:sunyang3721,项目名称:wp-for-sae,代码行数:100,代码来源:class-wp-upgrader.php

示例2: array

 function bulk_footer()
 {
     $this->decrement_update_count('translation');
     $update_actions = array();
     $update_actions['updates_page'] = '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>';
     /**
      * Filter the list of action links available following a translations update.
      *
      * @since 3.7.0
      *
      * @param array $update_actions Array of translations update links.
      */
     $update_actions = apply_filters('update_translations_complete_actions', $update_actions);
     if ($update_actions && $this->display_footer_actions) {
         $this->feedback(implode(' | ', $update_actions));
     }
     parent::footer();
 }
开发者ID:danielcoats,项目名称:schoolpress,代码行数:18,代码来源:class-wp-upgrader-skins.php

示例3: run

 /**
  * Run an upgrade/install.
  *
  * Attempts to download the package (if it is not a local file), unpack it, and
  * install it in the destination folder.
  *
  * @since 2.8.0
  * @access public
  *
  * @param array $options {
  *     Array or string of arguments for upgrading/installing a package.
  *
  *     @type string $package                     The full path or URI of the package to install.
  *                                               Default empty.
  *     @type string $destination                 The full path to the destination folder.
  *                                               Default empty.
  *     @type bool   $clear_destination           Whether to delete any files already in the
  *                                               destination folder. Default false.
  *     @type bool   $clear_working               Whether to delete the files form the working
  *                                               directory after copying to the destination.
  *                                               Default false.
  *     @type bool   $abort_if_destination_exists Whether to abort the installation if the destination
  *                                               folder already exists. When true, `$clear_destination`
  *                                               should be false. Default true.
  *     @type bool   $is_multi                    Whether this run is one of multiple upgrade/install
  *                                               actions being performed in bulk. When true, the skin
  *                                               {@see WP_Upgrader::header()} and {@see WP_Upgrader::footer()}
  *                                               aren't called. Default false.
  *     @type array  $hook_extra                  Extra arguments to pass to the filter hooks called by
  *                                               {@see WP_Upgrader::run()}.
  * }
  * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
  *                              or false if unable to connect to the filesystem.
  */
 public function run($options)
 {
     $defaults = array('package' => '', 'destination' => '', 'clear_destination' => false, 'abort_if_destination_exists' => true, 'clear_working' => true, 'is_multi' => false, 'hook_extra' => array());
     $options = wp_parse_args($options, $defaults);
     /**
      * Filter the package options before running an update.
      *
      * @since 4.3.0
      *
      * @param array $options {
      *     Options used by the upgrader.
      *
      *     @type string $package                     Package for update.
      *     @type string $destination                 Update location.
      *     @type bool   $clear_destination           Clear the destination resource.
      *     @type bool   $clear_working               Clear the working resource.
      *     @type bool   $abort_if_destination_exists Abort if the Destination directory exists.
      *     @type bool   $is_multi                    Whether the upgrader is running multiple times.
      *     @type array  $hook_extra                  Extra hook arguments.
      * }
      */
     $options = apply_filters('upgrader_package_options', $options);
     if (!$options['is_multi']) {
         // call $this->header separately if running multiple times
         $this->skin->header();
     }
     // Connect to the Filesystem first.
     $res = $this->fs_connect(array(WP_CONTENT_DIR, $options['destination']));
     // Mainly for non-connected filesystem.
     if (!$res) {
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return false;
     }
     $this->skin->before();
     if (is_wp_error($res)) {
         $this->skin->error($res);
         $this->skin->after();
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return $res;
     }
     /*
      * Download the package (Note, This just returns the filename
      * of the file if the package is a local file)
      */
     $download = $this->download_package($options['package']);
     if (is_wp_error($download)) {
         $this->skin->error($download);
         $this->skin->after();
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return $download;
     }
     $delete_package = $download != $options['package'];
     // Do not delete a "local" file
     // Unzips the file into a temporary directory.
     $working_dir = $this->unpack_package($download, $delete_package);
     if (is_wp_error($working_dir)) {
         $this->skin->error($working_dir);
         $this->skin->after();
         if (!$options['is_multi']) {
             $this->skin->footer();
//.........这里部分代码省略.........
开发者ID:7press,项目名称:7press,代码行数:101,代码来源:class-wp-upgrader.php

示例4: run

 /**
  * Run an upgrade/install.
  *
  * Attempts to download the package (if it is not a local file), unpack it, and
  * install it in the destination folder.
  *
  * @since 2.8.0
  * @access public
  *
  * @param array $options {
  *     Array or string of arguments for upgrading/installing a package.
  *
  *     @type string $package                     The full path or URI of the package to install.
  *                                               Default empty.
  *     @type string $destination                 The full path to the destination folder.
  *                                               Default empty.
  *     @type bool   $clear_destination           Whether to delete any files already in the
  *                                               destination folder. Default false.
  *     @type bool   $clear_working               Whether to delete the files form the working
  *                                               directory after copying to the destination.
  *                                               Default false.
  *     @type bool   $abort_if_destination_exists Whether to abort the installation if the destination
  *                                               folder already exists. When true, `$clear_destination`
  *                                               should be false. Default true.
  *     @type bool   $is_multi                    Whether this run is one of multiple upgrade/install
  *                                               actions being performed in bulk. When true, the skin
  *                                               WP_Upgrader::header() and WP_Upgrader::footer()
  *                                               aren't called. Default false.
  *     @type array  $hook_extra                  Extra arguments to pass to the filter hooks called by
  *                                               WP_Upgrader::run().
  * }
  * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
  *                              or false if unable to connect to the filesystem.
  */
 public function run($options)
 {
     $defaults = array('package' => '', 'destination' => '', 'clear_destination' => false, 'abort_if_destination_exists' => true, 'clear_working' => true, 'is_multi' => false, 'hook_extra' => array());
     $options = wp_parse_args($options, $defaults);
     /**
      * Filters the package options before running an update.
      *
      * See also {@see 'upgrader_process_complete'}.
      *
      * @since 4.3.0
      *
      * @param array $options {
      *     Options used by the upgrader.
      *
      *     @type string $package                     Package for update.
      *     @type string $destination                 Update location.
      *     @type bool   $clear_destination           Clear the destination resource.
      *     @type bool   $clear_working               Clear the working resource.
      *     @type bool   $abort_if_destination_exists Abort if the Destination directory exists.
      *     @type bool   $is_multi                    Whether the upgrader is running multiple times.
      *     @type array  $hook_extra {
      *         Extra hook arguments.
      *
      *         @type string $action               Type of action. Default 'update'.
      *         @type string $type                 Type of update process. Accepts 'plugin', 'theme', or 'core'.
      *         @type bool   $bulk                 Whether the update process is a bulk update. Default true.
      *         @type string $plugin               The base plugin path from the plugins directory.
      *         @type string $theme                The stylesheet or template name of the theme.
      *         @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
      *                                            or 'core'.
      *         @type object $language_update      The language pack update offer.
      *     }
      * }
      */
     $options = apply_filters('upgrader_package_options', $options);
     if (!$options['is_multi']) {
         // call $this->header separately if running multiple times
         $this->skin->header();
     }
     // Connect to the Filesystem first.
     $res = $this->fs_connect(array(WP_CONTENT_DIR, $options['destination']));
     // Mainly for non-connected filesystem.
     if (!$res) {
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return false;
     }
     $this->skin->before();
     if (is_wp_error($res)) {
         $this->skin->error($res);
         $this->skin->after();
         if (!$options['is_multi']) {
             $this->skin->footer();
         }
         return $res;
     }
     /*
      * Download the package (Note, This just returns the filename
      * of the file if the package is a local file)
      */
     $download = $this->download_package($options['package']);
     if (is_wp_error($download)) {
         $this->skin->error($download);
         $this->skin->after();
         if (!$options['is_multi']) {
//.........这里部分代码省略.........
开发者ID:BoldGrid,项目名称:WordPress,代码行数:101,代码来源:class-wp-upgrader.php

示例5: array

 function bulk_footer()
 {
     $update_actions = array();
     $update_actions['updates_page'] = '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>';
     $update_actions = apply_filters('update_translations_complete_actions', $update_actions);
     if ($update_actions && $this->display_footer_actions) {
         $this->feedback(implode(' | ', $update_actions));
     }
     parent::footer();
 }
开发者ID:palimadra,项目名称:bubblegraphics-wpsite,代码行数:10,代码来源:class-wp-upgrader-skins.php

示例6: cancel_installer

 /**
  * Cancel installer.
  *
  * @param WP_Upgrader_Skin $skin Skin to set message on.
  * @param WP_Error|string  $error Error to display.
  */
 protected function cancel_installer($skin, $error)
 {
     $skin->error($error);
     $skin->after();
     $skin->footer();
 }
开发者ID:moorscode,项目名称:stencil,代码行数:12,代码来源:abstract-installable.php


注:本文中的WP_Upgrader_Skin::footer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。