I am attempting to set the default Image Link URL for my Wordpress customers to ensure that it does not range from the url link like a default. I have done some investigation, and that i be aware of function is incorporated in the wordpress-admin/options.php:


Instead of wreck havoc on the core files, Let me put this in to the functions.php, but don't know the best way to implement that! This is exactly what I've to date during my functions.php:


This clearly does not work: it requires the correct setup! What's the right way to implement this in functions.php?

Also: Let me be aware of technique for determining how you can implement functions such as this later on on my own? For instance, I don't know whether I am designed to use add_filter or do_action, and just how I have to pass the parameters. I have yet to locate a book or publish available that describes this perfectly, and may show me by example. Worthwhile leads on this is awesome too!

Begin with the Wordpress codex. Go to the plugin API (that is really your work) that describes Hooks, Actions and Filters. Then begin to see the Action Reference which supplies your listing of hooks.

Here there is a hook update_option_OPTIONNAME. Description from codex:

Runs following a WordPress option continues to be update through the update_option function. Action function arguments: old option value, new option value. You have to add an action for that specific options that you would like to reply to, for example update_option_foo to reply when option "foo" continues to be up-to-date.

Adding code from asker's comment:

function inventory_linkurl_setting() { 
add_action('update_option', 'inventory_linkurl_setting'); ?>