/**
  * Output the metabox
  */
 public static function output($post)
 {
     $table = new SP_League_Table($post);
     list($columns, $usecolumns, $data, $placeholders, $merged) = $table->data(true);
     $adjustments = $table->adjustments;
     $highlight = get_post_meta($table->ID, 'sp_highlight', true);
     self::table($columns, $usecolumns, $data, $placeholders, $adjustments, $highlight);
 }
function sp_get_table($post = 0)
{
    $table = new SP_League_Table($post);
    return $table->data();
}
예제 #3
0
 function sp_get_league_table_data($post_id, $admin = false)
 {
     $table = new SP_League_Table($post_id);
     return $table->data($admin);
 }
예제 #4
0
 * League Table
 *
 * @author 		ThemeBoy
 * @package 	SportsPress/Templates
 * @version     1.9.13
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$defaults = array('id' => get_the_ID(), 'number' => -1, 'columns' => null, 'highlight' => null, 'show_full_table_link' => false, 'title' => false, 'show_title' => get_option('sportspress_table_show_title', 'yes') == 'yes' ? true : false, 'show_team_logo' => get_option('sportspress_table_show_logos', 'yes') == 'yes' ? true : false, 'link_posts' => get_option('sportspress_link_teams', 'no') == 'yes' ? true : false, 'sortable' => get_option('sportspress_enable_sortable_tables', 'yes') == 'yes' ? true : false, 'scrollable' => get_option('sportspress_enable_scrollable_tables', 'yes') == 'yes' ? true : false, 'paginated' => get_option('sportspress_table_paginated', 'yes') == 'yes' ? true : false, 'rows' => get_option('sportspress_table_rows', 10));
extract($defaults, EXTR_SKIP);
if (!isset($highlight)) {
    $highlight = get_post_meta($id, 'sp_highlight', true);
}
$table = new SP_League_Table($id);
if ($show_title && false === $title && $id) {
    $caption = $table->caption;
    if ($caption) {
        $title = $caption;
    } else {
        $title = get_the_title($id);
    }
}
$output = '';
if ($title) {
    $output .= '<h4 class="sp-table-caption">' . $title . '</h4>';
}
$output .= '<div class="sp-table-wrapper">';
$output .= '<table class="sp-league-table sp-data-table' . ($sortable ? ' sp-sortable-table' : '') . ($scrollable ? ' sp-scrollable-table' : '') . ($paginated ? ' sp-paginated-table' : '') . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
$data = $table->data();