'' ) , $atts) ); /* no id has been set , nothing more to do here */ if( empty($id) ) return; /* set token */ self::$token = $id; /* initiate shortcode markup */ self::$add_pricing_markup = true; return self::create_pricing_table(); } static function create_pricing_table() { /* table content */ $table_data = get_post_meta( self::$token , 'ut_table_data' ); $table_data = $table_data[0]; /* count active columns */ $active_cols = NULL; foreach( $table_data as $column ) { if( !empty($column['activate_column']) && $column['activate_column'] == 'on') { $active_cols++; } } /* grid array */ $grid = array( 1 => '', 2 => 'grid-50 tablet-grid-50 mobile-grid-100', 3 => 'grid-33 tablet-grid-33 mobile-grid-100', 4 => 'grid-25 tablet-grid-50 mobile-grid-100' ); /* start table*/ $table = '
'; /* create table columns */ foreach( $table_data as $column ) { if( !empty($column['activate_column']) && $column['activate_column'] == 'on') { $table .= '
'; /* featured table */ if( !empty($column['featured_column']) && $column['featured_column'] == 'on' ) : $featured = !empty($column['featured_headline']) ? $column['featured_headline'] : __('Most Popular' , 'ut_table_lang'); $table .= ''; } } $table .= '
'; $table .= '
'; return $table; } } ut_table_shortcode::init(); ?>