Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Feature request: default values #63

Closed
wjdennen opened this Issue · 10 comments

8 participants

@wjdennen

Unless I've missed it, there does not seem to be a way to set default content in the fields. Sample text, for example. Or a default URL for image uploads.

It would be nice to have this, if possible. Thanks.

@billerickson
Collaborator

That's what the 'std' field on most field types is for:

array(
    'name' => 'Test Text',
    'desc' => 'field description (optional)',
    'std' => 'Default text goes here',
    'id' => $prefix . 'test_text',
    'type' => 'text'
),

We should probably include that in the wiki in all the examples.

@wjdennen

argh. How did I miss that? Sorry. and Thanks!

@jaredatch
Collaborator

No problem, as Bill says it's something we need to document better :)

@jaredatch jaredatch closed this
@GaryJones

You missed it as "std" is un-necessarily abbreviated...

@dwenaus

perhaps 'default' should become the standard, and 'std' depreciated. and add this to the examples. I totally missed this as well. To be honest, I still don't know what std means. standard?

@billerickson billerickson reopened this
@billerickson
Collaborator

I agree, we should add 'default' and then do a check for 'std' in case anyone is still using that

@jaredatch
Collaborator

+1 from me as well. Default makes more sense, dont remember how we ended up with std to begin with :P

@vegasgeek

I don't care what it's called. Just glad the feature exists. :+1:

@SiR-DanieL

I did it, here it is: #421

@jtsternberg
Owner

Thanks @SiR-DanieL Didn't realize there was an issue for this, but it's going to be in 1.0.1: https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/blob/trunk/init.php#L386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.