Custom Fields
Re-Envisioned
Support General Number field not showing std

This topic contains 3 replies, has 3 voices, and was last updated by  Anh Tran 2 years, 3 months ago.

  • Creator
    Topic
  • #4372

    armandmorin
    Participant

    I have a number field where I’ve entered a value via ‘std’, but it does not show in the metabox. Any ideas?

    Here’s the code I used…

    					array(
    						'name' => esc_html__( 'Headline Font Size', 'textdomain' ),
    						'id'   => $prefix.'headline_font_size',
    						'tab'  => 'hero_text',
    						'type' => 'number',
    						'min'  => 16,
    						'max'  => 100,
    						'step' => 2,
    						'std'  => 48,
    						'visible' => array($prefix . 'hero_type', '=', 'headline_sub')
    					),	
Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #4373

    Tan Nguyen
    Participant

    Dear armandmorin,

    Please make sure the {$prefix}hero_type field is eq to headline_sub

    Cheers!

    #4374

    armandmorin
    Participant

    Thanks for the reply… I should have been more clear. The field appears but the default value of 48 is not displayed. The fields just appears blank. I can enter a value, but the default value is not appearing.

    #4376

    Anh Tran
    Keymaster

    Just tried your code and 48 shows up as default value for me. Please note that it works only for the posts where the meta box hasn’t been saved. You can check it with new posts.

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

You must be logged in to reply to this topic.