Title: Using variable narrowing table
Last modified: August 30, 2016

---

# Using variable narrowing table

 *  [dstuncer](https://wordpress.org/support/users/dstuncer/)
 * (@dstuncer)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/)
 * Hi,
    Sorry for my poor english. How do i use variables (ie current_date()) for
   narrow tables. Can Narrow_keyword accept variables.
 * [https://wordpress.org/plugins/custom-database-tables/](https://wordpress.org/plugins/custom-database-tables/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [ka2](https://wordpress.org/support/users/ka2/)
 * (@ka2)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604116)
 * Thank you for your inquiry.
 * If you want to use a variables in the shortcode, you need to code the shortcode
   by PHP.
    For example;
 *     ```
       <?php
       $shortcode = sprintf('[cdbt-view table="your_table_name" narrow_keyword="%s"]', current_date());
       echo do_shortcode($shortcode);
       ```
   
 * You will be using the plugins that can embed code of php into the post content,
   before you embed the code above. Or otherwise, you can be achieved by embedding
   the above code into the specific posts, as using “functions.php” of your theme.
 * Thank you,
 *  Thread Starter [dstuncer](https://wordpress.org/support/users/dstuncer/)
 * (@dstuncer)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604148)
 * Thanks a lot for the answer, it will be very useful for me.
 * In this case a have some problems when i upgraded plugin from 1.1.15 to 2.0.0
 * 1 – Narrowed shortcodes gives “Data in this table does not exist.” message when
   Display Columns or Exclude Columns used. Ex: [cdbt-view table=”wp_employee” bootstrap_style
   =”true” enable_repeater=”true” display_list_num=”false” display_search=”true”
   display_title=”true” enable_sort=”true” display_index_row=”true” narrow_keyword
   =”Adi:Hasan” display_cols=”Adi,Soyadi,Tel_No” order_cols=”Adi” sort_order=”Adi:
   asc” limit_items=”0″ image_render=”responsive” display_filter=”false” display_view
   =”false” thumbnail_width=”100″ ajax_load=”false”]
 * 2 – Sort (Order) is not working, always sorts to created:desc
 * 3 – On Edit mode Excluding Columns is not working
 *  Plugin Author [ka2](https://wordpress.org/support/users/ka2/)
 * (@ka2)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604221)
 * Thank you very much for reporting.
 * Sorry, such bad behavior is happening for the attribute of “norrow_keyword”, 
   I am going to fix after the investigation. Please wait until the bug fix release.
 *  Plugin Author [ka2](https://wordpress.org/support/users/ka2/)
 * (@ka2)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604222)
 * At releasing version 2.0.1, I have fixed the bugs that “sort_order” and “exclude_cols”
   attributes had not work on the shortcodes.
 * Thank you,
 *  Thread Starter [dstuncer](https://wordpress.org/support/users/dstuncer/)
 * (@dstuncer)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604237)
 * Thanks a lot…
 *  Thread Starter [dstuncer](https://wordpress.org/support/users/dstuncer/)
 * (@dstuncer)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604245)
 * “exclude_col” ok but sort_order is not working correctly, first page ok when 
   pressed next page scrambled view appear.
 * Another little bugs :
    – Creating database with Table Creator does not work –
   Can not change the user role of table created with previous version
 *  Plugin Author [ka2](https://wordpress.org/support/users/ka2/)
 * (@ka2)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604249)
 * Thank you very much for reporting.
 * > “sort_order” not working yet.
 * Oh, sorry. I was also able to confirm. Processing of the PHP side was normal.
   However, it’s a problem that is sorted from being focus to the last sortable 
   cell when is outputted as the repeater table at the frontend side. I’m going 
   to fix in the next version.
 * > Table Creator does not work.
 * Sorry, this bug is happened since version 2.0.1. I’m going to fix next version.
   
   If you want to immediately improve, please fix the code below. In the “templates/
   components/cdbt_table_creator.php” line 255.
 *     ```
       cdbt_admin_vars.column_types = <?php echo $json_code; ?>;
       ```
   
 * > Can not change the user role of table created with previous version
 * It was not noticed. I will correct that after survey.
 * Thank you,

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Using variable narrowing table’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-database-tables_e4e2e2.svg)
 * [Custom DataBase Tables](https://wordpress.org/plugins/custom-database-tables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-database-tables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-database-tables/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-database-tables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-database-tables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-database-tables/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [ka2](https://wordpress.org/support/users/ka2/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/using-variable-narrowing-table/#post-6604249)
 * Status: not resolved