�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`� 0x0x
PHP 8.1.34
Preview: custom-css.php Size: 15.50 KB
/home2/astrociv/public_html/vaastruelogy.in/WordPress-master/wp-includes/block-supports/custom-css.php
<?php
/**
 * Custom CSS block support.
 *
 * @package WordPress
 */

/**
 * Checks whether a style node has a non-empty custom CSS string.
 *
 * @since 7.2.0
 * @access private
 *
 * @param mixed $style_node A style node, possibly containing a `css` key.
 * @return bool Whether the node has a non-empty custom CSS string.
 */
function wp_custom_css_has_value( $style_node ) {
	return is_array( $style_node )
		&& isset( $style_node['css'] )
		&& is_string( $style_node['css'] )
		&& '' !== trim( $style_node['css'] );
}

/**
 * Collects custom CSS defined for a block instance across its default,
 * pseudo-selector, and viewport states.
 *
 * @since 7.2.0
 * @access private
 *
 * @param array  $style                    The block's `style` attribute.
 * @param string $block_name               Block name.
 * @param array  $responsive_media_queries Media queries keyed by viewport state name.
 * @return array[] Custom CSS entries with `css`, `pseudo`, and `media_query` keys.
 */
function wp_get_custom_css_state_entries( $style, $block_name, $responsive_media_queries ) {
	$entries = array();
	if ( empty( $style ) || ! is_array( $style ) ) {
		return $entries;
	}

	$supported_pseudo_states = WP_Theme_JSON::VALID_BLOCK_PSEUDO_SELECTORS[ $block_name ] ?? array();

	if ( wp_custom_css_has_value( $style ) ) {
		$entries[] = array(
			'css'         => $style['css'],
			'pseudo'      => null,
			'media_query' => null,
		);
	}

	foreach ( $supported_pseudo_states as $pseudo_state ) {
		$pseudo_style = $style[ $pseudo_state ] ?? null;
		if ( wp_custom_css_has_value( $pseudo_style ) ) {
			$entries[] = array(
				'css'         => $pseudo_style['css'],
				'pseudo'      => $pseudo_state,
				'media_query' => null,
			);
		}
	}

	foreach ( $responsive_media_queries as $breakpoint => $media_query ) {
		$breakpoint_style = $style[ $breakpoint ] ?? null;
		if ( ! is_array( $breakpoint_style ) ) {
			continue;
		}

		if ( wp_custom_css_has_value( $breakpoint_style ) ) {
			$entries[] = array(
				'css'         => $breakpoint_style['css'],
				'pseudo'      => null,
				'media_query' => $media_query,
			);
		}

		foreach ( $supported_pseudo_states as $pseudo_state ) {
			$breakpoint_pseudo_style = $breakpoint_style[ $pseudo_state ] ?? null;
			if ( wp_custom_css_has_value( $breakpoint_pseudo_style ) ) {
				$entries[] = array(
					'css'         => $breakpoint_pseudo_style['css'],
					'pseudo'      => $pseudo_state,
					'media_query' => $media_query,
				);
			}
		}
	}

	return $entries;
}

/**
 * Validates and processes custom CSS for each block style state.
 *
 * @since 7.2.0
 * @access private
 *
 * @param array[] $state_entries Custom CSS entries.
 * @param string  $selector      Selector scoping the block instance.
 * @return string Processed CSS.
 */
function wp_process_custom_css_state_entries( $state_entries, $selector ) {
	$processed_css = '';

	foreach ( $state_entries as $entry ) {
		// Validate CSS doesn't contain HTML markup (same validation as global styles REST API).
		if ( preg_match( '#</?\w+#', $entry['css'] ) ) {
			continue;
		}

		$entry_selector = null !== $entry['pseudo'] ? $selector . $entry['pseudo'] : $selector;
		$entry_css      = WP_Theme_JSON::process_blocks_custom_css( $entry['css'], $entry_selector );

		if ( empty( $entry_css ) ) {
			continue;
		}

		$processed_css .= null !== $entry['media_query']
			? $entry['media_query'] . '{' . $entry_css . '}'
			: $entry_css;
	}

	return $processed_css;
}

/**
 * Generates the custom CSS class name for a block and registers its stylesheet.
 *
 * @since 7.2.0
 * @access private
 *
 * @param array $parsed_block The parsed block.
 * @return string|null The generated class name, or null if the block has no custom CSS to render.
 *
 * @phpstan-param array{
 *     blockName: string|null,
 *     attrs: array{
 *         className?: string,
 *         style?: array{
 *             css?: string,
 *             ...
 *         },
 *         ...
 *     },
 *     ...
 * } $parsed_block
 */
function wp_generate_custom_css_class_name( $parsed_block ) {
	$style = $parsed_block['attrs']['style'] ?? null;
	if ( empty( $style ) || ! is_array( $style ) ) {
		return null;
	}

	$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $parsed_block['blockName'] );
	if ( ! block_has_support( $block_type, 'customCSS', true ) ) {
		return null;
	}

	$viewport_settings        = wp_get_global_settings( array( 'viewport' ) );
	$responsive_media_queries = WP_Theme_JSON::get_viewport_media_queries( $viewport_settings );
	$state_entries            = wp_get_custom_css_state_entries( $style, $parsed_block['blockName'], $responsive_media_queries );
	if ( empty( $state_entries ) ) {
		return null;
	}

	// Generate a unique class name for this block instance.
	$class_name    = wp_unique_id_from_values( $parsed_block, 'wp-custom-css-' );
	$processed_css = wp_process_custom_css_state_entries( $state_entries, '.' . $class_name );
	if ( '' === $processed_css ) {
		return null;
	}

	/**
	 * Reuse one handle so identical custom CSS is enqueued only once via
	 * {@see wp_unique_id_from_values()}. Explicitly declare the `wp-block-library`
	 * dependency so `global-styles` is guaranteed to print after it, preventing
	 * block default styles from unintentionally overriding global styles.
	 */
	$handle = 'wp-block-custom-css';
	if ( ! wp_style_is( $handle, 'registered' ) ) {
		wp_register_style( $handle, false, array( 'wp-block-library', 'global-styles' ) );
	}
	$after_styles = wp_styles()->get_data( $handle, 'after' );
	if ( ! is_array( $after_styles ) ) {
		$after_styles = array();
	}
	if ( ! in_array( $processed_css, $after_styles, true ) ) {
		wp_add_inline_style( $handle, $processed_css );
	}

	return $class_name;
}

/**
 * Render the custom CSS stylesheet and add class name to block as required.
 *
 * @since 7.0.0
 *
 * @param array $parsed_block The parsed block.
 * @return array The same parsed block with custom CSS class name added if appropriate.
 *
 * @phpstan-param array{
 *     blockName: string|null,
 *     attrs: array{
 *         className?: string,
 *         style?: array{
 *             css?: string,
 *             ...
 *         },
 *         ...
 *     },
 *     ...
 * } $parsed_block
 * @phpstan-return array{
 *     blockName: string|null,
 *     attrs: array{
 *         className?: string,
 *         style?: array{
 *             css?: string,
 *             ...
 *         },
 *         ...
 *     },
 *     ...
 * }
 */
function wp_render_custom_css_support_styles( $parsed_block ) {
	$class_name = wp_generate_custom_css_class_name( $parsed_block );
	if ( null === $class_name ) {
		return $parsed_block;
	}

	$existing_class_name = $parsed_block['attrs']['className'] ?? null;
	$updated_class_name  = is_string( $existing_class_name )
		? "$existing_class_name $class_name"
		: $class_name;

	$parsed_block['attrs']['className'] = $updated_class_name;

	return $parsed_block;
}

/**
 * Enqueues the block custom CSS styles.
 *
 * @since 7.0.0
 */
function wp_enqueue_block_custom_css() {
	wp_enqueue_style( 'wp-block-custom-css' );
}

/**
 * Applies the custom CSS class name to the block's rendered HTML.
 *
 * Uses the class name that {@see wp_render_custom_css_support_styles()}
 * stored in the block attributes. Blocks that a parent parsed and rendered
 * itself never reach that filter, so the class name is generated here instead
 * via {@see wp_generate_custom_css_class_name()}.
 *
 * @since 7.0.0
 * @since 7.2.0 Generates the class name when the block attributes lack one.
 *
 * @param string $block_content Rendered block content.
 * @param array  $block         Block object.
 * @return string Filtered block content.
 *
 * @phpstan-param array{
 *     blockName: string|null,
 *     attrs: array{
 *         className?: string,
 *         style?: array{
 *             css?: string,
 *             ...
 *         },
 *         ...
 *     },
 *     ...
 * } $block
 */
function wp_render_custom_css_class_name( $block_content, $block ) {
	$class_name_attr    = $block['attrs']['className'] ?? null;
	$class_name_prefix  = 'wp-custom-css-';
	$matched_class_name = null;

	// Parse out the 'wp-custom-css-*' class name added by wp_render_custom_css_support_styles().
	if ( is_string( $class_name_attr ) && str_contains( $class_name_attr, $class_name_prefix ) ) {
		$token_delimiter = " \t\f\r\n";
		$class_token     = strtok( $class_name_attr, $token_delimiter );
		while ( false !== $class_token ) {
			if ( str_starts_with( $class_token, $class_name_prefix ) ) {
				$matched_class_name = $class_token;
				break;
			}
			$class_token = strtok( $token_delimiter );
		}
	}

	// Direct WP_Block::render() calls skip render_block_data for the block itself.
	if ( null === $matched_class_name ) {
		$matched_class_name = wp_generate_custom_css_class_name( $block );
	}

	if ( null === $matched_class_name ) {
		return $block_content;
	}

	$tags = new WP_HTML_Tag_Processor( $block_content );
	if ( $tags->next_tag() ) {
		$tags->add_class( 'has-custom-css' );
		$tags->add_class( $matched_class_name );
	}

	return $tags->get_updated_html();
}

add_filter( 'render_block', 'wp_render_custom_css_class_name', 10, 2 );
add_filter( 'render_block_data', 'wp_render_custom_css_support_styles', 10, 1 );
add_action( 'wp_enqueue_scripts', 'wp_enqueue_block_custom_css', 1 );

/**
 * Registers the style block attribute for block types that support it.
 *
 * @since 7.0.0
 *
 * @param WP_Block_Type $block_type Block Type.
 */
function wp_register_custom_css_support( $block_type ) {
	// Setup attributes and styles within that if needed.
	if ( ! $block_type->attributes ) {
		$block_type->attributes = array();
	}

	// Check for existing style attribute definition e.g. from block.json.
	if ( array_key_exists( 'style', $block_type->attributes ) ) {
		return;
	}

	$has_custom_css_support = block_has_support( $block_type, array( 'customCSS' ), true );

	if ( $has_custom_css_support ) {
		$block_type->attributes['style'] = array(
			'type' => 'object',
		);
	}
}

/**
 * Removes custom CSS from a style attribute and any nested style states.
 *
 * @since 7.2.0
 * @access private
 *
 * @param array $style The block's `style` attribute.
 * @return array The style attribute with all `css` keys removed.
 */
function wp_strip_custom_css_from_style_array( $style ) {
	if ( ! is_array( $style ) ) {
		return $style;
	}

	unset( $style['css'] );

	foreach ( $style as $key => $value ) {
		if ( is_string( $key ) && is_array( $value ) && ( str_starts_with( $key, ':' ) || str_starts_with( $key, '@' ) ) ) {
			$nested_style = wp_strip_custom_css_from_style_array( $value );
			if ( empty( $nested_style ) ) {
				unset( $style[ $key ] );
			} else {
				$style[ $key ] = $nested_style;
			}
		}
	}

	return $style;
}

/**
 * Strips custom CSS (`style.css` in attributes) from all blocks in post content.
 *
 * Uses {@see WP_Block_Parser::next_token()} to scan block tokens and surgically
 * replace only the attribute JSON that changed — no parse_blocks() +
 * serialize_blocks() round-trip needed.
 *
 * @since 7.0.0
 * @access private
 *
 * @param string $content Post content to filter, expected to be escaped with slashes.
 * @return string Filtered post content with block custom CSS removed.
 */
function wp_strip_custom_css_from_blocks( $content ) {
	if ( ! has_blocks( $content ) ) {
		return $content;
	}

	$unslashed = stripslashes( $content );

	$parser           = new WP_Block_Parser();
	$parser->document = $unslashed;
	$parser->offset   = 0;
	$end              = strlen( $unslashed );
	$replacements     = array();

	while ( $parser->offset < $end ) {
		$next_token = $parser->next_token();

		if ( 'no-more-tokens' === $next_token[0] ) {
			break;
		}

		list( $token_type, , $attrs, $start_offset, $token_length ) = $next_token;

		$parser->offset = $start_offset + $token_length;

		if ( 'block-opener' !== $token_type && 'void-block' !== $token_type ) {
			continue;
		}

		if ( ! isset( $attrs['style'] ) || ! is_array( $attrs['style'] ) ) {
			continue;
		}

		$stripped_style = wp_strip_custom_css_from_style_array( $attrs['style'] );
		if ( $stripped_style === $attrs['style'] ) {
			continue;
		}

		// Remove css and clean up empty style.
		if ( empty( $stripped_style ) ) {
			unset( $attrs['style'] );
		} else {
			$attrs['style'] = $stripped_style;
		}

		// Locate the JSON portion within the token.
		$token_string   = substr( $unslashed, $start_offset, $token_length );
		$json_rel_start = strcspn( $token_string, '{' );
		$json_rel_end   = strrpos( $token_string, '}' );

		$json_start  = $start_offset + $json_rel_start;
		$json_length = $json_rel_end - $json_rel_start + 1;

		// Re-encode attributes. If attrs is now empty, remove JSON and trailing space.
		if ( empty( $attrs ) ) {
			// Remove the trailing space after JSON.
			$replacements[] = array( $json_start, $json_length + 1, '' );
		} else {
			$replacements[] = array( $json_start, $json_length, serialize_block_attributes( $attrs ) );
		}
	}

	if ( empty( $replacements ) ) {
		return $content;
	}

	// Build the result by splicing replacements into the original string.
	$result = '';
	$was_at = 0;

	foreach ( $replacements as $replacement ) {
		list( $offset, $length, $new_json ) = $replacement;
		$result                            .= substr( $unslashed, $was_at, $offset - $was_at ) . $new_json;
		$was_at                             = $offset + $length;
	}

	if ( $was_at < $end ) {
		$result .= substr( $unslashed, $was_at );
	}

	return addslashes( $result );
}

/**
 * Adds the filters to strip custom CSS from block content on save.
 * Priority of 8 to run before wp_filter_global_styles_post (priority 9) and wp_filter_post_kses (priority 10).
 *
 * @since 7.0.0
 * @access private
 */
function wp_custom_css_kses_init_filters() {
	add_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
	add_filter( 'content_filtered_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
}

/**
 * Removes the filters that strip custom CSS from block content on save.
 * Priority of 8 to run before wp_filter_global_styles_post (priority 9) and wp_filter_post_kses (priority 10).
 *
 * @since 7.0.0
 * @access private
 */
function wp_custom_css_remove_filters() {
	remove_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
	remove_filter( 'content_filtered_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
}

/**
 * Registers the custom CSS content filters if the user does not have the edit_css capability.
 *
 * @since 7.0.0
 * @access private
 */
function wp_custom_css_kses_init() {
	wp_custom_css_remove_filters();
	if ( ! current_user_can( 'edit_css' ) ) {
		wp_custom_css_kses_init_filters();
	}
}

/**
 * Initializes custom CSS content filters when imported data should be filtered.
 *
 * Runs at priority 999 on {@see 'force_filtered_html_on_import'} to ensure it
 * fires after general KSES initialization, independently of user capabilities.
 * If the input of the filter is true it means we are in an import situation and should
 * enable the custom CSS filters, independently of the user capabilities.
 *
 * @since 7.0.0
 * @access private
 *
 * @param mixed $arg Input argument of the filter.
 * @return mixed Input argument of the filter.
 */
function wp_custom_css_force_filtered_html_on_import_filter( $arg ) {
	if ( $arg ) {
		wp_custom_css_kses_init_filters();
	}
	return $arg;
}

// Run before wp_filter_global_styles_post (priority 9) and wp_filter_post_kses (priority 10).
add_action( 'init', 'wp_custom_css_kses_init', 20 );
add_action( 'set_current_user', 'wp_custom_css_kses_init' );
add_filter( 'force_filtered_html_on_import', 'wp_custom_css_force_filtered_html_on_import_filter', 999 );

// Register the block support.
WP_Block_Supports::get_instance()->register(
	'custom-css',
	array(
		'register_attribute' => 'wp_register_custom_css_support',
	)
);

Directory Contents

Dirs: 0 × Files: 23
Name Size Perms Modified Actions
1.67 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.54 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.65 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.18 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
6.11 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
9.70 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
4.01 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
6.10 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
6.76 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.63 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
15.50 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.83 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.67 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
9.35 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.70 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
63.20 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
6.79 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
4.42 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.05 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.68 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
28.76 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
28.97 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1008 B lrw-r--r-- 2026-10-28 14:44:54
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI