Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using Wordpress Options Theme and I'm getting an issue.

Here's the code:

$options[] = array( "name" => __('Texto de botón de enlace a cotización',THEMENAME),
                    "desc" => __('Inserta el texto que aparecerá en los botones de cotización',THEMENAME),
                    "id" => "ns_custom_caps_quote_btn",
                    "std" => __('Cotizar', THEMENAME),
                    "type" => "text");

And when I reset to default, the input returns "a" instead of "Cotizar".

Any suggestion?

Thanks in advance.

share|improve this question
    
Whats the CONSTANT for? Should just be "std" => "default value" –  userabuser Oct 24 '12 at 14:21
    
It does not work neither. The constant is for internationalisation purposes. I stripped the function __() and put the plain string and does not work neither. –  Deryck Oñate Espinel Oct 24 '12 at 14:23
    
Have you tried hitting "restore defaults" button on the options page? Reason I say this is that you can save an "empty" string in the instance of this framework so the default only applys when there is no value saved for that given field. –  userabuser Oct 24 '12 at 14:27
    
This question is impossible to answer without seeing your entire Theme Settings implementation. Can you edit the question to include all relevant code, or link to a Pastebin or similar that contains the code? –  Chip Bennett Oct 24 '12 at 14:31
    
@ChipBennett To clarify he is using: wptheming.com/options-framework-theme - I only know because I'm using the same one on a particular project and know the behavior he is describing. –  userabuser Oct 24 '12 at 14:33
show 3 more comments

1 Answer 1

up vote 0 down vote accepted

Values set in the 'std' key of the array,

'std' => 'your default value'

Are saved to the database on first initialization of the framework.

Once you overwrite the default value and or remove the default value, even if left as a blank field, the default no longer applies unless you hit the "restore defaults" button.

share|improve this answer
    
I'ts working now userabuser. Thanks a lot. I will check this as solved using your answer if you don't mind. –  Deryck Oñate Espinel Oct 24 '12 at 14:37
    
No problem, you will observe that the behavior I describe is in fact correct anyway when you go ahead and edit your fields. Watch how the defaults don't restore themselves unless you intervene by hitting the restore button. All the best. –  userabuser Oct 24 '12 at 14:38
    
Ok, I have taked note of your recommendation. I will upload now to final server and I hope it works fine, as in the local server. Thanks again! –  Deryck Oñate Espinel Oct 24 '12 at 14:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.