I found an interesting concepts of adding an additional option to the "General Options" in Wordpress.
/**
* Custom Theme Settings
* see http://digwp.com/2009/09/global-custom-fields-take-two/
*/
add_action('admin_menu', 'add_gcf_interface');
function add_gcf_interface() {
add_options_page('Other', 'Other', '8', 'functions', 'otherGlobalOptions');
}
function otherGlobalOptions() {
?>
<div class='wrap'>
<h2>Sonstiges</h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<p><strong>Welcome Message</strong><br />
<textarea name="welcomemessage" cols="100%" rows="7"><?php echo get_option('welcomemessage'); ?></textarea></p>
<p><input type="submit" name="Submit" value="Save" /></p>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="welcomemessage" />
</form>
</div>
<?php
}
This works just fine.
I'm just wondering now if there is a chance to apply a filter to that input?
Like I can do add_filter('the_content', 'wr_replace_text', 100); I want to do
add_filter('welcomemessage', 'wr_replace_text', 100);
Is that somehow possible, because this doesn't work for me at the moment.
Kind regards, Matt
