Title: Raw data from shortcodes
Last modified: November 6, 2019

---

# Raw data from shortcodes

 *  [clickingclients](https://wordpress.org/support/users/clickingclients/)
 * (@clickingclients)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/raw-data-from-shortcodes/)
 * Is it possible to get raw data from the database THEN wrap it in an element and
   class/ID which we choose? This allows for targeted styling.
 * When I use the shortcode within a page, it wraps the data and I can’t apply my
   own styling directly to it.
 * Also, when I’ve tried to dive into the code to get the raw output however it 
   seems difficult to pull out the raw data and manipulate it.
 * Any advice on how to adapt a shortcode or to isolate raw data within the code?
 * Thank you

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

 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/raw-data-from-shortcodes/#post-12104589)
 * This is done using custom templates, take a look at this article:
 * [
    Using Participants Database Custom Templates
 *  Thread Starter [clickingclients](https://wordpress.org/support/users/clickingclients/)
 * (@clickingclients)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/raw-data-from-shortcodes/#post-12104955)
 * Thanks again. I’ll leave this here for others to learn from also.
    I added the
   following to my child theme functions.php
 *     ```
       // Flexible wrapping and styling of PDB value
       add_shortcode('wrapped_value', 'cc_wrapped_value' );
       function cc_wrapped_value( $atts ) {
          vTag = sanitize_text_field( $atts['tag'] );
          vClass = sanitize_text_field( $atts['class'] );
          vId = sanitize_text_field( $atts['el_id'] );
   
          $html = '<' . vTag . ' class="' . vClass . '" id="' . vId .'">';
          $html .= do_shortcode( '[pdb_single record_id=' . $atts['record_id'] . ' fields=' . $atts['fields'] . ' template=bare-value ]' );
          $html .= '</' . vTag . '>';
   
          return $html;
       }
       ```
   

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

The topic ‘Raw data from shortcodes’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 2 replies
 * 2 participants
 * Last reply from: [clickingclients](https://wordpress.org/support/users/clickingclients/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/raw-data-from-shortcodes/#post-12104955)
 * Status: not resolved