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


PHP TablePress::load_file方法代碼示例

本文整理匯總了PHP中TablePress::load_file方法的典型用法代碼示例。如果您正苦於以下問題:PHP TablePress::load_file方法的具體用法?PHP TablePress::load_file怎麽用?PHP TablePress::load_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TablePress的用法示例。


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

示例1: defined

<?php

/**
 * TablePress WP User Option Wrapper class for WordPress Options
 *
 * Wraps the WordPress Options API, so that (especially) arrays are stored as JSON, instead of being serialized by PHP.
 *
 * @package TablePress
 * @subpackage Classes
 * @author Tobias Bäthge
 * @since 1.0.0
 */
// Prohibit direct script loading.
defined('ABSPATH') || die('No direct script access allowed!');
// Load parent class.
TablePress::load_file('class-wp_option.php', 'classes');
/**
 * TablePress WP User Option Wrapper class
 * @package TablePress
 * @subpackage Classes
 * @author Tobias Bäthge
 * @since 1.0.0
 */
class TablePress_WP_User_Option extends TablePress_WP_Option
{
    /**
     * Get the value of a WP User Option with the WP User Options API.
     *
     * @since 1.0.0
     *
     * @param string $option_name   Name of the WP User Option.
開發者ID:pab44,項目名稱:pab44,代碼行數:31,代碼來源:class-wp_user_option.php

示例2: import_xlsx

 /**
  * Import Microsoft Excel 2007-2013 data
  *
  * @since 1.1.0
  */
 protected function import_xlsx()
 {
     TablePress::load_file('simplexlsx.class.php', 'libraries');
     $simplexlsx = new SimpleXLSX($this->import_data, true);
     if ($simplexlsx->success() && 0 < $simplexlsx->sheetsCount()) {
         // Get Worksheet ID of the first Worksheet (not necessarily "1", which is the default in SimpleXLSX)
         $sheet_ids = array_keys($simplexlsx->sheetNames());
         $worksheet_id = $sheet_ids[0];
         $this->imported_table = array('data' => $this->pad_array_to_max_cols($simplexlsx->rows($worksheet_id)));
     } else {
         $output = '<strong>' . __('The imported file contains errors:', 'tablepress') . '</strong><br /><br />' . $simplexlsx->error() . '<br />';
         wp_die($output, 'Import Error', array('response' => 200, 'back_link' => true));
     }
 }
開發者ID:heyjones,項目名稱:crossfitpurpose,代碼行數:19,代碼來源:class-import.php


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