當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WP_Installer函數代碼示例

本文整理匯總了PHP中WP_Installer函數的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Installer函數的具體用法?PHP WP_Installer怎麽用?PHP WP_Installer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了WP_Installer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_ts_referal

 /**
  * Retrieve the referring translation service (if any)
  *
  * @since 1.6.5
  *
  * @param string The repository id (e.g. wpml)
  * @return string The translation service id or false
  */
 public static function get_ts_referal($repository_id = 'wpml')
 {
     if (isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'])) {
         return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'];
     }
     return false;
 }
開發者ID:sonvq,項目名稱:passioninvestment,代碼行數:15,代碼來源:installer-api.php

示例2: wpml_installer_instance_delegator

 function wpml_installer_instance_delegator()
 {
     global $wp_installer_instances;
     // version based election
     foreach ($wp_installer_instances as $instance) {
         if (!isset($delegate)) {
             $delegate = $instance;
             continue;
         }
         if (version_compare($instance['version'], $delegate['version'], '>')) {
             $delegate = $instance;
         }
     }
     // priority based election
     $highest_priority = null;
     foreach ($wp_installer_instances as $instance) {
         if (isset($instance['args']['high_priority'])) {
             if (is_null($highest_priority) || $instance['args']['high_priority'] <= $highest_priority) {
                 $highest_priority = $instance['args']['high_priority'];
                 $delegate = $instance;
             }
         }
     }
     include_once $delegate['bootfile'];
     // set configuration
     if (strpos(realpath($delegate['bootfile']), realpath(TEMPLATEPATH)) === 0) {
         $delegate['args']['in_theme_folder'] = dirname(ltrim(str_replace(realpath(TEMPLATEPATH), '', realpath($delegate['bootfile'])), '\\/'));
     }
     if (isset($delegate['args']) && is_array($delegate['args'])) {
         foreach ($delegate['args'] as $key => $value) {
             WP_Installer()->set_config($key, $value);
         }
     }
 }
開發者ID:pcuervo,項目名稱:odc,代碼行數:34,代碼來源:loader.php

示例3: check_register

 public static function check_register()
 {
     if (!function_exists('WP_Installer')) {
         return false;
     }
     $repos = array('toolset');
     foreach ($repos as $repository_id) {
         $key = WP_Installer()->repository_has_subscription($repository_id);
         if (empty($key)) {
             continue;
         }
         return true;
     }
     return false;
 }
開發者ID:sandum150,項目名稱:cheltuieli,代碼行數:15,代碼來源:class.wpcf-marketing-messages.php

示例4: save_info

 function save_info($data, $repository_id)
 {
     $ts_info = isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']) ? WP_Installer()->settings['repositories'][$repository_id]['ts_info'] : false;
     $save_settings = false;
     if (isset($data->ts_info['preferred']) && empty($ts_info['preferred'])) {
         WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'] = $data->ts_info['preferred'];
         $save_settings = true;
     }
     if (isset($data->ts_info['referal']) && empty($ts_info['referal'])) {
         WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'] = $data->ts_info['referal'];
         $save_settings = true;
     }
     if ($save_settings) {
         WP_Installer()->save_settings();
     }
 }
開發者ID:SayenkoDesign,項目名稱:ividf,代碼行數:16,代碼來源:translation-service-info.class.php

示例5: create

 /**
  * Create and configure project (Translation Service)
  *
  * @param string $url
  * @param string $name
  * @param string $description
  * @param string $delivery
  *
  * @return bool
  * @throws TranslationProxy_Api_Error
  * @throws Exception
  */
 public function create($url, $name, $description, $delivery = 'xmlrpc')
 {
     global $sitepress;
     $networking = wpml_tm_load_tp_networking();
     $project_creation = new WPML_TP_Project_Creation($this, $sitepress, $networking, array('name' => $name, 'description' => $description, 'url' => $url, 'delivery_method' => $delivery, 'sitekey' => WP_Installer()->get_site_key('wpml')));
     $response_project = $project_creation->run();
     $this->id = $response_project->id;
     $this->access_key = $response_project->accesskey;
     $this->ts_id = $response_project->ts_id;
     $this->ts_access_key = $response_project->ts_accesskey;
     if (isset($response_project->polling_method) && $response_project->polling_method != $delivery) {
         $this->update_delivery_method($response_project->polling_method);
         $this->service->delivery_method = $response_project->polling_method;
     }
     return true;
 }
開發者ID:agiper,項目名稱:wordpress,代碼行數:28,代碼來源:translationproxy-project.class.php

示例6: wpml_installer_instance_delegator

 function wpml_installer_instance_delegator()
 {
     global $wp_installer_instances;
     // version based election
     foreach ($wp_installer_instances as $instance) {
         if (!isset($delegate)) {
             $delegate = $instance;
             continue;
         }
         if (version_compare($instance['version'], $delegate['version'], '>')) {
             $delegate = $instance;
         }
     }
     // priority based election
     $highest_priority = null;
     foreach ($wp_installer_instances as $instance) {
         if (isset($instance['args']['high_priority'])) {
             if (is_null($highest_priority) || $instance['args']['high_priority'] <= $highest_priority) {
                 $highest_priority = $instance['args']['high_priority'];
                 $delegate = $instance;
             }
         }
     }
     // Exception: When WPML prior 3.2 is used, that instance must be used regardless of another newer instance
     // Case 2: WPML loaded after Types
     if (defined('ICL_SITEPRESS_VERSION') && version_compare(ICL_SITEPRESS_VERSION, '3.2', '<')) {
         foreach ($wp_installer_instances as $key => $instance) {
             if (isset($instance['args']['site_key_nags'])) {
                 $delegate = $instance;
                 $wp_installer_instances = array($key => $delegate);
                 //Eliminate other instances
                 break;
             }
         }
     }
     include_once $delegate['bootfile'];
     // set configuration
     if (strpos(realpath($delegate['bootfile']), realpath(TEMPLATEPATH)) === 0) {
         $delegate['args']['in_theme_folder'] = dirname(ltrim(str_replace(realpath(TEMPLATEPATH), '', realpath($delegate['bootfile'])), '\\/'));
     }
     if (isset($delegate['args']) && is_array($delegate['args'])) {
         foreach ($delegate['args'] as $key => $value) {
             WP_Installer()->set_config($key, $value);
         }
     }
 }
開發者ID:Artenka,項目名稱:geniusmarketing,代碼行數:46,代碼來源:loader.php

示例7: sprintf

     if ($_POST['button_action'] == 'later') {
         //success
         $ret['success'] = sprintf(__('WPML will work on your site, but you will not receive updates. WPML updates are essential for keeping your site running smoothly and secure. To receive automated updates, you need to complete the registration, in the %splugins admin%s page.', 'sitepress'), '<a href="' . admin_url('plugin-install.php?tab=commercial') . '">', '</a>');
     } elseif ($_POST['button_action'] == 'finish') {
         $iclsettings['setup_complete'] = 1;
     } else {
         if (empty($_POST['installer_site_key'])) {
             $ret['error'] = __('Missing site key.');
         } else {
             $iclsettings['site_key'] = $_POST['installer_site_key'];
             if (class_exists('WP_Installer')) {
                 $args['repository_id'] = 'wpml';
                 $args['nonce'] = wp_create_nonce('save_site_key_' . $args['repository_id']);
                 $args['site_key'] = $_POST['installer_site_key'];
                 $args['return'] = 1;
                 $r = WP_Installer()->save_site_key($args);
                 if (!empty($r['error'])) {
                     $ret['error'] = $r['error'];
                 } else {
                     //success
                     $ret['success'] = __('Thank you for registering WPML on this site. You will receive automatic updates when new versions are available.', 'sitepress');
                 }
             }
         }
     }
     if (!empty($iclsettings)) {
         $this->save_settings($iclsettings);
     }
     echo json_encode($ret);
     break;
 case 'icl_admin_language_options':
開發者ID:PHQ-Design,項目名稱:souza-lima,代碼行數:31,代碼來源:ajax.php

示例8: is_uploading_allowed

 public function is_uploading_allowed()
 {
     if (!isset($this->uploading_allowed)) {
         require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
         require_once WP_Installer()->plugin_path() . '/includes/installer-upgrader-skins.php';
         $upgrader_skins = new Installer_Upgrader_Skins();
         //use our custom (mute) Skin
         $upgrader = new Plugin_Upgrader($upgrader_skins);
         ob_start();
         $res = $upgrader->fs_connect(array(WP_CONTENT_DIR, WP_PLUGIN_DIR));
         ob_end_clean();
         if (!$res || is_wp_error($res)) {
             $this->uploading_allowed = false;
         } else {
             $this->uploading_allowed = true;
         }
     }
     return $this->uploading_allowed;
 }
開發者ID:quanglong05,項目名稱:unicons,代碼行數:19,代碼來源:installer.class.php

示例9: WP_Installer_Show_Products

function WP_Installer_Show_Products($args = array())
{
    WP_Installer()->show_products($args);
}
開發者ID:sandum150,項目名稱:cheltuieli,代碼行數:4,代碼來源:installer.php

示例10: elseif

                }
                ?>
 />
                        </div>
                    <?php 
            }
            ?>

                </div> <!-- .wcml-section-content -->
            </div> <!-- .wpml-section-languages -->
            
        <?php 
        } elseif ($setup_wizard_step == 4) {
            ?>
        <?php 
            $site_key = WP_Installer()->get_site_key('wpml');
            ?>
    
        <div class="wpml-section" id="lang-sec-0">
            <div class="wpml-section-header">
                <h3><?php 
            _e('Registration', 'sitepress');
            ?>
</h3>
            </div>
            <div class="wpml-section-content">
                
                <?php 
            if (is_multisite() && !empty($site_key)) {
                ?>
                
開發者ID:Junaid-Farid,項目名稱:gocnex,代碼行數:30,代碼來源:languages.php

示例11: site_key_exist

 private function site_key_exist()
 {
     if (class_exists('WP_Installer')) {
         $repository_id = 'wpml';
         $site_key = WP_Installer()->get_site_key($repository_id);
     }
     return $does_exist = $site_key !== false ? true : false;
 }
開發者ID:tlandn,項目名稱:akvo-sites-zz-template,代碼行數:8,代碼來源:wpml-tm-menus.class.php

示例12: printf

                    <br />

                    <div class="installer-error-box">
                    <?php 
if (!WP_Installer()->dependencies->is_uploading_allowed()) {
    ?>
                        <p><?php 
    printf(__('Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s.', 'installer'), '<a href="http://codex.wordpress.org/Changing_File_Permissions">', '</a>');
    ?>
</p>
                    <?php 
} elseif (WP_Installer()->dependencies->is_win_paths_exception($repository_id)) {
    ?>
                        <p><?php 
    echo WP_Installer()->dependencies->win_paths_exception_message();
    ?>
</p>
                    <?php 
}
?>
                    </div>

                    <input type="submit" class="button-secondary" value="<?php 
esc_attr_e('Download', 'installer');
?>
" disabled="disabled" />
                    &nbsp;
                    <label><input name="activate" type="checkbox" value="1" disabled="disabled" />&nbsp;<?php 
_e('Activate after download', 'installer');
?>
開發者ID:SayenkoDesign,項目名稱:ividf,代碼行數:30,代碼來源:downloads-list.php

示例13: printf

    ?>
</span>
                                </td>
                                <td class="for_spinner_js"><span class="spinner"></span></td>
                            </tr>
                        <?php 
}
?>
                        </tbody>
                    </table>

                    <br />

                    <div class="installer-error-box">
                    <?php 
if (!WP_Installer()->is_uploading_allowed()) {
    ?>
                        <p>
                        <?php 
    printf(__('Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s.', 'installer'), '<a href="http://codex.wordpress.org/Changing_File_Permissions">', '</a>');
    ?>
                        </p>
                    <?php 
}
?>
                    </div>

                    <input type="submit" class="button-secondary" value="<?php 
esc_attr_e('Download', 'installer');
?>
" disabled="disabled" />
開發者ID:zoran180,項目名稱:wp_szf,代碼行數:31,代碼來源:downloads-list.php

示例14: prevent_plugins_update_on_updates_screen

 public function prevent_plugins_update_on_updates_screen()
 {
     if (isset($_REQUEST['action'])) {
         $action = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
         $installer_settings = WP_Installer()->settings;
         //bulk mode
         if ('update-selected' == $action) {
             global $plugins;
             if (isset($plugins) && is_array($plugins)) {
                 foreach ($plugins as $k => $plugin) {
                     $wp_plugin_slug = dirname($plugin);
                     foreach ($installer_settings['repositories'] as $repository_id => $repository) {
                         if ($this->is_win_paths_exception($repository_id)) {
                             foreach ($repository['data']['packages'] as $package) {
                                 foreach ($package['products'] as $product) {
                                     foreach ($product['plugins'] as $plugin_slug) {
                                         $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
                                         if ($download['slug'] == $wp_plugin_slug && empty($download['free-on-wporg'])) {
                                             echo '<div class="updated error"><p>' . $this->win_paths_exception_message() . ' <strong>(' . $download['name'] . ')</strong>' . '</p></div>';
                                             unset($plugins[$k]);
                                             break 3;
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if ('upgrade-plugin' == $action || 'update-plugin' == $action) {
             $plugin = isset($_REQUEST['plugin']) ? trim(sanitize_text_field($_REQUEST['plugin'])) : '';
             $wp_plugin_slug = dirname($plugin);
             foreach ($installer_settings['repositories'] as $repository_id => $repository) {
                 if ($this->is_win_paths_exception($repository_id)) {
                     foreach ($repository['data']['packages'] as $package) {
                         foreach ($package['products'] as $product) {
                             foreach ($product['plugins'] as $plugin_slug) {
                                 $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
                                 //match by folder, will change to match by name and folder
                                 if ($download['slug'] == $wp_plugin_slug && empty($download['free-on-wporg'])) {
                                     echo '<div class="updated error"><p>' . $this->win_paths_exception_message() . '</p></div>';
                                     echo '<div class="wrap">';
                                     echo '<h2>' . __('Update Plugin') . '</h2>';
                                     echo '<a href="' . admin_url('update-core.php') . '">' . __('Return to the updates page', 'installer') . '</a>';
                                     echo '</div>';
                                     require_once ABSPATH . 'wp-admin/admin-footer.php';
                                     exit;
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
開發者ID:uwmadisoncals,項目名稱:Cluster-Plugins,代碼行數:57,代碼來源:class-installer-dependencies.php

示例15: create_project

 /**
  * @param TranslationProxy_Service $service
  * @param bool                     $force
  *
  * @throw TranslationProxy_Project
  * @return TranslationProxy_Project
  */
 private static function create_project($service, $force = false)
 {
     $icl_translation_projects = self::get_translation_projects();
     $delivery_method = self::get_delivery_method();
     $delivery = $delivery_method == ICL_PRO_TRANSLATION_PICKUP_XMLRPC ? "xmlrpc" : "polling";
     $project_index = TranslationProxy_Project::generate_service_index($service);
     if (!$force && isset($icl_translation_projects[$project_index])) {
         $project = self::load_existing_project($service, $delivery);
     } else {
         $url = get_option('siteurl');
         $name = get_option('blogname');
         $description = get_option('blogdescription');
         $project = new TranslationProxy_Project($service);
         $site_key = WP_Installer()->get_site_key('wpml');
         $result = $project->create($url, $name, $description, $delivery, $site_key);
         if (!$result || count($project->errors)) {
             self::append_errors($project->errors);
             $project = false;
         }
     }
     return $project;
 }
開發者ID:aarongillett,項目名稱:B22-151217,代碼行數:29,代碼來源:translationproxy.class.php


注:本文中的WP_Installer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。