Beispiel #1
0
<?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.
 /**
  * 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));
     }
 }