Custom Fields
Support General Suggestion for fields — Automatically adding a TITLE ATRIBUTE based on MB ID

  • Creator
  • #23431
    Resolved Teia Local Studio

    Hello guys!

    I have a suggestion for future MetaBox versions — is it possible to add a TITLE attribute automatically based on the ID of a metabox field? It is super useful when you are developing interfaces based on metaboxes.

    You just move the cursor on top of it and the browser tooltip refreshes your memory with a instantaneous info!

    Otherwise you need to check the source code or use other cluttering tools for a so simple process.

    When editing in admin metaboxes fields are generated this way:
    <input size="30" type="text" id="famicom" class="rwmb-text" name="famicom" />

    My suggestion:
    <input size="30" type="text" id="famicom" class="rwmb-text" name="famicom" title="famicom" />

    Where the "title" attribute is equal as the field ID. And of course, to apply not only on INPUT:text, but also in all kind of fields generated by MB plugin!

    What do you think?

    Thank you so much for this wonderful suite of MAGIC!
    Love metaBox!


Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
  • #23432
    Teia Local Studio


    I just accomplished a satisfactory result injecting some custom jQuery on WordPress admin. Using the code below I can force the most common fields to have a TITLE attribute based on their IDs:

    jQuery('input, textarea, select, .wp-color-picker').each(function(){
        jQuery(this).attr('title', jQuery(this).attr('id'));
        jQuery(this).next().attr('title', jQuery(this).attr('id'));
        jQuery(this).attr('title', jQuery(this).attr('for'));

    Hope to be useful to someone!

    Long Nguyen

    Hi Giovani,

    Thanks for your idea.

    WordPress requires the meta box's title when registering, we've also noted this case on the documentation when creating the meta box:

    id Meta box ID, must be unique. Optional. If it’s absent, it will be generated from title using sanitize_title function.
    title Meta box title. Required.

    title is required and id is optional, it will be generated from title.

    Teia Local Studio

    Hello, Long.

    Yes yes, I understand perfectly, but I was talking about the attribute title IN A FIELD itself, not the general title of a array of fields — the whole metabox thing.

    My suggestion:

    <img id="my-id" src="xxx" alt="abc" TITLE="my-id" />
    <input type="text" id="my-id2" size="30" TITLE="my-id2" />
    <select id="my-id3" name="pick-a-boo" title="my-id3"> ... </select>

    What we have today:

    <img id="my-id" src="xxx" alt="abc" />
    <input type="text" id="my-id2" size="30" />
    <select id="my-id3" name="pick-a-boo"> ... </select>

    It could be added on the metabox root code, however I can'r mess up the core code there, because it will me lost upon updating:

    if ( class_exists( 'RWMB_Field' ) ) {
        class RWMB_Phone_Field extends RWMB_Field {
            public static function html( $meta, $field ) {
                return sprintf(
                    '<input type="tel" name="%s" id="%s" value="%s" title="%s">',
                    $field['id'] // <------- THIS

    Well, just and idea. I found a workaround using jQuery, but it would be great to have this implemented, at least on INPUT, SELECT, TEXTAREA.

    Thank you!

    Teia Local Studio


    And this:


    Long Nguyen


    Thanks for your effort.

    The attribute title for each field helps users to show the short description when hovering the element. We also have the extension Meta Box Tooltip to show the description as well.

    But I will discuss with the developer team to take a look at this case and support in the future update if needed.

    Teia Local Studio


    Metabox TOOLTIP. I was completely unaware of this extension. Thanks for the suggestion. Really nice indeed!

    Best regards,

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.