/**
  * Output the metabox
  */
 public static function output($post)
 {
     $list = new SP_Player_List($post);
     list($columns, $data, $placeholders, $merged, $orderby) = $list->data(true);
     $adjustments = $list->adjustments;
     self::table($columns, $data, $placeholders, $adjustments, $orderby);
 }
Beispiel #2
0
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$defaults = array('id' => get_the_ID(), 'number' => -1, 'grouptag' => 'h4', 'columns' => null, 'grouping' => null, 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => false, 'show_player_photo' => get_option('prosports_list_show_photos', 'yes') == 'yes' ? true : false, 'link_posts' => get_option('prosports_link_players', 'yes') == 'yes' ? true : false, 'link_teams' => get_option('prosports_link_teams', 'no') == 'yes' ? true : false, 'sortable' => get_option('prosports_enable_sortable_tables', 'yes') == 'yes' ? true : false, 'scrollable' => get_option('prosports_enable_scrollable_tables', 'yes') == 'yes' ? true : false, 'responsive' => get_option('prosports_enable_responsive_tables', 'yes') == 'yes' ? true : false, 'paginated' => get_option('prosports_list_paginated', 'yes') == 'yes' ? true : false, 'rows' => get_option('prosports_list_rows', 10));
extract($defaults, EXTR_SKIP);
// Backward compatibility
if (isset($performance)) {
    $columns = $performance;
}
// Explode into array
if (null !== $columns && !is_array($columns)) {
    $columns = explode(',', $columns);
}
$list = new SP_Player_List($id);
if (isset($columns) && null !== $columns) {
    $list->columns = $columns;
}
$data = $list->data();
// The first row should be column labels
$labels = $data[0];
// Remove the first row to leave us with the actual data
unset($data[0]);
if ($grouping === null || $grouping === 'default') {
    $grouping = $list->grouping;
}
if ($orderby == 'default') {
    $orderby = $list->orderby;
    $order = $list->order;
} else {
function sp_get_list($post = 0)
{
    $list = new SP_Player_List($post);
    return $list->data();
}
 function sp_get_player_list_data($post_id, $admin = false)
 {
     $list = new SP_Player_List($post_id);
     return $list->data($admin);
 }