Wordpress Theme Options Page.. add default option values upon theme activation

Completed Posted Mar 7, 2010 Paid on delivery
Completed Paid on delivery

**Background:**

I currently have a wordpress theme options page that allows the user to customize settings on the site. This theme options page is currently functioning properly and the options are already implemented across the site. Users can update the options fields and option update properly and display across the site.? ?

**The Project:

**I need a “function?? added that will set these theme options settings to “default?? values when the theme is “activated?? (possible use “register_activation_hook????). If an option already has a value we will not overwrite the option so users may switch between themes without overwriting settings each time.

(I am thinking possibly the “add_option?? function?? I need this to be as secure as possible.)

## Deliverables

Deadline:

I would need finished product within 3-5 business days (Bonus available if completed in less then 3 business days without sacrificing quality).

How is My Options Page Currently Set Up?:

I am currently using the newer “register_settings?? API <[url removed, login to view]>

Full code for my theme options page is available upon request. Please ask if you need to look at it to ensure you can complete the project as requested.

Code snippets to give you an idea:

I am using one database entry for all options and storing options in an array:

function geo_options_init(){

register_setting( 'geo_option_group', 'geo_options_entry', 'geo_options_validate' );

}

Implementation on options page: (using a custom function “geo_options?? to store and retrieve option values since the option is stored in an array.) …......Open to suggestions.

<td><input style="width:350px" type="text" name="geo_options_entry[business_name]" value="<?php echo geo_option('business_name'); ?>"/> </td>

Function that returns value

/* Return Option */

function geo_option($option){

$geo_option = get_option('geo_options_entry');

$value = $geo_option[$option];

if($value){

return $value;

}

}

/* Return value End */

Requirements:

Current theme option settings must contain default values when theme is activated. The value should be stored and input fields and drop down menus should display the default value (until updated) of course.

Should be coded in PHP

If a value already exists the current value should not be overwrited if the theme is re-activated.

The functionality to set the defaults should be coded in functions so it can be easily posted to other themes.

All new code should be commented.

Please let me know if you have any questions.

Engineering MySQL PHP Project Management Software Architecture Software Testing Web Hosting Website Management Website Testing

Project ID: #3238996

About the project

1 proposal Remote project Active Mar 7, 2010

Awarded to:

sonarbangla

See private message.

$42.5 USD in 3 days
(138 Reviews)
5.6