-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default values not applicable in theme option page #111
Comments
I think that you should change $default parameter to an array of default values. Then, when the code is first run myprefix_get_option will return a valid value. Maybe: |
Can you provide your attempted code so that we can see what may be going wrong, if it's not presently an exact copy of the example you're linking to? Also are you referring to defaults at the point of visiting the options page for the first time and seeing some values filled in automatically? or are you expecting those when on the frontend and outputting the fetched options? That said, regarding the term "default" and what's used in Also the snippets are meant to be starting points rather than things you make use of out of box, so if you want to change that default parameter in some way, you can. |
hi thank you all but i still have the problem my code is this |
@Mnshawaty can you clarify at which point things are failing? Are the default values, upon say loading the options page the first time, and then clicking save, not actually saving to the option in the database and options table? Is it failing to apply styles of some sort upon fetching the option and output? |
hi guys
|
Can you share what you're seeing in your option row from |
this is my option page code :
in front end the resault will be "1" but i want it to be "#bada55" now i cant access the database to show you row |
If I'm reading everything right, Also note that your example from earlier, shown below, is passing 3 parameters for a function that only accepts 2:
You'd want to amend it to
|
i tested your code tips and its alose print 1 but i discoverd something that there is no value stored even the default as i see that default is not saved in database by default its just be like a placeholder in the page
and the resault is so the default value is stored in input as a placeholder text only you need to press on save button to store it in database |
Outside of hardcoding a default when invoking, like Likely could be done within the |
I made an theme option page
And i have a sample to change the colour of background as like your example
But the default values are not applied
it need to open option page and click on save button tobe applied help me please
This is your example
The text was updated successfully, but these errors were encountered: