Changeset 13805
- Timestamp:
- 03/22/2010 11:03:31 PM (15 years ago)
- Location:
- trunk/wp-admin/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/deprecated.php
r13097 r13805 126 126 } 127 127 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 */ 142 function 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 */ 160 function 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 128 165 ?> -
trunk/wp-admin/includes/ms.php
r13792 r13805 754 754 add_action( 'admin_notices', 'ms_deprecated_blogs_file' ); 755 755 756 /** 757 * Outputs the notice message for multisite regarding activation of plugin page. 758 * 759 * @since 3.0 760 * @return none 761 */ 762 function _admin_notice_multisite_activate_plugins_page() { 763 $message = sprintf( __( 'The plugins page is not visible to normal users. It must be activated first. %s' ), '<a href="ms-options.php#menu">' . __( 'Activate' ) . '</a>' ); 764 echo "<div class='error'><p>$message</p></div>"; 765 } 766 756 767 ?> -
trunk/wp-admin/includes/plugin.php
r13770 r13805 1423 1423 * @return unknown 1424 1424 */ 1425 function register_setting($option_group, $option_name, $sanitize_callback = '') { 1426 if ( 'misc' == $option_group ) 1425 function register_setting( $option_group, $option_name, $sanitize_callback = '' ) { 1426 global $new_whitelist_options; 1427 1428 if ( 'misc' == $option_group ) { 1427 1429 _deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) ); 1428 return add_option_update_handler($option_group, $option_name, $sanitize_callback); 1430 $option_group = 'general'; 1431 } 1432 1433 $new_whitelist_options[ $option_group ][] = $option_name; 1434 if ( $sanitize_callback != '' ) 1435 add_filter( "sanitize_option_{$option_name}", $sanitize_callback ); 1429 1436 } 1430 1437 … … 1439 1446 * @return unknown 1440 1447 */ 1441 function unregister_setting($option_group, $option_name, $sanitize_callback = '') { 1442 return remove_option_update_handler($option_group, $option_name, $sanitize_callback); 1443 } 1444 1445 /** 1446 * {@internal Missing Short Description}} 1447 * 1448 * @since unknown 1449 * 1450 * @param unknown_type $option_group 1451 * @param unknown_type $option_name 1452 * @param unknown_type $sanitize_callback 1453 */ 1454 function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') { 1448 function unregister_setting( $option_group, $option_name, $sanitize_callback = '' ) { 1455 1449 global $new_whitelist_options; 1456 1450 1457 if ( 'misc' == $option_group ) 1451 if ( 'misc' == $option_group ) { 1452 _deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) ); 1458 1453 $option_group = 'general'; 1459 1460 $new_whitelist_options[ $option_group ][] = $option_name; 1461 if ( $sanitize_callback != '' ) 1462 add_filter( "sanitize_option_{$option_name}", $sanitize_callback ); 1463 } 1464 1465 /** 1466 * {@internal Missing Short Description}} 1467 * 1468 * @since unknown 1469 * 1470 * @param unknown_type $option_group 1471 * @param unknown_type $option_name 1472 * @param unknown_type $sanitize_callback 1473 */ 1474 function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') { 1475 global $new_whitelist_options; 1476 1477 if ( 'misc' == $option_group ) 1478 $option_group = 'general'; 1454 } 1479 1455 1480 1456 $pos = array_search( $option_name, (array) $new_whitelist_options ); … … 1575 1551 } 1576 1552 1577 /**1578 * Outputs the notice message for multisite regarding activation of plugin page.1579 *1580 * @since 3.01581 * @return none1582 */1583 function _admin_notice_multisite_activate_plugins_page() {1584 $message = sprintf( __( 'The plugins page is not visible to normal users. It must be activated first. %s' ), '<a href="ms-options.php#menu">' . __( 'Activate' ) . '</a>' );1585 echo "<div class='error'><p>$message</p></div>";1586 }1587 1588 1553 ?>
Note: See TracChangeset
for help on using the changeset viewer.