| @@ -1,53 +1,61 @@ | ||
| 1 | -<?php | |
| 2 | - /* ********************************************************** | |
| 3 | - * TABLES | |
| 4 | - * **********************************************************/ | |
| 5 | - function osc_theme_os_table( $params, $content = null) { | |
| 6 | - extract( shortcode_atts( array( | |
| 7 | - 'width' => '100%', | |
| 8 | - 'class' => '', | |
| 9 | - 'responsive' => 'false', | |
| 10 | - ), $params ) ); | |
| 11 | - $content = str_replace("]<br />",']',$content); | |
| 12 | - $out = '<table width="'.$width.'" class="table '.$class.'">'. do_shortcode($content) . '</table>'; | |
| 13 | - $out = strtolower($responsive) == 'true' ? '<div class="table-responsive">'.$out.'</div>': $out; | |
| 14 | - return $out; | |
| 15 | - } | |
| 16 | - add_shortcode( 'table', 'osc_theme_os_table' ); | |
| 17 | - | |
| 18 | - function osc_theme_os_table_head( $params, $content = null) { | |
| 19 | - $out = '<thead><tr>'. do_shortcode($content) . '</tr></thead>'; | |
| 20 | - return $out; | |
| 21 | - } | |
| 22 | - add_shortcode( 'table_head', 'osc_theme_os_table_head' ); | |
| 23 | - | |
| 24 | - | |
| 25 | - function osc_theme_os_table_body( $params, $content = null) { | |
| 26 | - $out = '<tbody>'. do_shortcode($content) . '</tbody>'; | |
| 27 | - return $out; | |
| 28 | - } | |
| 29 | - add_shortcode( 'table_body', 'osc_theme_os_table_body' ); | |
| 30 | - | |
| 31 | - function osc_theme_os_table_row( $params, $content = null) { | |
| 32 | - $out = '<tr>'; | |
| 33 | - $out .= do_shortcode($content); | |
| 34 | - $out .= '</tr>'; | |
| 35 | - return $out; | |
| 36 | - } | |
| 37 | - add_shortcode( 'table_row', 'osc_theme_os_table_row' ); | |
| 38 | - | |
| 39 | - function osc_theme_os_row_column( $params, $content = null) { | |
| 40 | - $out = '<td>'; | |
| 41 | - $out .= $content; | |
| 42 | - $out .= '</td>'; | |
| 43 | - return $out; | |
| 44 | - } | |
| 45 | - add_shortcode( 'row_column', 'osc_theme_os_row_column' ); | |
| 46 | - | |
| 47 | - function osc_theme_os_th_column( $params, $content = null) { | |
| 48 | - $out = '<th>'; | |
| 49 | - $out .= $content; | |
| 50 | - $out .= '</th>'; | |
| 51 | - return $out; | |
| 52 | - } | |
| 53 | - add_shortcode( 'th_column', 'osc_theme_os_th_column' ); | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/* * ********************************************************* | |
| 4 | + * TABLES | |
| 5 | + * ********************************************************* */ | |
| 6 | + | |
| 7 | +function osc_theme_os_table($params, $content = null) { | |
| 8 | + extract(shortcode_atts(array( | |
| 9 | + 'width' => '100%', | |
| 10 | + 'style' => '', | |
| 11 | + 'responsive' => 'false', | |
| 12 | + 'class' => '' | |
| 13 | + ), $params)); | |
| 14 | + $content = str_replace("]<br />", ']', $content); | |
| 15 | + $out = '<table width="' . $width . '" class="table ' . $style . ' '.$class.'">' . do_shortcode($content) . '</table>'; | |
| 16 | + $out = strtolower($responsive) == 'true' ? '<div class="table-responsive">' . $out . '</div>' : $out; | |
| 17 | + return $out; | |
| 18 | +} | |
| 19 | + | |
| 20 | +add_shortcode('table', 'osc_theme_os_table'); | |
| 21 | + | |
| 22 | +function osc_theme_os_table_head($params, $content = null) { | |
| 23 | + $out = '<thead><tr>' . do_shortcode($content) . '</tr></thead>'; | |
| 24 | + return $out; | |
| 25 | +} | |
| 26 | + | |
| 27 | +add_shortcode('table_head', 'osc_theme_os_table_head'); | |
| 28 | + | |
| 29 | +function osc_theme_os_table_body($params, $content = null) { | |
| 30 | + $out = '<tbody>' . do_shortcode($content) . '</tbody>'; | |
| 31 | + return $out; | |
| 32 | +} | |
| 33 | + | |
| 34 | +add_shortcode('table_body', 'osc_theme_os_table_body'); | |
| 35 | + | |
| 36 | +function osc_theme_os_table_row($params, $content = null) { | |
| 37 | + $out = '<tr>'; | |
| 38 | + $out .= do_shortcode($content); | |
| 39 | + $out .= '</tr>'; | |
| 40 | + return $out; | |
| 41 | +} | |
| 42 | + | |
| 43 | +add_shortcode('table_row', 'osc_theme_os_table_row'); | |
| 44 | + | |
| 45 | +function osc_theme_os_row_column($params, $content = null) { | |
| 46 | + $out = '<td>'; | |
| 47 | + $out .= do_shortcode($content); | |
| 48 | + $out .= '</td>'; | |
| 49 | + return $out; | |
| 50 | +} | |
| 51 | + | |
| 52 | +add_shortcode('row_column', 'osc_theme_os_row_column'); | |
| 53 | + | |
| 54 | +function osc_theme_os_th_column($params, $content = null) { | |
| 55 | + $out = '<th>'; | |
| 56 | + $out .= do_shortcode($content); | |
| 57 | + $out .= '</th>'; | |
| 58 | + return $out; | |
| 59 | +} | |
| 60 | + | |
| 61 | +add_shortcode('th_column', 'osc_theme_os_th_column'); | |