'table', 'attrtag' => 'attr', 'tablewidget' => false, 'scriptloadin' => Array('is_single','is_page'), 'class' => '', 'caption' => false, 'width' => '100%', 'align' => 'left', 'th' => true, 'tf' => false, 'border' => 0, 'id' => false, 'theme' => 'default', 'tablesorter' => false, 'loadcss' => true, 'scriptinfooter'=> false, 'delimiter' => ',', 'file' => false, 'trim' => false, /*trim, since 1.0*/ 'enclosure' => '"', 'escape' => '\\', 'nl' => '~~', 'csvfile' => false, 'terminator' => '\n', /*row terminator, since 1.0*/ 'limit' => 0, /*max row to be included to table, 0 = unlimited, since 1.0*/ 'fixlinebreak' => false ); function __construct(){ $plugin = plugin_basename(__FILE__); add_filter("plugin_action_links_$plugin", array(&$this,'easy_table_settings_link' )); load_plugin_textdomain('easy-table', false, basename( dirname( __FILE__ ) ) . '/languages' ); add_action('admin_init', array(&$this,'easy_table_register_setting')); add_action('admin_head', array(&$this,'easy_table_admin_script')); add_action('wp_enqueue_scripts', array(&$this,'easy_table_script')); add_action('wp_enqueue_scripts', array(&$this,'easy_table_style')); add_action('admin_menu', array(&$this,'easy_table_add_page')); add_action('contextual_help', array(&$this,'easy_table_help')); include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); include_once( dirname(__FILE__) . '/inc/compatibility.php' ); /* since 1.5.2 */ $conflict = false; if ( shortcode_exists( $this->option('shortcodetag') ) ) { add_action('admin_notices', array(&$this,'easy_table_shortcode_check_notice')); $conflict = true; } if (is_plugin_active('tablepress/tablepress.php') AND ('table' == strtolower($this->option('shortcodetag')) ) ) { add_action('admin_notices', array(&$this,'easy_table_shortcode_check_notice_tablepress')); $conflict = true; } if ( !$conflict ) { add_shortcode($this->option('shortcodetag'), array(&$this,'easy_table_short_code')); } if ( shortcode_exists( $this->option('attrtag') ) ) { add_action('admin_notices', array(&$this,'easy_table_attr_shortcode_check_notice')); } else { add_shortcode($this->option('attrtag'), array(&$this,'easy_table_short_code_attr')); } if($this->option('tablewidget')){ add_filter('widget_text', 'do_shortcode'); } $table_shortcodetag_already_exists = false; } private function easy_table_base($return){ $easy_table_base = Array( 'name' => 'Easy Table', 'version' => '1.8', 'plugin-domain' => 'easy-table' ); return $easy_table_base[$return]; } function easy_table_shortcode_check_notice() { $shortcode = $this->option('shortcodetag'); ?>

Easy Table: Click here to fix it.','easy-table'), '['.$shortcode.']','Easy Table','Easy Table short code tag',''.$shortcode.'','options-general.php?page=easy-table');?>

Easy Table: Click here to fix it.','easy-table'), '['.$shortcode.']','Easy Table','Easy Table short code tag',''.$shortcode.'','options-general.php?page=easy-table');?>

option('attrtag'); ?>

Easy Table: Click here to fix it.','easy-table'), '['.$shortcode.']','Easy Table','Easy Table cell attribute tag',''.$shortcode.'','options-general.php?page=easy-table');?>

$this->option('class'), 'caption' => $this->option('caption'), 'width' => $this->option('width'), 'th' => $this->option('th'), 'tf' => $this->option('tf'), 'border' => $this->option('border'), 'id' => $this->option('id'), 'theme' => $this->option('theme'), 'tablesorter' => $this->option('tablesorter'), 'delimiter' => $this->option('delimiter'), 'enclosure' => $this->option('enclosure'), 'escape' => $this->option('escape'), 'file' => $this->option('file'), 'trim' => $this->option('trim'), 'sort' => '', 'nl' => $this->option('nl'), 'ai' => false, 'terminator' => $this->option('terminator'), 'limit' => $this->option('limit'), 'align' => $this->option('align'), 'style' => '', /*table inline style, since 1.0*/ 'colalign' => '', /*column align, ex: [table colalign="left|right|center"], @since 1.0*/ 'colwidth' => '', /*column width, ex: [table colwidth="100|200|300"], @since 1.0*/ 'fixlinebreak' => $this->option('fixlinebreak'), /* fix linebreak on cell if terminator is not \n or \r @since 1.1.4 */ 'exclude_row' => '', 'exclude_col' => '', ), $atts); /** * because clean_pre is deprecated since WordPress 3.4, then replace it manually $content = clean_pre($content);*/ $content = str_replace(array('
', '
', '
'), array('', '', ''), $content); $content = str_replace('

', "\n", $content); $content = str_replace('

', '', $content); $content = str_replace(' ','',$content); $char_codes = array( '‘', '’', '“', '”', '′', '″' ); $replacements = array( "'", "'", '"', '"', "'", '"' ); $content = str_replace( $char_codes, $replacements, $content ); return $this->csv_to_table($content,$shortcode_atts); } /** * Just return to strip attr shortcode for table cell, since we use custom regex for attr shortcode. * @since 0.5 */ function easy_table_short_code_attr($atts){ return; } /** * Convert CSV to table * @param array|string $data could be CSV string or array * @param array @args * @return string */ private function csv_to_table($data,$args){ extract($args); /** check param value if it is expected to be boolean * @since: 1.6 **/ $th = filter_var($th, FILTER_VALIDATE_BOOLEAN); $trim = filter_var($trim, FILTER_VALIDATE_BOOLEAN); if($tf !== 'last') { $tf = filter_var($tf, FILTER_VALIDATE_BOOLEAN); } if( $this->option('csvfile') AND $file ){ /*$data = @file_get_contents($file);*/ /** use wp_remote_get * @since 0.8 */ $data = ''; $response = wp_remote_get( $file, array('sslverify'=>false) ); /** notify if error reading file. @since 0.9 */ if( is_wp_error( $response ) ) { return '
Error reading file/URL.
'; } else if( $response['response']['code'] == 200 ) { $data = $response['body']; } } if(!is_array($data)){ /** normalize nl, since it may contains new line. @since 0.9 */ $data = preg_replace('/'.preg_quote($nl).'([\s\r\n\t]+)?/i',$nl,$data); /* Fix encoding? @since: 1.0 beta */ require_once (dirname(__FILE__).'/inc/Encoding.php'); //$data = ForceEncode::fixUTF8($data); $data = ForceEncode::toUTF8($data); /* convert csv to array. */ $data = $this->csv_to_array(trim($data), $delimiter, $enclosure, $escape, $terminator, $limit); } if(empty($data)) return false; /** exclude row or col * @since: 1.6 **/ if( $exclude_row ) { $exclude_row = explode(',',$exclude_row); foreach( $exclude_row as $x_row ) { if(isset($data[$x_row-1])) { unset($data[$x_row-1]); } } } if( $exclude_col ) { $exclude_col = explode(',',$exclude_col); } $max_cols = count(max($data)); $r=0; /** * initialize inline sort, * extract header sort if any, and equalize with max column number * @since 0.8 */ if( $tablesorter ) { $inline_sort = Array(); $header_sort = explode(',',$sort); $header_sort = array_pad($header_sort,$max_cols,NULL); } /** * tfoot position * @since 0.4 */ $tfpos = ($tf == 'last') ? count($data) : ($th?2:1); /** * add auto width * @since 1.1.3 */ if ( 'auto' !== $width ) { $width = (stripos($width,'%') === false) ? (int)$width.'px' : (int)$width.'%'; } /*colalign & colwidth @since 1.0 */ if($colalign) { $c_align = explode('|',$colalign); } if($colwidth) { $c_width = explode('|',$colwidth); } /* added back $align, with new way of implementation, * @since 1.4 */ $style = rtrim($style, ';'); switch ($align) : case 'center': $alignstyle = '; margin-left:auto;margin-right:auto'; break; case 'right': $alignstyle = '; margin-left:auto;margin-right:0'; break; default: $alignstyle = ''; break; endswitch; $style = $style.$alignstyle; /* wrap with .table-responsive div, since 1.5 */ $output = '
'; $output .= ''."\n"; $output .= $caption ? ''."\n" : ''; $output .= $th ? '' : (($tf !== 'last') ? '' : ''); $output .= (!$th AND !$tf) ? '':''; foreach($data as $k=>$cols){ $r++; //$cols = array_pad($cols,$max_cols,''); // exclude cols, @since: 1.6 if(is_array($exclude_col)) { foreach( $exclude_col as $x_col ) { if(isset($cols[$x_col-1])) { unset($cols[$x_col-1]); } } } $output .= (($r==$tfpos) AND $tf) ? (($tf=='last')?'':'').'': ''; $output .= "\r\n".''; $thtd = ((($r==1) AND $th) OR (($r==$tfpos) AND $tf)) ? 'th' : 'td'; /** ai is auto index @since 0.9 add auto numbering in the begining of each row ai="true" or ai="1" number will start from 1, ai="n", n = any number, number will start from that. Another possible value. ai="n/head/width" n = index start head = head text, default is No. width = column width, in pixel. Default is 20px ai head, text to shown in the table head row, default is No. */ $index = explode('/',$ai); $indexnum = ((int)$index[0])+$r; $indexnum = $th ? $indexnum-2 : $indexnum-1; $indexnum = ($tf AND ($tf !== 'last')) ? $indexnum-1 : $indexnum; $indexhead = isset($index[1]) ? $index[1] : 'No.'; $indexwidth = isset($index[2]) ? (int)$index[2] : 30; $output .= ($ai AND ($thtd == 'td')) ? '<'.$thtd.' style="width:'.$indexwidth.'px">'.$indexnum."" : ($ai ? "<$thtd>".$indexhead."" : ''); foreach($cols as $c=>$cell){ /** * Add attribute for each cell * @since 0.5 */ //preg_match('/\['.$this->option('attrtag').' ([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)/',$cell,$matchattr); preg_match('/\['.$this->option('attrtag').' ([^\\]]*)/',$cell,$matchattr); $attr = isset($matchattr[1]) ? $matchattr[1] : ''; /** * extract $attr value * @since 0.8 * this is for inline sorting option, * eg [attr sort="desc"],[attr sort="asc"] or [attr sort="none"] * only affect if it's TH and $tablesorter enabled * extract sort value and insert appropriate class value. */ if( ('th' == $thtd) AND $tablesorter ) { $attrs = $attr ? shortcode_parse_atts($attr) : Array(); $attrs['sort'] = isset($attrs['sort']) ? $attrs['sort'] : $header_sort[$c]; $attrs['class'] = isset($attrs['class']) ? $attrs['class'] : ''; $inline_sort[$c] = $attrs['sort']; $attr = ''; $sorter = in_array(strtolower($attrs['sort']),array('desc','asc')) ? '' : (!empty($attrs['sort']) ? 'false' : ''); foreach($attrs as $katr => $vatr){ if($katr == 'sort') { } else if(($katr == 'class')){ $attr .= "$katr='$vatr "; $attr .= $sorter ? "{sorter: $sorter}":''; $attr .= "' "; } else { $attr .= "$katr='$vatr' "; } } } /** nl, replace nl with new line @since 0.9 */ $cell = str_replace($nl,'
',$cell); /*trim cell content? @since 1.0 */ $cell = $trim ? trim(str_replace(' ','',$cell)) : $cell; /*nl2br? only if terminator is not \n or \r*/ /* optionally, if $fixlinebreak is set. @since 1.1.4 */ if ( $fixlinebreak ) { if(( '\n' !== $terminator ) OR ( '\r' !== $terminator )) { $cell = nl2br($cell); } } /*colalign @since 1.0 */ if (isset($c_align[$c]) AND (stripos($attr,'text-align') === false)) { if(stripos($attr,'style') === false) { $attr = $attr. ' style="text-align:'.$c_align[$c].'" '; } else { $attr = preg_replace('/style(\s+)?=(\s+)?("|\')(\s+)?/i','style=${3}text-align:'.$c_align[$c].';',$attr); } } /*colwidth @since 1.0 */ if (isset($c_width[$c]) AND (stripos($attr,'width') === false) AND ($r == 1)) { $c_width[$c] = (stripos($c_width[$c],'%') === false) ? (int)$c_width[$c].'px' : (int)$c_width[$c].'%'; if(stripos($attr,'style') === false) { $attr = $attr. ' style="width:'.$c_width[$c].'" '; } else { $attr = preg_replace('/style(\s+)?=(\s+)?("|\')(\s+)?/i','style=${3}width:'.$c_width[$c].';',$attr); } } $output .= "<$thtd $attr>".do_shortcode($cell)."\n"; } $output .= ''."\n"; $output .= (($r==1) AND $th) ? ''."\n".'' : ''; $output .= (($r==$tfpos) AND $tf) ? ''.((($tf==1) AND !$th) ? '':''): ''; } $output .= (($tf!=='last')?'':'').'
'.$caption.'
'; /** * Build sortlist metadata and append it to the table class * @since 0.8 * This intended to $tablesorter, * so don't bother if $tablesorter is false/disabled */ if( $tablesorter ) { $sortlist = ''; $all_sort = array_replace($header_sort,$inline_sort); if(implode('',$all_sort)) { $sortlist = '{sortlist: ['; foreach($all_sort as $k=>$v){ $v = (($v == 'desc') ? 1 : (($v == 'asc') ? 0 : '' )); if($v !=='') { $sortlist .= '['.$k.','.$v.'], '; } } $sortlist .= ']}'; } $output = str_replace('__sortlist__',$sortlist,$output); } return $output; } /** * Convert CSV to array */ private function csv_to_array($csv, $delimiter = ',', $enclosure = '"', $escape = '\\', $terminator = "\n", $limit = 0 ) { $r = array(); $terminator = ($terminator == '\n') ? "\n" : $terminator; $terminator = ($terminator == '\r') ? "\r" : $terminator; $terminator = ($terminator == '\t') ? "\t" : $terminator; $rows = easy_table_str_getcsv($csv, $terminator,$enclosure,$escape); $rows = array_diff($rows,Array('')); /* * limit how many rows will be included? * default 0, means ulimited. * @since 1.0 */ if($limit > 0) { $rows = array_slice($rows, 0, $limit); } foreach($rows as &$row) { $r[] = easy_table_str_getcsv($row,$delimiter); } return $r; } /** * Retrieve options from database if any, or use default options instead. */ function option($key=''){ $option = get_option('easy_table_plugin_option') ? get_option('easy_table_plugin_option') : Array(); $option = array_merge($this->settings,$option); if($key){ $return = $option[$key]; } else{ $return = $option; } return $return; } /** * Retrieve themes directory * @since: 0.8 */ function themes(){ /** * delete theme cache on setting updated. */ if( ( 'easy-table' == $_GET['page']) AND isset($_GET['settings-updated']) ) { delete_transient('easy_table_themes'); } if(!function_exists('scandir')){ return Array('default'); } if ( false === ( $themes = get_transient( 'easy_table_themes' ) )) { $dir = plugin_dir_path(__FILE__).'themes/'; $dirs = scandir($dir); foreach($dirs as $d){ if( (substr($d,0,1) !=='.') AND (is_dir($dir.$d)) ) { $themes[] = $d; } } set_transient( 'easy_table_themes', $themes , 86400 ); } return $themes; } /** * Register plugin setting * @since: 1.7 add sanitize_callback */ function easy_table_register_setting() { $args = array('sanitize_callback'=> array(&$this,'easy_table_sanitize_callback')); register_setting('easy_table_option_field', 'easy_table_plugin_option', $args); } /** * Add sanitize_callback to register_setting to filter the options value * @since: 1.7 */ function easy_table_sanitize_callback ( $value ) { return filter_var( $value,FILTER_CALLBACK, array("options"=>"strip_tags")); } /** * Render form * @param array */ function render_form($fields){ $output =''; foreach($fields as $field){ $field['rowclass'] = isset($field['rowclass']) ? $field['rowclass'] : false; $field['label'] = isset($field['label']) ? $field['label'] : ''; if($field['type']=='text'){ $output .= ''; $output .= ''; } if($field['type']=='checkbox'){ $output .= ''; $output .= ''; } if($field['type']=='checkboxgroup'){ $output .= ''; $output .= ''; } if($field['type'] == 'select'){ $output .= ''; $output .= ''; } } $output .= '
'; $output .= ' ?
'; $output .= ' ?
'; foreach($field['groupitem'] as $key=>$item){ $output .= '
'; } $output .= ' ?
'; $output .= ''; $output .= ' ?
'; return $output; } /** * Register javascript */ function easy_table_script() { if( is_single() AND in_array('is_single',$this->option('scriptloadin')) OR is_page() AND in_array('is_page',$this->option('scriptloadin')) OR is_home() AND in_array('is_home',$this->option('scriptloadin')) OR is_archive() AND in_array('is_archive',$this->option('scriptloadin')) OR is_search() AND in_array('is_search',$this->option('scriptloadin')) ) { if($this->option('tablesorter')) { wp_enqueue_script('easy_table_script',plugins_url( 'js/easy-table-script.js' , __FILE__ ),array('jquery'),$this->easy_table_base('version'),$this->option('scriptinfooter')); } } } /** * Register stylesheet */ function easy_table_style() { if( is_single() AND in_array('is_single',$this->option('scriptloadin')) OR is_page() AND in_array('is_page',$this->option('scriptloadin')) OR is_home() AND in_array('is_home',$this->option('scriptloadin')) OR is_archive() AND in_array('is_archive',$this->option('scriptloadin')) OR is_search() AND in_array('is_search',$this->option('scriptloadin')) ) { if($this->option('loadcss')) { wp_enqueue_style('easy_table_style', plugins_url('themes/'.$this->option('theme').'/style.css', __FILE__),false,$this->easy_table_base('version')); } } } function easy_table_admin_script(){ $page = isset($_GET['page']) ? $_GET['page'] : ''; if($page == $this->easy_table_base('plugin-domain')) { if($this->option('tablesorter')) { ?> option('loadcss')) { ?> easy_table_base('plugin-domain').'">'.__('Settings','easy-table').''; array_unshift($links, $settings_link); return $links; } /** * Contextual help */ function easy_table_help($help) { $page = isset($_GET['page']) ? $_GET['page'] : ''; if($page == $this->easy_table_base('plugin-domain')) { $help = '

'.$this->easy_table_base('name').' '.$this->easy_table_base('version').'

'; $help .= '
'.__('Instruction','easy-table').':
  1. '.__('Once plugin installed, go to plugin options page to configure some options','easy-table').'
  2. '; $help .= '
  3. '.__('You are ready to write a table in post or page.','easy-table').'
  4. '; $help .= '
  5. '.__('To be able write table in widget you have to check Enable render table in widget option in the option page.','easy-table').'
'; return $help; } } /** * Add plugin page */ function easy_table_add_page() { add_options_page($this->easy_table_base('name'), $this->easy_table_base('name'), 'administrator', $this->easy_table_base('plugin-domain'), array(&$this,'easy_table_page')); } /** * Plugin option page */ function easy_table_page() { ?>

'easy_table_plugin_option[shortcodetag]', 'label' => __('Short code tag','easy-table'), 'type' => 'text', 'description' => __('Shortcode tag, type \'table\' if you want to use [table] short tag.','easy-table'), 'value' => $this->option('shortcodetag') ) , Array( 'name' => 'easy_table_plugin_option[attrtag]', 'label' => __('Cell attribute tag','easy-table'), 'type' => 'text', 'description' => __('Cell attribute tag, default is attr.','easy-table'), 'value' => $this->option('attrtag') ) ,Array( 'name' => 'easy_table_plugin_option[tablewidget]', 'label' => __('Also render table in widget?','easy-table'), 'type' => 'checkbox', 'description' => __('Check this if you want the table could be rendered in widget.','easy-table'), 'value' => 1, 'attr' => $this->option('tablewidget') ? 'checked="checked"' : '') ,Array( 'type' => 'checkboxgroup', 'grouplabel' => __('Only load JS/CSS when in this condition','easy-table'), 'description' => __('Please check in where JavaScript and CSS should be loaded','easy-table'), 'groupitem' => Array( Array( 'name' => 'easy_table_plugin_option[scriptloadin][]', 'label' => __('Single','easy-table'), 'value' => 'is_single', 'attr' => in_array('is_single',$this->option('scriptloadin')) ? 'checked="checked"' : '' ), Array( 'name' => 'easy_table_plugin_option[scriptloadin][]', 'label' => __('Page','easy-table'), 'value' => 'is_page', 'attr' => in_array('is_page',$this->option('scriptloadin')) ? 'checked="checked"' : '' ), Array( 'name' => 'easy_table_plugin_option[scriptloadin][]', 'label' => __('Front page','easy-table'), 'value' => 'is_home', 'attr' => in_array('is_home',$this->option('scriptloadin')) ? 'checked="checked"' : '' ), Array( 'name' => 'easy_table_plugin_option[scriptloadin][]', 'label' => __('Archive page','easy-table'), 'value' => 'is_archive', 'attr' => in_array('is_archive',$this->option('scriptloadin')) ? 'checked="checked"' : '' ), Array( 'name' => 'easy_table_plugin_option[scriptloadin][]', 'label' => __('Search page','easy-table'), 'value' => 'is_search', 'attr' => in_array('is_search',$this->option('scriptloadin')) ? 'checked="checked"' : '' ) ) ) ,Array( 'name' => 'easy_table_plugin_option[scriptinfooter]', 'label' => __('Load script on footer?','easy-table'), 'type' => 'checkbox', 'description' => __('Check this if you want the script to be rendered in footer. Try to check or uncheck this if you experienced conflict with another JavaScript library (not guaranteed though).','easy-table'), 'value' => 1, 'attr' => $this->option('scriptinfooter') ? 'checked="checked"' : '' ) ); echo $this->render_form($fields); $fields = Array( Array( 'name' => 'easy_table_plugin_option[tablesorter]', 'label' => __('Use tablesorter?','easy-table'), 'type' => 'checkbox', 'value' => 1, 'description' => __('Check this to use tablesorter jQuery plugin','easy-table'), 'attr' => $this->option('tablesorter') ? 'checked="checked"':'') ,Array( 'name' => 'easy_table_plugin_option[th]', 'label' => __('Use TH for the first row?','easy-table'), 'type' => 'checkbox', 'value' => 1, 'description' => __('Check this if you want to use first row as table head (required by tablesorter)','easy-table'), 'attr' => $this->option('th') ? 'checked="checked"' : '') ,Array( 'name' => 'easy_table_plugin_option[loadcss]', 'label' => __('Load CSS?','easy-table'), 'type' => 'checkbox', 'value' => 1, 'description' => __('Check this to use CSS included in this plugin to styling table, you may unceck if you want to write your own style.','easy-table'), 'attr' => $this->option('loadcss') ? 'checked="checked"':'') ,Array( 'name' => 'easy_table_plugin_option[class]', 'label' => __('Table class','easy-table'), 'type' => 'text', 'description' => __('Additional table class attribute.','easy-table'), 'value' => $this->option('class')) ,Array( 'name' => 'easy_table_plugin_option[width]', 'label' => __('Table width','easy-table'), 'type' => 'text', 'description' => __('Table width, in pixel or percent (may be overriden by CSS)','easy-table'), 'value' => $this->option('width')) ,Array( 'name' =>'easy_table_plugin_option[border]', 'label' => __('Table border','easy-table'), 'type' => 'text', 'description' => __('Table border (may be overriden by CSS)','easy-table'), 'value' => $this->option('border')) ,Array( 'name' =>'easy_table_plugin_option[align]', 'label' => __('Table align','easy-table'), 'type' => 'text', 'description' => __('Table align (left, center, right)','easy-table'), 'value' => $this->option('align')) ); ?>

render_form($fields); ?>

'easy_table_plugin_option[theme]', 'label' => __('Default theme','easy-table'), 'type' => 'select', 'value' => $this->option('theme'), 'values' => array_combine($this->themes(),$this->themes()), 'description' => __('Select default theme of the table','easy-table') ) ); echo $this->render_form($fields); ?>

'easy_table_plugin_option[limit]', 'label' => __('Row limit','easy-table'), 'type' => 'text', 'value' => $this->option('limit'), 'rowclass' => 'new', 'description' =>__('Max row to convert to table, default 0 (unlimited)','easy-table') ), Array( 'name' => 'easy_table_plugin_option[trim]', 'label' => __('Trim cell data?','easy-table'), 'type' => 'checkbox', 'value' => 1, 'attr' => $this->option('trim') ? 'checked="checked"':'', 'rowclass' => 'new', 'description' =>__('Trim empty character around cell data','easy-table') ), ); echo $this->render_form($fields); ?>

'easy_table_plugin_option[nl]', 'label' => __('New line replacement','easy-table'), 'type' => 'text', 'value' => $this->option('nl'), 'description' => __('Since new line is used by parser, you need specify character as a replacement.','easy-table')) ,Array( 'name' => 'easy_table_plugin_option[terminator]', 'label' => __('Row terminator','easy-table'), 'type' => 'text', 'value' => $this->option('terminator'), 'rowclass' => 'new', 'description' => __('This caharacter will converted into new row. Default value \n (this is invisible character when you press Enter). If your new line not converted as new row in the table, try use \r instead.','easy-table')) ,Array( 'name' => 'easy_table_plugin_option[delimiter]', 'label' => __('Delimiter','easy-table'), 'type' => 'text', 'value' => $this->option('delimiter'), 'description' => __('CSV delimiter (default is comma)','easy-table')) ,Array( 'name' => 'easy_table_plugin_option[enclosure]', 'label' => __('Enclosure','easy-table'), 'type' => 'text', 'value' => htmlentities($this->option('enclosure')), 'description' => __('CSV enclosure (default is double quote)','easy-table')) ,Array( 'name' => 'easy_table_plugin_option[escape]', 'label' => __('Escape','easy-table'), 'type' => 'text', 'value' => $this->option('escape'), 'description' =>__('CSV escape (default is backslash)','easy-table')) ,Array( 'name' => 'easy_table_plugin_option[fixlinebreak]', 'label' => __('Fix linebreak','easy-table'), 'type' => 'checkbox', 'value' => 1, 'description' => __('If terminator is not default (linebreak), you may encounter some issue with linebreak inside cell, try to check or uncheck this to resolve','easy-table'), 'attr' => $this->option('fixlinebreak') ? 'checked="checked"' : '') ,Array( 'name' => 'easy_table_plugin_option[csvfile]', 'label' => __('Allow read CSV from file?','easy-table'), 'type' => 'checkbox', 'value' => 1, 'description' => __('Check this if you also want to convert CSV file to table','easy-table'), 'attr' => $this->option('csvfile') ? 'checked="checked"' : '') ); echo $this->render_form($fields); ?>

'); } if(isset($_POST['test-easy-table-reset'])){ $tableexample = $defaulttableexample; } ?>

[table param1="param-value1" param2="param-value2"]table data[/table]

  1. class, 'table-striped', table-bordered, table-striped, table-condensed
  2. caption, ''
  3. width, '100%'
  4. align, 'left'
  5. th, 'true'
  6. tf, 'false'
  7. border, '0'
  8. id, 'false'
  9. tablesorter, 'false'
  10. file, 'false'
  11. sort, ''
  12. trim, false
  13. style, ''
  14. limit, 0
  15. terminator, \n
  16. colalign, '', see example on the test area
  17. colwidth, '', see example on the test area
  18. exclude_row, '', comma separated value, ex: exclude_row="1,3,5"
  19. exclude_col, '', comma separated value, ex: exclude_col="1,3,5"

sort

  1. [table sort="desc,asc"]
    col1,col2,col3
    col4,col5,col6
    [/table]
  2. [table sort=",desc,asc"]
    col1,col2,col3
    col4,col5,col6
    [/table]

  1. attr,

    :

    [table]
    col1,col2[attr style="width:200px" class="someclass"],col3
    col4,col5,col6
    [/table]
    
  2. attr sort,

    [table]
    col1,col2[attr sort="desc"],col3
    col4,col5,col6
    [/table]
    

    [table]
    col1[attr sort="false"],col2,col3
    col4,col5,col6
    [/table]
    

To ask question, please visit this plugin support on WordPress.org

'easy-table' )); ?>

easy_table_base('name') .' ' . $this->easy_table_base('version'); ?>

download_link) && ( current_user_can('install_plugins') || current_user_can('update_plugins') ) ) : ?>

' . __('Install Now') . ''; break; case 'update_available': if ( $status['url'] ) echo '' . __('Install Update Now') .''; break; case 'newer_installed': echo '' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . ''; break; case 'latest_installed': echo '' . __('Latest Version Installed') . ''; break; } ?>

rating) ) : ?>

<?php esc_attr_e('5 stars') ?>
<?php esc_attr_e('4 stars') ?>
<?php esc_attr_e('3 stars') ?>
<?php esc_attr_e('2 stars') ?>
<?php esc_attr_e('1 star') ?>
num_ratings), number_format_i18n($api->num_ratings)); ?>

:

:

0) { $array+=func_get_arg($n); } return $array; } }