- This topic has 4 replies, 2 voices, and was last updated 1 year, 2 months ago by .
-
Topic
-
Hi Anh,
Yesterday I purchased a lifetime license and I am already having fun with the Meta Box plugin.
One thing that I am trying to figure out is to show the group data that is stored in a custom table via a shortcode. I am following your tutorial on how to create the shortcode and have this:add_shortcode( 'dr_pricing', function() { $group = rwmb_meta( 'pricing_group' ); if ( empty( $group ) ) { return ''; } $output = ''; // Sub-field Class. $groupclass = $group['group_class'] ?? ''; $output .= '<h3 class="my-title">' . $groupclass . '</h3>'; // Sub-field Number of Classes. $groupnumber = $group['number_of_classes'] ?? ''; $output .= '<h3 class="my-title">' . $groupnumber . '</h3>'; // Sub-field Price. $groupprice = $group['group_price'] ?? ''; $output .= '<h3 class="my-title">' . $groupprice . '</h3>'; // Sub-field No Classes. $noclass = $group['no_class'] ?? ''; $output .= '<h3 class="my-title">' . $noclass . '</h3>'; return $output; } );
When I look in the custom database table I can see that the group data is stored as expected but it is not printed with shortcode [dr_pricing].
Do I need to alter the shortcode function to point to the custom database table? I could not find that piece of information in the tutorial or forum.Thanks so much!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.