Changeset 53242 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 04/22/2022 10:29:45 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r53060 r53242 1807 1807 * 1808 1808 * @since 3.4.0 1809 * @since 4.1.1 Introduced the `$default ` parameter.1810 * @since 4.6.0 `$default ` is now returned early when the setting post value is invalid.1809 * @since 4.1.1 Introduced the `$default_value` parameter. 1810 * @since 4.6.0 `$default_value` is now returned early when the setting post value is invalid. 1811 1811 * 1812 1812 * @see WP_REST_Server::dispatch() … … 1814 1814 * @see WP_REST_Request::has_valid_params() 1815 1815 * 1816 * @param WP_Customize_Setting $setting A WP_Customize_Setting derived object.1817 * @param mixed $default Value returned $settinghas no post value (added in 4.2.0)1818 * or the post value is invalid (added in 4.6.0).1819 * @return string|mixed Sanitized value or the $defaultprovided.1820 */ 1821 public function post_value( $setting, $default = null ) {1816 * @param WP_Customize_Setting $setting A WP_Customize_Setting derived object. 1817 * @param mixed $default_value Value returned if `$setting` has no post value (added in 4.2.0) 1818 * or the post value is invalid (added in 4.6.0). 1819 * @return string|mixed Sanitized value or the `$default_value` provided. 1820 */ 1821 public function post_value( $setting, $default_value = null ) { 1822 1822 $post_values = $this->unsanitized_post_values(); 1823 1823 if ( ! array_key_exists( $setting->id, $post_values ) ) { 1824 return $default; 1825 } 1824 return $default_value; 1825 } 1826 1826 1827 $value = $post_values[ $setting->id ]; 1827 1828 $valid = $setting->validate( $value ); 1828 1829 if ( is_wp_error( $valid ) ) { 1829 return $default; 1830 } 1830 return $default_value; 1831 } 1832 1831 1833 $value = $setting->sanitize( $value ); 1832 1834 if ( is_null( $value ) || is_wp_error( $value ) ) { 1833 return $default; 1834 } 1835 return $default_value; 1836 } 1837 1835 1838 return $value; 1836 1839 } … … 2233 2236 * @deprecated 4.7.0 2234 2237 * 2235 * @param mixed $ returnValue passed through for {@see 'wp_die_handler'} filter.2238 * @param mixed $callback Value passed through for {@see 'wp_die_handler'} filter. 2236 2239 * @return mixed Value passed through for {@see 'wp_die_handler'} filter. 2237 2240 */ 2238 public function remove_preview_signature( $ return= null ) {2241 public function remove_preview_signature( $callback = null ) { 2239 2242 _deprecated_function( __METHOD__, '4.7.0' ); 2240 2243 2241 return $ return;2244 return $callback; 2242 2245 } 2243 2246
Note: See TracChangeset
for help on using the changeset viewer.