to trap options modifications in WP use the filter called in update_option() defined in wp-includes/functions.php:376 do_action("update_option_{$option_name}", $oldvalue, $newvalue); +-------+-------------+----+----------------------+---------------------+----------------------------------------+ |LP opts| LP own page | WP | LP option | WP option | Notes | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | x | url | home | only if install_type == root | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | x | wp_url | siteurl | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | x | mail_from | admin_email | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | x | blogname | blogname | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | shortname | blogname | sanitize_title(get_option('blogname') | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | x | description | blogdescription | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | copyright_notice | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | x | posts_per_page | posts_per_page | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | x | posts_per_rss | posts_per_rss | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | lang | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | x | | template | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | approx_sql_timestamp | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | date_format | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | short_date_format | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | time_format | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | short_time_format | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | archive_label | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | x | charset | blog_charset | strtoupper(get_option('blog_charset')) | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | mail_mailer | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | mail_from | admin_email | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | mail_on_comment | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | allowed_tags | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | post_prefix | permalink_structure | * | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | category_prefix | category_base | ** | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | archives_prefix | permalink_structure | *** | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | pages_prefix | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | pages_suffix | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | search_prefix | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | author_prefix | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | tag_prefix | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | | | | category_separator | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | comment_spam_kill | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ | i | | | comment_spam_mail | | | +-------+-------------+----+----------------------+---------------------+----------------------------------------+ * if (!empty($value)) { $value = preg_replace('/%([^%]+)%/', '{$1}', $value); $value = $this->removeWPslashes($value); } ** if (empty($value) && get_option('permalink_structure')) $value = $this->base[$opt]; // use default else $value = $this->removeWPslashes($value); *** // if we have an empty value we are using raw URLs, and this option is useless if (!empty($value)) { // use post prefix as our base, minus post-specific values $links = array(explode('%postname%', $value), explode('%post_name%', $value), explode('%post_id%', $value)); $shortest = strlen($value); foreach($links as $l) $shortest = min($shortest, strlen($l[0])); $value = preg_replace('/%([^%]+)%/', '{$1}', substr($value, 0, $shortest)); $value = $this->removeWPslashes($value); // append year & month if they are missing if (strpos($value, '{year}') === false) $value .= '/{year}'; if (strpos($value, '{monthnum}') === false) $value .= '/{monthnum}'; }