Title: Static text field
Last modified: November 7, 2019

---

# Static text field

 *  Resolved [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/)
 * Is it possible to create a field that’s nothing but static text? I’ve tried with
   the title type, but I was nervous about replacing ‘name’ with a big block of 
   HTML. I tried to use after_field, but the field title kept showing up. I tried
   to set show_names to false, and even put in a label_cb, but no joy.
 * Any suggestions?

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

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12108431)
 * Probably best would be [https://github.com/CMB2/CMB2/wiki/Field-Parameters#render_row_cb](https://github.com/CMB2/CMB2/wiki/Field-Parameters#render_row_cb)
   where you handle the entirety of the output, including html and dynamic values.
 * Otherwise, I know there are tutorials out there for custom field types that you
   could do.
 * Also won’t hurt to poke around [https://github.com/CMB2/CMB2-Snippet-Library/](https://github.com/CMB2/CMB2-Snippet-Library/)
   as it has a lot of useful scaffold code.
 *  Thread Starter [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12109522)
 * Thanks. That worked. Now, the only problem is I’m getting a Save Changes button.
   I’ve tried a variety of options to make that button go away, but seem to be striking
   out. Any suggestions?
 * –David
 * BTW: I found [https://github.com/CMB2/CMB2-Snippet-Library/edit/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php](https://github.com/CMB2/CMB2-Snippet-Library/edit/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php)
   in the snippet library, which answered a whole bunch of other questions. Thanks
   for pointing me in that direction.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12109555)
 * How would you save the settings if you don’t have the button?
 *  Thread Starter [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12109557)
 * I’m displaying seven tabs and on two of them, I’m just slamming some HTML. One
   is some welcome HTML with links and such, while the other is HTML with details
   on add-ons and tools for plugin users.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12111188)
 * Since I don’t think CMB2 offers a way to hide the button, tabs version of an 
   options page or no, I am curious if there’s some way you could simply use some
   admin-side CSS to display:none it. If the URL is different when viewing each 
   tab, you could potentially also get an admin body class on the `<body>` tab so
   that you only hide it for one of them.
 * Throwing some ideas out there for you.
 *  Thread Starter [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12111819)
 * This worked:
 *     ```
       // Remove primary Save button
       // derived from https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions/custom-css-for-specific-metabox.php
       function myprefix_delete_welcome_button($post_id, $cmb)
       {
           ?>
           <style type="text/css" media="screen">
               input#submit-cmb.button.button-primary {
                   display: none;
               }
           </style>
           <?php
       }
   
       $object = 'options-page'; // could also be post | term
       $cmb_id = 'myprefix_my_metabox_id';
       add_action("cmb2_after_{$object}_form_{$cmb_id}", 'myprefix_delete_welcome_button', 10, 2);
       ```
   
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12112010)
 * Word.

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

The topic ‘Static text field’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/static-text-field/#post-12112010)
 * Status: resolved