TableOn - WordPress Posts Tables Filterable. Created by shortcode: [tableon id=1]
{"mode":"ajax","ajax_url":"https:\/\/demo.wp-currency.com\/wp-admin\/admin-ajax.php","selected_lang":"en_US","table_data":[],"heads":{"id":"ID","thumbnail":"Thumbnail","post_title":"Title","custom_price":"Price"},"hide_on_mobile":[],"cells_width":["auto","auto","auto","auto"],"orders":{"id":"desc","post_title":"asc","post_status":"asc","post_date":"desc","post_modified":"desc","comment_count":"desc","_demo_price":"desc"},"editable":[],"custom_field_keys":[],"total_rows_count":10,"use_load_more":false,"css_classes":"","no_found_text":"","show_print_btn":0,"post_id":0,"compact_view_width":-1,"stop_notice":"","use_flow_header":1,"style":"","skin":"","pagination":{"position":"tb","next":{"class":"tableon-btn","content":">"},"prev":{"class":"tableon-btn","content":"<"},"input":{"class":"tableon-form-control"}},"lang":{"loading":"Loading ...","no_data":"No Data!","error":"Error!","items":"Posts","page":"Page","pages":"Pages","load_more":"Load More"},"per_page_sel_position":"tb","per_page_sel_pp":["10","20","30","40","50","60","70","80","90","100"],"print_css_url":"https:\/\/demo.wp-currency.com\/wp-content\/plugins\/posts-table\/assets\/css\/print.css","request_data":{"action":"tableon_get_table_data","fields":["id","thumbnail","post_title","custom_price"],"post_type":"post","wp_columns_actions":"tableon_default_tables","table_id":1,"predefinition":"a:1:{s:5:\u0022rules\u0022;a:0:{}}","filter_data":"","filter_provider":"default","orderby":"id","order":"desc","per_page":10,"current_page":0,"shortcode_args_set":"a:4:{s:2:\u0022id\u0022;s:1:\u00221\u0022;s:6:\u0022action\u0022;s:22:\u0022tableon_default_tables\u0022;s:13:\u0022no_found_text\u0022;s:0:\u0022\u0022;s:15:\u0022use_flow_header\u0022;i:1;}","tableon_link_get_data":"[]"}}
To make prices displayed in functions.php add next code:
|
add_action('tableon_profile_extend', function($profile, $action_name) { if ($action_name === 'tableon_default_tables') { $profile['custom_price'] = [ 'title' => TABLEON_Vocabulary::get('Price'), 'order' => FALSE, 'action' => function($post_id) { return do_shortcode("[wpcs_price meta_value=_demo_price post_id={$post_id}]"); } ]; } return $profile; }, 10, 2); |