本文整理汇总了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.
示例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));
}
}