Make WordPress Core


Ignore:
Timestamp:
03/22/2010 11:03:31 PM (15 years ago)
Author:
nacin
Message:

Deprecate add_option_update_handler() and remove_option_update_handler() in favor of register_setting() and unregister_setting(). #11730

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/deprecated.php

    r13097 r13805  
    126126}
    127127
     128/**
     129 * Register a setting and its sanitization callback
     130 *
     131 * @since 2.7.0
     132 * @deprecated 3.0.0
     133 * @deprecated Use register_setting()
     134 * @see register_setting()
     135 *
     136 * @param string $option_group A settings group name.  Should correspond to a whitelisted option key name.
     137 *  Default whitelisted option key names include "general," "discussion," and "reading," among others.
     138 * @param string $option_name The name of an option to sanitize and save.
     139 * @param unknown_type $sanitize_callback A callback function that sanitizes the option's value.
     140 * @return unknown
     141 */
     142function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
     143    _deprecated_function( __FUNCTION__, '3.0', 'register_setting()' );
     144    return register_setting( $option_group, $option_name, $sanitize_callback );
     145}
     146
     147/**
     148 * Unregister a setting
     149 *
     150 * @since 2.7.0
     151 * @deprecated 3.0.0
     152 * @deprecated Use unregister_setting()
     153 * @see unregister_setting()
     154 *
     155 * @param unknown_type $option_group
     156 * @param unknown_type $option_name
     157 * @param unknown_type $sanitize_callback
     158 * @return unknown
     159 */
     160function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
     161    _deprecated_function( __FUNCTION__, '3.0', 'unregister_setting()' );
     162    return unregister_setting( $option_group, $option_name, $sanitize_callback );
     163}
     164
    128165?>
Note: See TracChangeset for help on using the changeset viewer.