芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/cepali.edu.mx/wp-includes/blocks/comment-template/elements-20241118053358.php
get_registered( $block['blockName'] ); if ( ! $block_type ) { return $block_content; } $element_color_properties = array( 'button' => array( 'skip' => wp_should_skip_block_supports_serialization( $block_type, 'color', 'button' ), 'paths' => array( array( 'button', 'color', 'text' ), array( 'button', 'color', 'background' ), array( 'button', 'color', 'gradient' ), ), ), 'link' => array( 'skip' => wp_should_skip_block_supports_serialization( $block_type, 'color', 'link' ), 'paths' => array( array( 'link', 'color', 'text' ), array( 'link', ':hover', 'color', 'text' ), ), ), 'heading' => array( 'skip' => wp_should_skip_block_supports_serialization( $block_type, 'color', 'heading' ), 'paths' => array( array( 'heading', 'color', 'text' ), array( 'heading', 'color', 'background' ), array( 'heading', 'color', 'gradient' ), array( 'h1', 'color', 'text' ), array( 'h1', 'color', 'background' ), array( 'h1', 'color', 'gradient' ), array( 'h2', 'color', 'text' ), array( 'h2', 'color', 'background' ), array( 'h2', 'color', 'gradient' ), array( 'h3', 'color', 'text' ), array( 'h3', 'color', 'background' ), array( 'h3', 'color', 'gradient' ), array( 'h4', 'color', 'text' ), array( 'h4', 'color', 'background' ), array( 'h4', 'color', 'gradient' ), array( 'h5', 'color', 'text' ), array( 'h5', 'color', 'background' ), array( 'h5', 'color', 'gradient' ), array( 'h6', 'color', 'text' ), array( 'h6', 'color', 'background' ), array( 'h6', 'color', 'gradient' ), ), ), ); $skip_all_element_color_serialization = $element_color_properties['button']['skip'] && $element_color_properties['link']['skip'] && $element_color_properties['heading']['skip']; if ( $skip_all_element_color_serialization ) { return $block_content; } $elements_style_attributes = $block['attrs']['style']['elements']; foreach ( $element_color_properties as $element_config ) { if ( $element_config['skip'] ) { continue; } foreach ( $element_config['paths'] as $path ) { if ( null !== _wp_array_get( $elements_style_attributes, $path, null ) ) { /* * It only takes a single custom attribute to require that the custom * class name be added to the block, so once one is found there's no * need to continue looking for others. * * As is done with the layout hook, this code assumes that the block * contains a single wrapper and that it's the first element in the * rendered output. That first element, if it exists, gets the class. */ $tags = new WP_HTML_Tag_Processor( $block_content ); if ( $tags->next_tag() ) { $tags->add_class( wp_get_elements_class_name( $block ) ); } return $tags->get_updated_html(); } } } // If no custom attributes were found then there's nothing to modify. return $block_content; } /** * Renders the elements stylesheet. * * In the case of nested blocks we want the parent element styles to be rendered before their descendants. * This solves the issue of an element (e.g.: link color) being styled in both the parent and a descendant