PluginProbe
Easy Bootstrap Shortcode / 3.7
Easy Bootstrap Shortcode v3.7
trunk 2.4.0 2.5 3.4 3.5 3.6 3.7 4.0.0 4.4 4.5 4.5.4 5.0.0 5.0.1 5.0.2
easy-bootstrap-shortcodes / shortcode / tables / plugin_shortcode.php

plugin_shortcode.php in Easy Bootstrap Shortcode 3.7, at shortcode/tables/plugin_shortcode.php

62 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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');
62