Title: Hyperlink?
Last modified: August 24, 2016

---

# Hyperlink?

 *  [Taily](https://wordpress.org/support/users/taily/)
 * (@taily)
 * [11 years ago](https://wordpress.org/support/topic/hyperlink-18/)
 * Hi!
    First off I want to say I love this plugin! I do have one thing I would 
   like to do and am really not getting how to do it. I would like to associate 
   links to an html doc for a single column in each row of the table. As I understand
   it currently, I would need to capture a hidden column’s information and somehow
   associate it with code to be used as a link for a separate column. I have no 
   clue about shortcode or really any code whatsoever and I am not sure if this 
   is even possible as it seems to bundle the entire table up in one simple “cdbt-
   view table” command. Thanks for making a great plugin and any help anyone could
   give me would be greatly appreciated!
 * [https://wordpress.org/plugins/custom-database-tables/](https://wordpress.org/plugins/custom-database-tables/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [ka2](https://wordpress.org/support/users/ka2/)
 * (@ka2)
 * [11 years ago](https://wordpress.org/support/topic/hyperlink-18/#post-6061118)
 * Thank you for your inquiry.
 * Currently,there are many desire to decorate the some specific columns of data
   listed in the same as you want. It is difficult in the specification of the current
   plugin, but you can respond by modifying the source of the plugin as described
   below.
    As an example, we will introduce the case of short codes [cdbt-view].
 * Firstly, please open the file of `wp-content/plugins/custom-database-tables/templates/
   cdbt-public-list.php` by using text editor.
 * Please add the following one line to the 189 line.
 *     ```
       $val = apply_filters( 'cdbt_view_cell', $val, $data_id, $key, $table_name );
       ```
   
 * After adding the above line, source looks like follow:
 *     ```
       if (!empty($exclude_cols) && in_array($key, $exclude_cols)) {
         continue;
       } else {
         $val = apply_filters( 'cdbt_view_cell', $val, $data_id, $key, $table_name );
         $list_rows .= '<td>'. $val .'</td>';
       }
       ```
   
 * Next, open the function.php of your theme (wp-content/themes/*****/functions.
   php), you can add as follows:
 *     ```
       function my_decorate_cell( $cell_value, $data_id, $column_name, $table_name ) {
         if ( $table_name == 'your_table_name' && $column_name == 'target_column_name' ) {
           if ( !empty($cell_value) ) {
             $cell_value = sprintf('<a href="%s">%s</a>', $cell_value, $cell_value);
           }
         }
   
         return $cell_value;
       }
       add_filter( 'cdbt_view_cell', 'my_decorate_cell', 10, 4 );
       ```
   
 * In the above example, There will be enclosed the value of the “your_column_name”
   column of “your_table_name” table at `<a>` tag.
 * Also, the same demand with you wants is quite large.
    So in the next version,
   I’m going to add this filter hook to the cell output of all short code.
 * Thank you,

Viewing 1 replies (of 1 total)

The topic ‘Hyperlink?’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [ka2](https://wordpress.org/support/users/ka2/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/hyperlink-18/#post-6061118)
 * Status: not resolved