} } else { $gap_value = $gap_value && preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ? null : $gap_value; } $fallback_gap_value = _wp_array_get( $block_type->supports, array( 'spacing', 'blockGap', '__experimentalDefault' ), '0.5em' ); // If a block's block.json skips serialization for spacing or spacing.blockGap, // don't apply the user-defined value to the styles. $should_skip_gap_serialization = wp_should_skip_block_supports_serialization( $block_type, 'spacing', 'blockGap' ); $style = wp_get_layout_style( ".$container_class", $used_layout, $has_block_gap_support, $gap_value, $should_skip_gap_serialization, $fallback_gap_value ); // This assumes the hook only applies to blocks with a single wrapper. // I think this is a reasonable limitation for that particular hook. $content = preg_replace( '/' . preg_quote( 'class="', '/' ) . '/', 'class="' . esc_attr( implode( ' ', $class_names ) ) . ' ', $block_content, 1 ); wp_enqueue_block_support_styles( $style ); return $content; } // Register the block support. WP_Block_Supports::get_instance()->register( 'layout', array( 'register_attribute' => 'wp_register_layout_support', ) ); add_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 ); /** * For themes without theme.json file, make sure * to restore the inner div for the group block * to avoid breaking styles relying on that div. * * @since 5.8.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_restore_group_inner_container( $block_content, $block ) { $tag_name = isset( $block['attrs']['tagName'] ) ? $block['attrs']['tagName'] : 'div'; $group_with_inner_container_regex = sprintf( '/(^\s*<%1$s\b[^>]*wp-block-group(\s|")[^>]*>)(\s*]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/U', preg_quote( $tag_name, '/' ) ); if ( WP_Theme_JSON_Resolver::theme_has_support() || 1 === preg_match( $group_with_inner_container_regex, $block_content ) || ( isset( $block['attrs']['layout']['type'] ) && 'default' !== $block['attrs']['layout']['type'] ) ) { return $block_content; } $replace_regex = sprintf( '/(^\s*<%1$s\b[^>]*wp-block-group[^>]*>)(.*)(<\/%1$s>\s*$)/ms', preg_quote( $tag_name, '/' ) ); $updated_content = preg_replace_callback( $replace_regex, static function( $matches ) { return $matches[1] . '
' . $matches[2] . '
' . $matches[3]; }, $block_content ); return $updated_content; } add_filter( 'render_block_core/group', 'wp_restore_group_inner_container', 10, 2 ); /** * For themes without theme.json file, make sure * to restore the outer div for the aligned image block * to avoid breaking styles relying on that div. * * @since 6.0.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_restore_image_outer_container( $block_content, $block ) { $image_with_align = " /# 1) everything up to the class attribute contents ( ^\s* ]* \bclass= [\"'] ) # 2) the class attribute contents ( [^\"']* \bwp-block-image\b [^\"']* \b(?:alignleft|alignright|aligncenter)\b [^\"']* ) # 3) everything after the class attribute contents ( [\"'] [^>]* > .* <\/figure> )/iUx"; if ( WP_Theme_JSON_Resolver::theme_has_support() || 0 === preg_match( $image_with_align, $block_content, $matches ) ) { return $block_content; } $wrapper_classnames = array( 'wp-block-image' ); // If the block has a classNames attribute these classnames need to be removed from the content and added back // to the new wrapper div also. if ( ! empty( $block['attrs']['className'] ) ) { $wrapper_classnames = array_merge( $wrapper_classnames, explode( ' ', $block['attrs']['className'] ) ); } $content_classnames = explode( ' ', $matches[2] ); $filtered_content_classnames = array_diff( $content_classnames, $wrapper_classnames ); return '
' . $matches[1] . implode( ' ', $filtered_content_classnames ) . $matches[3] . '
'; } add_filter( 'render_block_core/image', 'wp_restore_image_outer_container', 10, 2 ); تماس با ما – تک ظرف
تماس با تک ظرف

با ما در تماس باشید.

ارتباط با کارخانه

۴ - ۳۴۳۲۸۵۶۰ - ۰۴۱

ارسال ایمیل

info@takzarfplastic.com

آدرس کارخانه

شهرک صنعتی شهید سلیمی، 30متری اول، نبش خیابان چهاردهم

ایمیل سایر واحدها

  • واحد‭ ‬فروش   ‭                Sales @ takzarfplastic.com 
  • منابع‭ ‬انسانی ‭            ‭ ‬    Human @ takzarfplastic.com  
  • تولید ‭                production @ takzarfplastic.com 
  • روابط‭ ‬عمومی ‭            ‭ ‬    pr @ takzarfplastic.com 
  • ارتباط‭ ‬با‭ ‬مشتریان‭       ‭ ‬    crm @ takzarfplastic.com  
  • صادرات‭    export @ takzarfplastic.com  

ارسال سریع پیام