Uses
Uses | Description |
---|---|
wp-includes/theme.php: wp_update_custom_css_post() | Updates the |
wp-includes/theme.php: set_theme_mod() | Updates theme modification value for the current theme. |
Store the CSS setting value in the custom_css custom post type for the stylesheet.
(string) (Required) The input value.
(int|false) The post ID or false if the value could not be saved.
File: wp-includes/customize/class-wp-customize-custom-css-setting.php
public function update( $css ) { if ( empty( $css ) ) { $css = ''; } $r = wp_update_custom_css_post( $css, array( 'stylesheet' => $this->stylesheet, ) ); if ( $r instanceof WP_Error ) { return false; } $post_id = $r->ID; // Cache post ID in theme mod for performance to avoid additional DB query. if ( $this->manager->get_stylesheet() === $this->stylesheet ) { set_theme_mod( 'custom_css_post_id', $post_id ); } return $post_id; }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_custom_css_setting/update