If you want to add button which link to any external information about a post: in file functions.php add next code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | add_action('tableon_profile_extend', function($profile, $action_name) { if ($action_name === 'tableon_default_tables') { $profile['ref_btn'] = [ 'title' => esc_html('Ref. button'), 'order' => FALSE, 'action' => function($post_id) { return TABLEON_HELPER::draw_html_item('a', [ 'href' => get_post_meta($post_id, '_product_url', true), 'target' => '_blank', 'class' => 'tableon-btn' ], 'BUTTON NAME HERE'); } ]; } return $profile; }, 10, 2); |
ref_btn is just name of key for TableOn profile, you can use your own one.
_product_url in the code is the meta key with the link, of course you can use your own key or even assemble the link by your logic on the fly.
Also read: How to add custom column to the tables