mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
Editor: Update WordPress packages published for Gutenberg 10.6
It contains several changes in addition to regular update to WordPress packages: - All newly exposed blocks are now registered on the server. - Dutone block support was added. - Border block support was updated. - New shared function `construct_wp_query_args` was added for the family of Query blocks - it might need some further work. Props youknowriad. See #52991. Built from https://develop.svn.wordpress.org/trunk@50929 git-svn-id: http://core.svn.wordpress.org/trunk@50538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
087934feea
commit
c3ea09ebb8
File diff suppressed because one or more lines are too long
@ -18,7 +18,7 @@
|
||||
function wp_register_border_support( $block_type ) {
|
||||
// Determine if any border related features are supported.
|
||||
$has_border_support = block_has_support( $block_type, array( '__experimentalBorder' ) );
|
||||
$has_border_color_support = block_has_support( $block_type, array( '__experimentalBorder', 'color' ) );
|
||||
$has_border_color_support = wp_has_border_feature_support( $block_type, 'color' );
|
||||
|
||||
// Setup attributes and styles within that if needed.
|
||||
if ( ! $block_type->attributes ) {
|
||||
@ -60,7 +60,7 @@ function wp_apply_border_support( $block_type, $block_attributes ) {
|
||||
|
||||
// Border radius.
|
||||
if (
|
||||
block_has_support( $block_type, array( '__experimentalBorder', 'radius' ) ) &&
|
||||
wp_has_border_feature_support( $block_type, 'radius' ) &&
|
||||
isset( $block_attributes['style']['border']['radius'] )
|
||||
) {
|
||||
$border_radius = (int) $block_attributes['style']['border']['radius'];
|
||||
@ -69,7 +69,7 @@ function wp_apply_border_support( $block_type, $block_attributes ) {
|
||||
|
||||
// Border style.
|
||||
if (
|
||||
block_has_support( $block_type, array( '__experimentalBorder', 'style' ) ) &&
|
||||
wp_has_border_feature_support( $block_type, 'style' ) &&
|
||||
isset( $block_attributes['style']['border']['style'] )
|
||||
) {
|
||||
$border_style = $block_attributes['style']['border']['style'];
|
||||
@ -78,7 +78,7 @@ function wp_apply_border_support( $block_type, $block_attributes ) {
|
||||
|
||||
// Border width.
|
||||
if (
|
||||
block_has_support( $block_type, array( '__experimentalBorder', 'width' ) ) &&
|
||||
wp_has_border_feature_support( $block_type, 'width' ) &&
|
||||
isset( $block_attributes['style']['border']['width'] )
|
||||
) {
|
||||
$border_width = intval( $block_attributes['style']['border']['width'] );
|
||||
@ -86,7 +86,7 @@ function wp_apply_border_support( $block_type, $block_attributes ) {
|
||||
}
|
||||
|
||||
// Border color.
|
||||
if ( block_has_support( $block_type, array( '__experimentalBorder', 'color' ) ) ) {
|
||||
if ( wp_has_border_feature_support( $block_type, 'color' ) ) {
|
||||
$has_named_border_color = array_key_exists( 'borderColor', $block_attributes );
|
||||
$has_custom_border_color = isset( $block_attributes['style']['border']['color'] );
|
||||
|
||||
@ -135,6 +135,37 @@ function wp_skip_border_serialization( $block_type ) {
|
||||
$border_support['__experimentalSkipSerialization'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the current block type supports the border feature requested.
|
||||
*
|
||||
* If the `__experimentalBorder` support flag is a boolean `true` all border
|
||||
* support features are available. Otherwise, the specific feature's support
|
||||
* flag nested under `experimentalBorder` must be enabled for the feature
|
||||
* to be opted into.
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param WP_Block_Type $block_type Block type to check for support.
|
||||
* @param string $feature Name of the feature to check support for.
|
||||
* @param mixed $default Fallback value for feature support, defaults to false.
|
||||
*
|
||||
* @return boolean Whether or not the feature is supported.
|
||||
*/
|
||||
function wp_has_border_feature_support( $block_type, $feature, $default = false ) {
|
||||
// Check if all border support features have been opted into via `"__experimentalBorder": true`.
|
||||
if (
|
||||
property_exists( $block_type, 'supports' ) &&
|
||||
( true === _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), $default ) )
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the specific feature has been opted into individually
|
||||
// via nested flag under `__experimentalBorder`.
|
||||
return block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default );
|
||||
}
|
||||
|
||||
// Register the block support.
|
||||
WP_Block_Supports::get_instance()->register(
|
||||
'border',
|
||||
|
432
wp-includes/block-supports/duotone.php
Normal file
432
wp-includes/block-supports/duotone.php
Normal file
@ -0,0 +1,432 @@
|
||||
<?php
|
||||
/**
|
||||
* Duotone block support flag.
|
||||
*
|
||||
* Parts of this source were derived and modified from TinyColor,
|
||||
* released under the MIT license.
|
||||
*
|
||||
* https://github.com/bgrins/TinyColor
|
||||
*
|
||||
* Copyright (c), Brian Grinstead, http://briangrinstead.com
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* @package WordPress
|
||||
* @since 5.8.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Takes input from [0, n] and returns it as [0, 1].
|
||||
*
|
||||
* Direct port of TinyColor's function, lightly simplified to maintain
|
||||
* consistency with TinyColor.
|
||||
*
|
||||
* @see https://github.com/bgrins/TinyColor
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param mixed $n Number of unknown type.
|
||||
* @param int $max Upper value of the range to bound to.
|
||||
*
|
||||
* @return float Value in the range [0, 1].
|
||||
*/
|
||||
function wp_tinycolor_bound01( $n, $max ) {
|
||||
if ( 'string' === gettype( $n ) && false !== strpos( $n, '.' ) && 1 === (float) $n ) {
|
||||
$n = '100%';
|
||||
}
|
||||
|
||||
$n = min( $max, max( 0, (float) $n ) );
|
||||
|
||||
// Automatically convert percentage into number.
|
||||
if ( 'string' === gettype( $n ) && false !== strpos( $n, '%' ) ) {
|
||||
$n = (int) ( $n * $max ) / 100;
|
||||
}
|
||||
|
||||
// Handle floating point rounding errors.
|
||||
if ( ( abs( $n - $max ) < 0.000001 ) ) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
// Convert into [0, 1] range if it isn't already.
|
||||
return ( $n % $max ) / (float) $max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Round and convert values of an RGB object.
|
||||
*
|
||||
* Direct port of TinyColor's function, lightly simplified to maintain
|
||||
* consistency with TinyColor.
|
||||
*
|
||||
* @see https://github.com/bgrins/TinyColor
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param array $rgb_color RGB object.
|
||||
*
|
||||
* @return array Rounded and converted RGB object.
|
||||
*/
|
||||
function wp_tinycolor_rgb_to_rgb( $rgb_color ) {
|
||||
return array(
|
||||
'r' => wp_tinycolor_bound01( $rgb_color['r'], 255 ) * 255,
|
||||
'g' => wp_tinycolor_bound01( $rgb_color['g'], 255 ) * 255,
|
||||
'b' => wp_tinycolor_bound01( $rgb_color['b'], 255 ) * 255,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for hsl to rgb conversion.
|
||||
*
|
||||
* Direct port of TinyColor's function, lightly simplified to maintain
|
||||
* consistency with TinyColor.
|
||||
*
|
||||
* @see https://github.com/bgrins/TinyColor
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param float $p first component.
|
||||
* @param float $q second component.
|
||||
* @param float $t third component.
|
||||
*
|
||||
* @return float R, G, or B component.
|
||||
*/
|
||||
function wp_tinycolor_hue_to_rgb( $p, $q, $t ) {
|
||||
if ( $t < 0 ) {
|
||||
$t += 1;
|
||||
}
|
||||
if ( $t > 1 ) {
|
||||
$t -= 1;
|
||||
}
|
||||
if ( $t < 1 / 6 ) {
|
||||
return $p + ( $q - $p ) * 6 * $t;
|
||||
}
|
||||
if ( $t < 1 / 2 ) {
|
||||
return $q;
|
||||
}
|
||||
if ( $t < 2 / 3 ) {
|
||||
return $p + ( $q - $p ) * ( 2 / 3 - $t ) * 6;
|
||||
}
|
||||
return $p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an HSL object to an RGB object with converted and rounded values.
|
||||
*
|
||||
* Direct port of TinyColor's function, lightly simplified to maintain
|
||||
* consistency with TinyColor.
|
||||
*
|
||||
* @see https://github.com/bgrins/TinyColor
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param array $hsl_color HSL object.
|
||||
*
|
||||
* @return array Rounded and converted RGB object.
|
||||
*/
|
||||
function wp_tinycolor_hsl_to_rgb( $hsl_color ) {
|
||||
$h = wp_tinycolor_bound01( $hsl_color['h'], 360 );
|
||||
$s = wp_tinycolor_bound01( $hsl_color['s'], 100 );
|
||||
$l = wp_tinycolor_bound01( $hsl_color['l'], 100 );
|
||||
|
||||
if ( 0 === $s ) {
|
||||
// Achromatic.
|
||||
$r = $l;
|
||||
$g = $l;
|
||||
$b = $l;
|
||||
} else {
|
||||
$q = $l < 0.5 ? $l * ( 1 + $s ) : $l + $s - $l * $s;
|
||||
$p = 2 * $l - $q;
|
||||
$r = wp_tinycolor_hue_to_rgb( $p, $q, $h + 1 / 3 );
|
||||
$g = wp_tinycolor_hue_to_rgb( $p, $q, $h );
|
||||
$b = wp_tinycolor_hue_to_rgb( $p, $q, $h - 1 / 3 );
|
||||
}
|
||||
|
||||
return array(
|
||||
'r' => $r * 255,
|
||||
'g' => $g * 255,
|
||||
'b' => $b * 255,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses hex, hsl, and rgb CSS strings using the same regex as TinyColor v1.4.2
|
||||
* used in the JavaScript. Only colors output from react-color are implemented
|
||||
* and the alpha value is ignored as it is not used in duotone.
|
||||
*
|
||||
* Direct port of TinyColor's function, lightly simplified to maintain
|
||||
* consistency with TinyColor.
|
||||
*
|
||||
* @see https://github.com/bgrins/TinyColor
|
||||
* @see https://github.com/casesandberg/react-color/
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param string $color_str CSS color string.
|
||||
*
|
||||
* @return array RGB object.
|
||||
*/
|
||||
function wp_tinycolor_string_to_rgb( $color_str ) {
|
||||
$color_str = strtolower( trim( $color_str ) );
|
||||
|
||||
$css_integer = '[-\\+]?\\d+%?';
|
||||
$css_number = '[-\\+]?\\d*\\.\\d+%?';
|
||||
|
||||
$css_unit = '(?:' . $css_number . ')|(?:' . $css_integer . ')';
|
||||
|
||||
$permissive_match3 = '[\\s|\\(]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')\\s*\\)?';
|
||||
$permissive_match4 = '[\\s|\\(]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')\\s*\\)?';
|
||||
|
||||
$rgb_regexp = '/^rgb' . $permissive_match3 . '$/';
|
||||
if ( preg_match( $rgb_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_rgb_to_rgb(
|
||||
array(
|
||||
'r' => $match[1],
|
||||
'g' => $match[2],
|
||||
'b' => $match[3],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$rgba_regexp = '/^rgba' . $permissive_match4 . '$/';
|
||||
if ( preg_match( $rgba_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_rgb_to_rgb(
|
||||
array(
|
||||
'r' => $match[1],
|
||||
'g' => $match[2],
|
||||
'b' => $match[3],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$hsl_regexp = '/^hsl' . $permissive_match3 . '$/';
|
||||
if ( preg_match( $hsl_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_hsl_to_rgb(
|
||||
array(
|
||||
'h' => $match[1],
|
||||
's' => $match[2],
|
||||
'l' => $match[3],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$hsla_regexp = '/^hsla' . $permissive_match4 . '$/';
|
||||
if ( preg_match( $hsla_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_hsl_to_rgb(
|
||||
array(
|
||||
'h' => $match[1],
|
||||
's' => $match[2],
|
||||
'l' => $match[3],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$hex8_regexp = '/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/';
|
||||
if ( preg_match( $hex8_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_rgb_to_rgb(
|
||||
array(
|
||||
'r' => base_convert( $match[1], 16, 10 ),
|
||||
'g' => base_convert( $match[2], 16, 10 ),
|
||||
'b' => base_convert( $match[3], 16, 10 ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$hex6_regexp = '/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/';
|
||||
if ( preg_match( $hex6_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_rgb_to_rgb(
|
||||
array(
|
||||
'r' => base_convert( $match[1], 16, 10 ),
|
||||
'g' => base_convert( $match[2], 16, 10 ),
|
||||
'b' => base_convert( $match[3], 16, 10 ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$hex4_regexp = '/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/';
|
||||
if ( preg_match( $hex4_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_rgb_to_rgb(
|
||||
array(
|
||||
'r' => base_convert( $match[1] . $match[1], 16, 10 ),
|
||||
'g' => base_convert( $match[2] . $match[2], 16, 10 ),
|
||||
'b' => base_convert( $match[3] . $match[3], 16, 10 ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$hex3_regexp = '/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/';
|
||||
if ( preg_match( $hex3_regexp, $color_str, $match ) ) {
|
||||
return wp_tinycolor_rgb_to_rgb(
|
||||
array(
|
||||
'r' => base_convert( $match[1] . $match[1], 16, 10 ),
|
||||
'g' => base_convert( $match[2] . $match[2], 16, 10 ),
|
||||
'b' => base_convert( $match[3] . $match[3], 16, 10 ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Registers the style and colors block attributes for block types that support it.
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param WP_Block_Type $block_type Block Type.
|
||||
*/
|
||||
function wp_register_duotone_support( $block_type ) {
|
||||
$has_duotone_support = false;
|
||||
if ( property_exists( $block_type, 'supports' ) ) {
|
||||
$has_duotone_support = _wp_array_get( $block_type->supports, array( 'color', '__experimentalDuotone' ), false );
|
||||
}
|
||||
|
||||
if ( $has_duotone_support ) {
|
||||
if ( ! $block_type->attributes ) {
|
||||
$block_type->attributes = array();
|
||||
}
|
||||
|
||||
if ( ! array_key_exists( 'style', $block_type->attributes ) ) {
|
||||
$block_type->attributes['style'] = array(
|
||||
'type' => 'object',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render out the duotone stylesheet and SVG.
|
||||
*
|
||||
* @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_render_duotone_support( $block_content, $block ) {
|
||||
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
|
||||
|
||||
$duotone_support = false;
|
||||
if ( $block_type && property_exists( $block_type, 'supports' ) ) {
|
||||
$duotone_support = _wp_array_get( $block_type->supports, array( 'color', '__experimentalDuotone' ), false );
|
||||
}
|
||||
|
||||
$has_duotone_attribute = isset( $block['attrs']['style']['color']['duotone'] );
|
||||
|
||||
if (
|
||||
! $duotone_support ||
|
||||
! $has_duotone_attribute
|
||||
) {
|
||||
return $block_content;
|
||||
}
|
||||
|
||||
$duotone_colors = $block['attrs']['style']['color']['duotone'];
|
||||
|
||||
$duotone_values = array(
|
||||
'r' => array(),
|
||||
'g' => array(),
|
||||
'b' => array(),
|
||||
);
|
||||
foreach ( $duotone_colors as $color_str ) {
|
||||
$color = wp_tinycolor_string_to_rgb( $color_str );
|
||||
|
||||
$duotone_values['r'][] = $color['r'] / 255;
|
||||
$duotone_values['g'][] = $color['g'] / 255;
|
||||
$duotone_values['b'][] = $color['b'] / 255;
|
||||
}
|
||||
|
||||
$duotone_id = 'wp-duotone-filter-' . uniqid();
|
||||
|
||||
$selectors = explode( ',', $duotone_support );
|
||||
$selectors_scoped = array_map(
|
||||
function ( $selector ) use ( $duotone_id ) {
|
||||
return '.' . $duotone_id . ' ' . trim( $selector );
|
||||
},
|
||||
$selectors
|
||||
);
|
||||
$selectors_group = implode( ', ', $selectors_scoped );
|
||||
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<style>
|
||||
<?php echo $selectors_group; ?> {
|
||||
filter: url( <?php echo esc_url( '#' . $duotone_id ); ?> );
|
||||
}
|
||||
</style>
|
||||
|
||||
<svg
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 0 0"
|
||||
width="0"
|
||||
height="0"
|
||||
focusable="false"
|
||||
role="none"
|
||||
style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"
|
||||
>
|
||||
<defs>
|
||||
<filter id="<?php echo esc_attr( $duotone_id ); ?>">
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
<?php // phpcs:disable Generic.WhiteSpace.DisallowSpaceIndent ?>
|
||||
values=".299 .587 .114 0 0
|
||||
.299 .587 .114 0 0
|
||||
.299 .587 .114 0 0
|
||||
0 0 0 1 0"
|
||||
<?php // phpcs:enable Generic.WhiteSpace.DisallowSpaceIndent ?>
|
||||
/>
|
||||
<feComponentTransfer color-interpolation-filters="sRGB" >
|
||||
<feFuncR type="table" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['r'] ) ); ?>" />
|
||||
<feFuncG type="table" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['g'] ) ); ?>" />
|
||||
<feFuncB type="table" tableValues="<?php echo esc_attr( implode( ' ', $duotone_values['b'] ) ); ?>" />
|
||||
</feComponentTransfer>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
<?php
|
||||
|
||||
$duotone = ob_get_clean();
|
||||
|
||||
// Like the layout hook, this assumes the hook only applies to blocks with a single wrapper.
|
||||
$content = preg_replace(
|
||||
'/' . preg_quote( 'class="', '/' ) . '/',
|
||||
'class="' . $duotone_id . ' ',
|
||||
$block_content,
|
||||
1
|
||||
);
|
||||
|
||||
return $content . $duotone;
|
||||
}
|
||||
|
||||
// Register the block support.
|
||||
WP_Block_Supports::get_instance()->register(
|
||||
'duotone',
|
||||
array(
|
||||
'register_attribute' => 'wp_register_duotone_support',
|
||||
)
|
||||
);
|
||||
add_filter( 'render_block', 'wp_render_duotone_support', 10, 2 );
|
@ -14,13 +14,15 @@
|
||||
* @since 5.8.0
|
||||
* @access private
|
||||
*
|
||||
* @param string $block_content Rendered block content.
|
||||
* @param array $block Block object.
|
||||
* @return string Filtered block content.
|
||||
* @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 ) {
|
||||
$group_with_inner_container_regex = '/(^\s*<div\b[^>]*wp-block-group(\s|")[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/';
|
||||
|
||||
// TODO: Add check for theme.json presence.
|
||||
if (
|
||||
'core/group' !== $block['blockName'] ||
|
||||
1 === preg_match( $group_with_inner_container_regex, $block_content )
|
||||
|
@ -79,8 +79,10 @@ function wp_apply_typography_support( $block_type, $block_attributes ) {
|
||||
$has_text_decoration_support = _wp_array_get( $block_type->supports, array( '__experimentalTextDecoration' ), false );
|
||||
$has_text_transform_support = _wp_array_get( $block_type->supports, array( '__experimentalTextTransform' ), false );
|
||||
|
||||
$skip_font_size_support_serialization = _wp_array_get( $block_type->supports, array( '__experimentalSkipFontSizeSerialization' ), false );
|
||||
|
||||
// Font Size.
|
||||
if ( $has_font_size_support ) {
|
||||
if ( $has_font_size_support && ! $skip_font_size_support_serialization ) {
|
||||
$has_named_font_size = array_key_exists( 'fontSize', $block_attributes );
|
||||
$has_custom_font_size = isset( $block_attributes['style']['typography']['fontSize'] );
|
||||
|
||||
|
@ -961,3 +961,65 @@ function block_has_support( $block_type, $feature, $default = false ) {
|
||||
|
||||
return true === $block_support || is_array( $block_support );
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that constructs a WP_Query args array from
|
||||
* a `Query` block properties.
|
||||
*
|
||||
* It's used in Query Loop, Query Pagination Numbers and Query Pagination Next blocks.
|
||||
*
|
||||
* @since 5.8.0
|
||||
*
|
||||
* @param WP_Block $block Block instance.
|
||||
* @param int $page Current query's page.
|
||||
*
|
||||
* @return array Returns the constructed WP_Query arguments.
|
||||
*/
|
||||
function construct_wp_query_args( $block, $page ) {
|
||||
$query = array(
|
||||
'post_type' => 'post',
|
||||
'order' => 'DESC',
|
||||
'orderby' => 'date',
|
||||
'post__not_in' => array(),
|
||||
);
|
||||
|
||||
if ( isset( $block->context['query'] ) ) {
|
||||
if ( isset( $block->context['query']['postType'] ) ) {
|
||||
$query['post_type'] = $block->context['query']['postType'];
|
||||
}
|
||||
if ( isset( $block->context['query']['sticky'] ) && ! empty( $block->context['query']['sticky'] ) ) {
|
||||
$sticky = get_option( 'sticky_posts' );
|
||||
if ( 'only' === $block->context['query']['sticky'] ) {
|
||||
$query['post__in'] = $sticky;
|
||||
} else {
|
||||
$query['post__not_in'] = array_merge( $query['post__not_in'], $sticky );
|
||||
}
|
||||
}
|
||||
if ( isset( $block->context['query']['exclude'] ) ) {
|
||||
$query['post__not_in'] = array_merge( $query['post__not_in'], $block->context['query']['exclude'] );
|
||||
}
|
||||
if ( isset( $block->context['query']['perPage'] ) ) {
|
||||
$query['offset'] = ( $block->context['query']['perPage'] * ( $page - 1 ) ) + $block->context['query']['offset'];
|
||||
$query['posts_per_page'] = $block->context['query']['perPage'];
|
||||
}
|
||||
if ( isset( $block->context['query']['categoryIds'] ) ) {
|
||||
$query['category__in'] = $block->context['query']['categoryIds'];
|
||||
}
|
||||
if ( isset( $block->context['query']['tagIds'] ) ) {
|
||||
$query['tag__in'] = $block->context['query']['tagIds'];
|
||||
}
|
||||
if ( isset( $block->context['query']['order'] ) ) {
|
||||
$query['order'] = strtoupper( $block->context['query']['order'] );
|
||||
}
|
||||
if ( isset( $block->context['query']['orderBy'] ) ) {
|
||||
$query['orderby'] = $block->context['query']['orderBy'];
|
||||
}
|
||||
if ( isset( $block->context['query']['author'] ) ) {
|
||||
$query['author'] = $block->context['query']['author'];
|
||||
}
|
||||
if ( isset( $block->context['query']['search'] ) ) {
|
||||
$query['s'] = $block->context['query']['search'];
|
||||
}
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/archives",
|
||||
"title": "Archives",
|
||||
"category": "widgets",
|
||||
"description": "Display a monthly archive of your posts.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"displayAsDropdown": {
|
||||
"type": "boolean",
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/audio",
|
||||
"title": "Audio",
|
||||
"category": "media",
|
||||
"description": "Embed a simple audio player.",
|
||||
"keywords": [ "music", "sound", "podcast", "recording" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"src": {
|
||||
"type": "string",
|
||||
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/block",
|
||||
"title": "Reusable block",
|
||||
"category": "reusable",
|
||||
"description": "Create and save content to reuse across your site. Update the block, and the changes apply everywhere it’s used.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"ref": {
|
||||
"type": "number"
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/button",
|
||||
"title": "Button",
|
||||
"category": "design",
|
||||
"parent": [ "core/buttons" ],
|
||||
"description": "Prompt visitors to take action with a button-style link.",
|
||||
"keywords": [ "link" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
@ -66,6 +70,10 @@
|
||||
"__experimentalFontFamily": true,
|
||||
"__experimentalSelector": ".wp-block-button__link"
|
||||
},
|
||||
"styles": [
|
||||
{ "name": "fill", "label": "Fill", "isDefault": true },
|
||||
{ "name": "outline", "label": "Outline" }
|
||||
],
|
||||
"editorStyle": "wp-block-button-editor",
|
||||
"style": "wp-block-button"
|
||||
}
|
||||
|
@ -111,6 +111,9 @@
|
||||
width: calc(75% - 0.5em);
|
||||
}
|
||||
.wp-block-buttons > .wp-block-button.wp-block-button__width-100 {
|
||||
width: calc(100% - 0.5em);
|
||||
}
|
||||
.wp-block-buttons > .wp-block-button.wp-block-button__width-100:only-child {
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
2
wp-includes/blocks/button/style-rtl.min.css
vendored
2
wp-includes/blocks/button/style-rtl.min.css
vendored
@ -1 +1 @@
|
||||
.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;cursor:pointer;display:inline-block;font-size:1.125em;padding:calc(.667em + 2px) calc(1.333em + 2px);text-align:center;text-decoration:none;overflow-wrap:break-word;box-sizing:border-box}.wp-block-button__link:active,.wp-block-button__link:focus,.wp-block-button__link:hover,.wp-block-button__link:visited{color:#fff}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{margin-left:0;width:100%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.is-style-outline>.wp-block-button__link,.wp-block-button__link.is-style-outline{border:2px solid;padding:.667em 1.333em}.is-style-outline>.wp-block-button__link:not(.has-text-color),.wp-block-button__link.is-style-outline:not(.has-text-color){color:currentColor}.is-style-outline>.wp-block-button__link:not(.has-background),.wp-block-button__link.is-style-outline:not(.has-background){background-color:initial}
|
||||
.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;cursor:pointer;display:inline-block;font-size:1.125em;padding:calc(.667em + 2px) calc(1.333em + 2px);text-align:center;text-decoration:none;overflow-wrap:break-word;box-sizing:border-box}.wp-block-button__link:active,.wp-block-button__link:focus,.wp-block-button__link:hover,.wp-block-button__link:visited{color:#fff}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{width:calc(100% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100:only-child{margin-left:0;width:100%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.is-style-outline>.wp-block-button__link,.wp-block-button__link.is-style-outline{border:2px solid;padding:.667em 1.333em}.is-style-outline>.wp-block-button__link:not(.has-text-color),.wp-block-button__link.is-style-outline:not(.has-text-color){color:currentColor}.is-style-outline>.wp-block-button__link:not(.has-background),.wp-block-button__link.is-style-outline:not(.has-background){background-color:initial}
|
@ -112,6 +112,9 @@
|
||||
width: calc(75% - 0.5em);
|
||||
}
|
||||
.wp-block-buttons > .wp-block-button.wp-block-button__width-100 {
|
||||
width: calc(100% - 0.5em);
|
||||
}
|
||||
.wp-block-buttons > .wp-block-button.wp-block-button__width-100:only-child {
|
||||
margin-right: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
2
wp-includes/blocks/button/style.min.css
vendored
2
wp-includes/blocks/button/style.min.css
vendored
@ -1 +1 @@
|
||||
.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;cursor:pointer;display:inline-block;font-size:1.125em;padding:calc(.667em + 2px) calc(1.333em + 2px);text-align:center;text-decoration:none;overflow-wrap:break-word;box-sizing:border-box}.wp-block-button__link:active,.wp-block-button__link:focus,.wp-block-button__link:hover,.wp-block-button__link:visited{color:#fff}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{margin-right:0;width:100%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.is-style-outline>.wp-block-button__link,.wp-block-button__link.is-style-outline{border:2px solid;padding:.667em 1.333em}.is-style-outline>.wp-block-button__link:not(.has-text-color),.wp-block-button__link.is-style-outline:not(.has-text-color){color:currentColor}.is-style-outline>.wp-block-button__link:not(.has-background),.wp-block-button__link.is-style-outline:not(.has-background){background-color:initial}
|
||||
.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;cursor:pointer;display:inline-block;font-size:1.125em;padding:calc(.667em + 2px) calc(1.333em + 2px);text-align:center;text-decoration:none;overflow-wrap:break-word;box-sizing:border-box}.wp-block-button__link:active,.wp-block-button__link:focus,.wp-block-button__link:hover,.wp-block-button__link:visited{color:#fff}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{width:calc(100% - .5em)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100:only-child{margin-right:0;width:100%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.is-style-outline>.wp-block-button__link,.wp-block-button__link.is-style-outline{border:2px solid;padding:.667em 1.333em}.is-style-outline>.wp-block-button__link:not(.has-text-color),.wp-block-button__link.is-style-outline:not(.has-text-color){color:currentColor}.is-style-outline>.wp-block-button__link:not(.has-background),.wp-block-button__link.is-style-outline:not(.has-background){background-color:initial}
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/buttons",
|
||||
"title": "Buttons",
|
||||
"category": "design",
|
||||
"description": "Prompt visitors to take action with a group of button-style links.",
|
||||
"keywords": [ "link" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"contentJustification": {
|
||||
"type": "string"
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/calendar",
|
||||
"title": "Calendar",
|
||||
"category": "widgets",
|
||||
"description": "A calendar of your site’s posts.",
|
||||
"keywords": [ "posts", "archive" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"month": {
|
||||
"type": "integer"
|
||||
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/categories",
|
||||
"title": "Categories",
|
||||
"category": "widgets",
|
||||
"description": "Display a list of all categories.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"displayAsDropdown": {
|
||||
"type": "boolean",
|
||||
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/code",
|
||||
"title": "Code",
|
||||
"category": "text",
|
||||
"description": "Display code snippets that respect your spacing and tabs.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
|
@ -1,8 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/column",
|
||||
"title": "Column",
|
||||
"category": "text",
|
||||
"parent": [ "core/columns" ],
|
||||
"description": "A single column within a columns block.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"verticalAlignment": {
|
||||
"type": "string"
|
||||
@ -11,7 +14,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"templateLock": {
|
||||
"type": "string"
|
||||
"enum": [ "all", "insert", false ]
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/columns",
|
||||
"title": "Columns",
|
||||
"category": "design",
|
||||
"description": "Add a block that displays content in multiple columns, then add whatever content blocks you’d like.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"verticalAlignment": {
|
||||
"type": "string"
|
||||
|
@ -134,8 +134,7 @@
|
||||
align-self: flex-start;
|
||||
}
|
||||
.wp-block-column.is-vertically-aligned-center {
|
||||
-ms-grid-row-align: center;
|
||||
align-self: center;
|
||||
align-self: center;
|
||||
}
|
||||
.wp-block-column.is-vertically-aligned-bottom {
|
||||
align-self: flex-end;
|
||||
|
2
wp-includes/blocks/columns/style-rtl.min.css
vendored
2
wp-includes/blocks/columns/style-rtl.min.css
vendored
@ -1 +1 @@
|
||||
.wp-block-columns{display:flex;margin-bottom:1.75em;box-sizing:border-box;flex-wrap:wrap}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap}}.wp-block-columns.has-background{padding:1.25em 2.375em}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}.wp-block-column{flex-grow:1;min-width:0;word-break:break-word;overflow-wrap:break-word}@media (max-width:599px){.wp-block-column{flex-basis:100%!important}}@media (min-width:600px) and (max-width:781px){.wp-block-column:not(:only-child){flex-basis:calc(50% - 1em)!important;flex-grow:0}.wp-block-column:nth-child(2n){margin-right:2em}}@media (min-width:782px){.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-column[style*=flex-basis]{flex-grow:0}.wp-block-column:not(:first-child){margin-right:2em}}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{-ms-grid-row-align:center;align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}
|
||||
.wp-block-columns{display:flex;margin-bottom:1.75em;box-sizing:border-box;flex-wrap:wrap}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap}}.wp-block-columns.has-background{padding:1.25em 2.375em}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}.wp-block-column{flex-grow:1;min-width:0;word-break:break-word;overflow-wrap:break-word}@media (max-width:599px){.wp-block-column{flex-basis:100%!important}}@media (min-width:600px) and (max-width:781px){.wp-block-column:not(:only-child){flex-basis:calc(50% - 1em)!important;flex-grow:0}.wp-block-column:nth-child(2n){margin-right:2em}}@media (min-width:782px){.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-column[style*=flex-basis]{flex-grow:0}.wp-block-column:not(:first-child){margin-right:2em}}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}
|
@ -134,8 +134,7 @@
|
||||
align-self: flex-start;
|
||||
}
|
||||
.wp-block-column.is-vertically-aligned-center {
|
||||
-ms-grid-row-align: center;
|
||||
align-self: center;
|
||||
align-self: center;
|
||||
}
|
||||
.wp-block-column.is-vertically-aligned-bottom {
|
||||
align-self: flex-end;
|
||||
|
2
wp-includes/blocks/columns/style.min.css
vendored
2
wp-includes/blocks/columns/style.min.css
vendored
@ -1 +1 @@
|
||||
.wp-block-columns{display:flex;margin-bottom:1.75em;box-sizing:border-box;flex-wrap:wrap}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap}}.wp-block-columns.has-background{padding:1.25em 2.375em}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}.wp-block-column{flex-grow:1;min-width:0;word-break:break-word;overflow-wrap:break-word}@media (max-width:599px){.wp-block-column{flex-basis:100%!important}}@media (min-width:600px) and (max-width:781px){.wp-block-column:not(:only-child){flex-basis:calc(50% - 1em)!important;flex-grow:0}.wp-block-column:nth-child(2n){margin-left:2em}}@media (min-width:782px){.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-column[style*=flex-basis]{flex-grow:0}.wp-block-column:not(:first-child){margin-left:2em}}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{-ms-grid-row-align:center;align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}
|
||||
.wp-block-columns{display:flex;margin-bottom:1.75em;box-sizing:border-box;flex-wrap:wrap}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap}}.wp-block-columns.has-background{padding:1.25em 2.375em}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}.wp-block-column{flex-grow:1;min-width:0;word-break:break-word;overflow-wrap:break-word}@media (max-width:599px){.wp-block-column{flex-basis:100%!important}}@media (min-width:600px) and (max-width:781px){.wp-block-column:not(:only-child){flex-basis:calc(50% - 1em)!important;flex-grow:0}.wp-block-column:nth-child(2n){margin-left:2em}}@media (min-width:782px){.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-column[style*=flex-basis]{flex-grow:0}.wp-block-column:not(:first-child){margin-left:2em}}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/cover",
|
||||
"title": "Cover",
|
||||
"category": "media",
|
||||
"description": "Add an image or video with a text overlay — great for headers.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"url": {
|
||||
"type": "string"
|
||||
@ -56,6 +59,11 @@
|
||||
"html": false,
|
||||
"spacing": {
|
||||
"padding": true
|
||||
},
|
||||
"color": {
|
||||
"__experimentalDuotone": "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
|
||||
"text": false,
|
||||
"background": false
|
||||
}
|
||||
},
|
||||
"editorStyle": "wp-block-cover-editor",
|
||||
|
@ -305,8 +305,7 @@
|
||||
height: 100%;
|
||||
max-width: none;
|
||||
max-height: none;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
object-fit: cover;
|
||||
outline: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
|
2
wp-includes/blocks/cover/style-rtl.min.css
vendored
2
wp-includes/blocks/cover/style-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@ -305,8 +305,7 @@
|
||||
height: 100%;
|
||||
max-width: none;
|
||||
max-height: none;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
object-fit: cover;
|
||||
outline: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
|
2
wp-includes/blocks/cover/style.min.css
vendored
2
wp-includes/blocks/cover/style.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/embed",
|
||||
"title": "Embed",
|
||||
"category": "embed",
|
||||
"description": "Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"url": {
|
||||
"type": "string"
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/file",
|
||||
"title": "File",
|
||||
"category": "media",
|
||||
"description": "Add a link to a downloadable file.",
|
||||
"keywords": [ "document", "pdf", "download" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"id": {
|
||||
"type": "number"
|
||||
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/freeform",
|
||||
"title": "Classic",
|
||||
"category": "text",
|
||||
"description": "Use the classic WordPress editor.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/gallery",
|
||||
"title": "Gallery",
|
||||
"category": "media",
|
||||
"description": "Display multiple images in a rich gallery.",
|
||||
"keywords": [ "images", "photos" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"images": {
|
||||
"type": "array",
|
||||
|
@ -159,8 +159,7 @@
|
||||
.wp-block-gallery.is-cropped .blocks-gallery-image, .wp-block-gallery.is-cropped .blocks-gallery-item,
|
||||
.blocks-gallery-grid.is-cropped .blocks-gallery-image,
|
||||
.blocks-gallery-grid.is-cropped .blocks-gallery-item {
|
||||
-ms-grid-row-align: inherit;
|
||||
align-self: inherit;
|
||||
align-self: inherit;
|
||||
}
|
||||
.wp-block-gallery.is-cropped .blocks-gallery-image a,
|
||||
.wp-block-gallery.is-cropped .blocks-gallery-image img, .wp-block-gallery.is-cropped .blocks-gallery-item a,
|
||||
@ -181,8 +180,7 @@
|
||||
.blocks-gallery-grid.is-cropped .blocks-gallery-item img {
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
.wp-block-gallery.columns-1 .blocks-gallery-image, .wp-block-gallery.columns-1 .blocks-gallery-item,
|
||||
|
2
wp-includes/blocks/gallery/style-rtl.min.css
vendored
2
wp-includes/blocks/gallery/style-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@ -159,8 +159,7 @@
|
||||
.wp-block-gallery.is-cropped .blocks-gallery-image, .wp-block-gallery.is-cropped .blocks-gallery-item,
|
||||
.blocks-gallery-grid.is-cropped .blocks-gallery-image,
|
||||
.blocks-gallery-grid.is-cropped .blocks-gallery-item {
|
||||
-ms-grid-row-align: inherit;
|
||||
align-self: inherit;
|
||||
align-self: inherit;
|
||||
}
|
||||
.wp-block-gallery.is-cropped .blocks-gallery-image a,
|
||||
.wp-block-gallery.is-cropped .blocks-gallery-image img, .wp-block-gallery.is-cropped .blocks-gallery-item a,
|
||||
@ -181,8 +180,7 @@
|
||||
.blocks-gallery-grid.is-cropped .blocks-gallery-item img {
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
.wp-block-gallery.columns-1 .blocks-gallery-image, .wp-block-gallery.columns-1 .blocks-gallery-item,
|
||||
|
2
wp-includes/blocks/gallery/style.min.css
vendored
2
wp-includes/blocks/gallery/style.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1,14 +1,18 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/group",
|
||||
"title": "Group",
|
||||
"category": "design",
|
||||
"description": "Combine blocks into a group.",
|
||||
"keywords": [ "container", "wrapper", "row", "section" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"tagName": {
|
||||
"type": "string",
|
||||
"default": "div"
|
||||
},
|
||||
"templateLock": {
|
||||
"type": "string"
|
||||
"enum": [ "all", "insert", false ]
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/heading",
|
||||
"title": "Heading",
|
||||
"category": "text",
|
||||
"description": "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
|
||||
"keywords": [ "title", "subtitle" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"textAlign": {
|
||||
"type": "string"
|
||||
@ -30,50 +34,7 @@
|
||||
},
|
||||
"fontSize": true,
|
||||
"lineHeight": true,
|
||||
"__experimentalSelector": {
|
||||
"core/heading/h1": {
|
||||
"selector": "h1",
|
||||
"title": "h1",
|
||||
"attributes": {
|
||||
"level": 1
|
||||
}
|
||||
},
|
||||
"core/heading/h2": {
|
||||
"selector": "h2",
|
||||
"title": "h2",
|
||||
"attributes": {
|
||||
"level": 2
|
||||
}
|
||||
},
|
||||
"core/heading/h3": {
|
||||
"selector": "h3",
|
||||
"title": "h3",
|
||||
"attributes": {
|
||||
"level": 3
|
||||
}
|
||||
},
|
||||
"core/heading/h4": {
|
||||
"selector": "h4",
|
||||
"title": "h4",
|
||||
"attributes": {
|
||||
"level": 4
|
||||
}
|
||||
},
|
||||
"core/heading/h5": {
|
||||
"selector": "h5",
|
||||
"title": "h5",
|
||||
"attributes": {
|
||||
"level": 5
|
||||
}
|
||||
},
|
||||
"core/heading/h6": {
|
||||
"selector": "h6",
|
||||
"title": "h6",
|
||||
"attributes": {
|
||||
"level": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
"__experimentalSelector": "h1,h2,h3,h4,h5,h6",
|
||||
"__unstablePasteTextInline": true
|
||||
},
|
||||
"editorStyle": "wp-block-heading-editor",
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/html",
|
||||
"title": "Custom HTML",
|
||||
"category": "widgets",
|
||||
"description": "Add custom HTML code and preview it as you edit.",
|
||||
"keywords": [ "embed" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/image",
|
||||
"title": "Image",
|
||||
"category": "media",
|
||||
"description": "Insert an image to make a visual statement.",
|
||||
"keywords": [ "img", "photo", "picture" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"align": {
|
||||
"type": "string"
|
||||
@ -72,10 +76,23 @@
|
||||
},
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"color": {
|
||||
"__experimentalDuotone": "img",
|
||||
"text": false,
|
||||
"background": false
|
||||
},
|
||||
"__experimentalBorder": {
|
||||
"radius": true
|
||||
}
|
||||
},
|
||||
"styles": [
|
||||
{
|
||||
"name": "default",
|
||||
"label": "Default",
|
||||
"isDefault": true
|
||||
},
|
||||
{ "name": "rounded", "label": "Rounded" }
|
||||
],
|
||||
"editorStyle": "wp-block-image-editor",
|
||||
"style": "wp-block-image"
|
||||
}
|
||||
|
@ -13,9 +13,26 @@ require ABSPATH . WPINC . '/blocks/categories.php';
|
||||
require ABSPATH . WPINC . '/blocks/file.php';
|
||||
require ABSPATH . WPINC . '/blocks/latest-comments.php';
|
||||
require ABSPATH . WPINC . '/blocks/latest-posts.php';
|
||||
require ABSPATH . WPINC . '/blocks/loginout.php';
|
||||
require ABSPATH . WPINC . '/blocks/post-author.php';
|
||||
require ABSPATH . WPINC . '/blocks/post-content.php';
|
||||
require ABSPATH . WPINC . '/blocks/post-date.php';
|
||||
require ABSPATH . WPINC . '/blocks/post-excerpt.php';
|
||||
require ABSPATH . WPINC . '/blocks/post-featured-image.php';
|
||||
require ABSPATH . WPINC . '/blocks/post-terms.php';
|
||||
require ABSPATH . WPINC . '/blocks/post-title.php';
|
||||
require ABSPATH . WPINC . '/blocks/query.php';
|
||||
require ABSPATH . WPINC . '/blocks/query-loop.php';
|
||||
require ABSPATH . WPINC . '/blocks/query-pagination.php';
|
||||
require ABSPATH . WPINC . '/blocks/query-pagination-next.php';
|
||||
require ABSPATH . WPINC . '/blocks/query-pagination-numbers.php';
|
||||
require ABSPATH . WPINC . '/blocks/query-pagination-previous.php';
|
||||
require ABSPATH . WPINC . '/blocks/query-title.php';
|
||||
require ABSPATH . WPINC . '/blocks/rss.php';
|
||||
require ABSPATH . WPINC . '/blocks/search.php';
|
||||
require ABSPATH . WPINC . '/blocks/shortcode.php';
|
||||
require ABSPATH . WPINC . '/blocks/site-tagline.php';
|
||||
require ABSPATH . WPINC . '/blocks/site-title.php';
|
||||
require ABSPATH . WPINC . '/blocks/social-link.php';
|
||||
require ABSPATH . WPINC . '/blocks/tag-cloud.php';
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/latest-comments",
|
||||
"title": "Latest Comments",
|
||||
"category": "widgets",
|
||||
"description": "Display a list of your most recent comments.",
|
||||
"keywords": [ "recent comments" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"commentsToShow": {
|
||||
"type": "number",
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/latest-posts",
|
||||
"title": "Latest Posts",
|
||||
"category": "widgets",
|
||||
"description": "Display a list of your most recent posts.",
|
||||
"keywords": [ "recent posts" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"categories": {
|
||||
"type": "array",
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/list",
|
||||
"title": "List",
|
||||
"category": "text",
|
||||
"description": "Create a bulleted or numbered list.",
|
||||
"keywords": [ "bullet list", "ordered list", "numbered list" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"ordered": {
|
||||
"type": "boolean",
|
||||
|
51
wp-includes/blocks/loginout.php
Normal file
51
wp-includes/blocks/loginout.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/loginout` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/loginout` block on server.
|
||||
*
|
||||
* @param array $attributes The block attributes.
|
||||
*
|
||||
* @return string Returns the login-out link or form.
|
||||
*/
|
||||
function render_block_core_loginout( $attributes ) {
|
||||
|
||||
// Build the redirect URL.
|
||||
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
|
||||
$classes = is_user_logged_in() ? 'logged-in' : 'logged-out';
|
||||
$contents = wp_loginout(
|
||||
isset( $attributes['redirectToCurrent'] ) && $attributes['redirectToCurrent'] ? $current_url : '',
|
||||
false
|
||||
);
|
||||
|
||||
// If logged-out and displayLoginAsForm is true, show the login form.
|
||||
if ( ! is_user_logged_in() && ! empty( $attributes['displayLoginAsForm'] ) ) {
|
||||
// Add a class.
|
||||
$classes .= ' has-login-form';
|
||||
|
||||
// Get the form.
|
||||
$contents = wp_login_form( array( 'echo' => false ) );
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
||||
|
||||
return '<div ' . $wrapper_attributes . '>' . $contents . '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/latest-posts` block on server.
|
||||
*/
|
||||
function register_block_core_loginout() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/loginout',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_loginout',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_loginout' );
|
23
wp-includes/blocks/loginout/block.json
Normal file
23
wp-includes/blocks/loginout/block.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/loginout",
|
||||
"title": "Login/out",
|
||||
"category": "design",
|
||||
"description": "Show login & logout links.",
|
||||
"keywords": [ "login", "logout", "form" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"displayLoginAsForm": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"redirectToCurrent": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
"className": true,
|
||||
"fontSize": false
|
||||
}
|
||||
}
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/media-text",
|
||||
"title": "Media & Text",
|
||||
"category": "media",
|
||||
"description": "Set media and words side-by-side for a richer layout.",
|
||||
"keywords": [ "image", "video" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"align": {
|
||||
"type": "string",
|
||||
|
@ -69,10 +69,7 @@
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-media-text .__resizable_base__ {
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
grid-column: 1/span 2;
|
||||
-ms-grid-row: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
.wp-block-media-text .__resizable_base__{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/span 2;-ms-grid-row:2;grid-row:2}.wp-block-media-text .editor-media-container__resizer{width:100%!important}.wp-block-media-text.is-image-fill .editor-media-container__resizer{height:100%!important}.wp-block-media-text>.block-editor-block-list__layout>.block-editor-block-list__block{max-width:unset}
|
||||
.wp-block-media-text .__resizable_base__{grid-column:1/span 2;grid-row:2}.wp-block-media-text .editor-media-container__resizer{width:100%!important}.wp-block-media-text.is-image-fill .editor-media-container__resizer{height:100%!important}.wp-block-media-text>.block-editor-block-list__layout>.block-editor-block-list__block{max-width:unset}
|
@ -69,10 +69,7 @@
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-media-text .__resizable_base__ {
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
grid-column: 1/span 2;
|
||||
-ms-grid-row: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
|
2
wp-includes/blocks/media-text/editor.min.css
vendored
2
wp-includes/blocks/media-text/editor.min.css
vendored
@ -1 +1 @@
|
||||
.wp-block-media-text .__resizable_base__{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/span 2;-ms-grid-row:2;grid-row:2}.wp-block-media-text .editor-media-container__resizer{width:100%!important}.wp-block-media-text.is-image-fill .editor-media-container__resizer{height:100%!important}.wp-block-media-text>.block-editor-block-list__layout>.block-editor-block-list__block{max-width:unset}
|
||||
.wp-block-media-text .__resizable_base__{grid-column:1/span 2;grid-row:2}.wp-block-media-text .editor-media-container__resizer{width:100%!important}.wp-block-media-text.is-image-fill .editor-media-container__resizer{height:100%!important}.wp-block-media-text>.block-editor-block-list__layout>.block-editor-block-list__block{max-width:unset}
|
@ -70,67 +70,52 @@
|
||||
*/
|
||||
.wp-block-media-text {
|
||||
direction: ltr;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 50% 1fr;
|
||||
grid-template-columns: 50% 1fr;
|
||||
-ms-grid-rows: auto;
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
.wp-block-media-text.has-media-on-the-right {
|
||||
-ms-grid-columns: 1fr 50%;
|
||||
grid-template-columns: 1fr 50%;
|
||||
}
|
||||
|
||||
.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,
|
||||
.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media {
|
||||
-ms-grid-row-align: start;
|
||||
align-self: start;
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
.wp-block-media-text .wp-block-media-text__content,
|
||||
.wp-block-media-text .wp-block-media-text__media,
|
||||
.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,
|
||||
.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media {
|
||||
-ms-grid-row-align: center;
|
||||
align-self: center;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,
|
||||
.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media {
|
||||
-ms-grid-row-align: end;
|
||||
align-self: end;
|
||||
align-self: end;
|
||||
}
|
||||
|
||||
.wp-block-media-text .wp-block-media-text__media {
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wp-block-media-text .wp-block-media-text__content {
|
||||
direction: rtl;
|
||||
-ms-grid-column: 2;
|
||||
grid-column: 2;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
padding: 0 8% 0 8%;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media {
|
||||
-ms-grid-column: 2;
|
||||
grid-column: 2;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
|
||||
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
|
||||
@ -172,19 +157,14 @@
|
||||
*/
|
||||
@media (max-width: 600px) {
|
||||
.wp-block-media-text.is-stacked-on-mobile {
|
||||
-ms-grid-columns: 100% !important;
|
||||
grid-template-columns: 100% !important;
|
||||
}
|
||||
.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media {
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
.wp-block-media-text{direction:ltr;display:-ms-grid;display:grid;-ms-grid-columns:50% 1fr;grid-template-columns:50% 1fr;-ms-grid-rows:auto;grid-template-rows:auto}.wp-block-media-text.has-media-on-the-right{-ms-grid-columns:1fr 50%;grid-template-columns:1fr 50%}.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media{-ms-grid-row-align:start;align-self:start}.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media,.wp-block-media-text .wp-block-media-text__content,.wp-block-media-text .wp-block-media-text__media{-ms-grid-row-align:center;align-self:center}.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media{-ms-grid-row-align:end;align-self:end}.wp-block-media-text .wp-block-media-text__media{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1;margin:0}.wp-block-media-text .wp-block-media-text__content{direction:rtl;padding:0 8%;word-break:break-word}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media,.wp-block-media-text .wp-block-media-text__content{-ms-grid-column:2;grid-column:2;-ms-grid-row:1;grid-row:1}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1}.wp-block-media-text__media img,.wp-block-media-text__media video{max-width:unset;width:100%;vertical-align:middle}.wp-block-media-text.is-image-fill .wp-block-media-text__media{height:100%;min-height:250px;background-size:cover}.wp-block-media-text.is-image-fill .wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill .wp-block-media-text__media img{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}@media (max-width:600px){.wp-block-media-text.is-stacked-on-mobile{-ms-grid-columns:100%!important;grid-template-columns:100%!important}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{-ms-grid-column:1;grid-column:1;-ms-grid-row:2;grid-row:2}}
|
||||
.wp-block-media-text{direction:ltr;display:grid;grid-template-columns:50% 1fr;grid-template-rows:auto}.wp-block-media-text.has-media-on-the-right{grid-template-columns:1fr 50%}.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media{align-self:start}.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media,.wp-block-media-text .wp-block-media-text__content,.wp-block-media-text .wp-block-media-text__media{align-self:center}.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media{align-self:end}.wp-block-media-text .wp-block-media-text__media{grid-column:1;grid-row:1;margin:0}.wp-block-media-text .wp-block-media-text__content{direction:rtl;grid-column:2;grid-row:1;padding:0 8%;word-break:break-word}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media{grid-column:2;grid-row:1}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content{grid-column:1;grid-row:1}.wp-block-media-text__media img,.wp-block-media-text__media video{max-width:unset;width:100%;vertical-align:middle}.wp-block-media-text.is-image-fill .wp-block-media-text__media{height:100%;min-height:250px;background-size:cover}.wp-block-media-text.is-image-fill .wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill .wp-block-media-text__media img{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}@media (max-width:600px){.wp-block-media-text.is-stacked-on-mobile{grid-template-columns:100%!important}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media{grid-column:1;grid-row:1}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{grid-column:1;grid-row:2}}
|
@ -72,43 +72,34 @@
|
||||
/*!rtl:begin:ignore*/
|
||||
direction: ltr;
|
||||
/*!rtl:end:ignore*/
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 50% 1fr;
|
||||
grid-template-columns: 50% 1fr;
|
||||
-ms-grid-rows: auto;
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
.wp-block-media-text.has-media-on-the-right {
|
||||
-ms-grid-columns: 1fr 50%;
|
||||
grid-template-columns: 1fr 50%;
|
||||
}
|
||||
|
||||
.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,
|
||||
.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media {
|
||||
-ms-grid-row-align: start;
|
||||
align-self: start;
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
.wp-block-media-text .wp-block-media-text__content,
|
||||
.wp-block-media-text .wp-block-media-text__media,
|
||||
.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,
|
||||
.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media {
|
||||
-ms-grid-row-align: center;
|
||||
align-self: center;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,
|
||||
.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media {
|
||||
-ms-grid-row-align: end;
|
||||
align-self: end;
|
||||
align-self: end;
|
||||
}
|
||||
|
||||
.wp-block-media-text .wp-block-media-text__media {
|
||||
/*!rtl:begin:ignore*/
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
/*!rtl:end:ignore*/
|
||||
margin: 0;
|
||||
@ -117,9 +108,7 @@
|
||||
.wp-block-media-text .wp-block-media-text__content {
|
||||
direction: ltr;
|
||||
/*!rtl:begin:ignore*/
|
||||
-ms-grid-column: 2;
|
||||
grid-column: 2;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
/*!rtl:end:ignore*/
|
||||
padding: 0 8% 0 8%;
|
||||
@ -128,18 +117,14 @@
|
||||
|
||||
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media {
|
||||
/*!rtl:begin:ignore*/
|
||||
-ms-grid-column: 2;
|
||||
grid-column: 2;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
/*!rtl:end:ignore*/
|
||||
}
|
||||
|
||||
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
|
||||
/*!rtl:begin:ignore*/
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
/*!rtl:end:ignore*/
|
||||
}
|
||||
@ -182,19 +167,14 @@
|
||||
*/
|
||||
@media (max-width: 600px) {
|
||||
.wp-block-media-text.is-stacked-on-mobile {
|
||||
-ms-grid-columns: 100% !important;
|
||||
grid-template-columns: 100% !important;
|
||||
}
|
||||
.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media {
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
|
||||
-ms-grid-column: 1;
|
||||
grid-column: 1;
|
||||
-ms-grid-row: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
}
|
12
wp-includes/blocks/media-text/style.min.css
vendored
12
wp-includes/blocks/media-text/style.min.css
vendored
@ -1,11 +1,11 @@
|
||||
.wp-block-media-text{
|
||||
/*!rtl:begin:ignore*/direction:ltr;
|
||||
/*!rtl:end:ignore*/display:-ms-grid;display:grid;-ms-grid-columns:50% 1fr;grid-template-columns:50% 1fr;-ms-grid-rows:auto;grid-template-rows:auto}.wp-block-media-text.has-media-on-the-right{-ms-grid-columns:1fr 50%;grid-template-columns:1fr 50%}.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media{-ms-grid-row-align:start;align-self:start}.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media,.wp-block-media-text .wp-block-media-text__content,.wp-block-media-text .wp-block-media-text__media{-ms-grid-row-align:center;align-self:center}.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media{-ms-grid-row-align:end;align-self:end}.wp-block-media-text .wp-block-media-text__media{
|
||||
/*!rtl:begin:ignore*/-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1;
|
||||
/*!rtl:end:ignore*/display:grid;grid-template-columns:50% 1fr;grid-template-rows:auto}.wp-block-media-text.has-media-on-the-right{grid-template-columns:1fr 50%}.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media{align-self:start}.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media,.wp-block-media-text .wp-block-media-text__content,.wp-block-media-text .wp-block-media-text__media{align-self:center}.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media{align-self:end}.wp-block-media-text .wp-block-media-text__media{
|
||||
/*!rtl:begin:ignore*/grid-column:1;grid-row:1;
|
||||
/*!rtl:end:ignore*/margin:0}.wp-block-media-text .wp-block-media-text__content{direction:ltr;
|
||||
/*!rtl:begin:ignore*/-ms-grid-column:2;grid-column:2;-ms-grid-row:1;grid-row:1;
|
||||
/*!rtl:begin:ignore*/grid-column:2;grid-row:1;
|
||||
/*!rtl:end:ignore*/padding:0 8%;word-break:break-word}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media{
|
||||
/*!rtl:begin:ignore*/-ms-grid-column:2;grid-column:2;-ms-grid-row:1;grid-row:1
|
||||
/*!rtl:begin:ignore*/grid-column:2;grid-row:1
|
||||
/*!rtl:end:ignore*/}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content{
|
||||
/*!rtl:begin:ignore*/-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1
|
||||
/*!rtl:end:ignore*/}.wp-block-media-text__media img,.wp-block-media-text__media video{max-width:unset;width:100%;vertical-align:middle}.wp-block-media-text.is-image-fill .wp-block-media-text__media{height:100%;min-height:250px;background-size:cover}.wp-block-media-text.is-image-fill .wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill .wp-block-media-text__media img{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}@media (max-width:600px){.wp-block-media-text.is-stacked-on-mobile{-ms-grid-columns:100%!important;grid-template-columns:100%!important}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{-ms-grid-column:1;grid-column:1;-ms-grid-row:2;grid-row:2}}
|
||||
/*!rtl:begin:ignore*/grid-column:1;grid-row:1
|
||||
/*!rtl:end:ignore*/}.wp-block-media-text__media img,.wp-block-media-text__media video{max-width:unset;width:100%;vertical-align:middle}.wp-block-media-text.is-image-fill .wp-block-media-text__media{height:100%;min-height:250px;background-size:cover}.wp-block-media-text.is-image-fill .wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill .wp-block-media-text__media img{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}@media (max-width:600px){.wp-block-media-text.is-stacked-on-mobile{grid-template-columns:100%!important}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media{grid-column:1;grid-row:1}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{grid-column:1;grid-row:2}}
|
@ -1,7 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/missing",
|
||||
"title": "Unsupported",
|
||||
"category": "text",
|
||||
"description": "Your site doesn’t include support for this block.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"originalName": {
|
||||
"type": "string"
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/more",
|
||||
"title": "More",
|
||||
"category": "design",
|
||||
"description": "Content before this block will be shown in the excerpt on your archives page.",
|
||||
"keywords": [ "read more" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"customText": {
|
||||
"type": "string"
|
||||
|
@ -1,8 +1,12 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/nextpage",
|
||||
"title": "Page Break",
|
||||
"category": "design",
|
||||
"description": "Separate your content into a multi-page experience.",
|
||||
"keywords": [ "next page", "pagination" ],
|
||||
"parent": [ "core/post-content" ],
|
||||
"textdomain": "default",
|
||||
"supports": {
|
||||
"customClassName": false,
|
||||
"className": false,
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/paragraph",
|
||||
"title": "Paragraph",
|
||||
"category": "text",
|
||||
"description": "Start with the building block of all narrative.",
|
||||
"keywords": [ "text" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"align": {
|
||||
"type": "string"
|
||||
|
61
wp-includes/blocks/post-author.php
Normal file
61
wp-includes/blocks/post-author.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/post-author` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/post-author` block on the server.
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
* @return string Returns the rendered author block.
|
||||
*/
|
||||
function render_block_core_post_author( $attributes, $content, $block ) {
|
||||
if ( ! isset( $block->context['postId'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$author_id = get_post_field( 'post_author', $block->context['postId'] );
|
||||
if ( empty( $author_id ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar(
|
||||
$author_id,
|
||||
$attributes['avatarSize']
|
||||
) : null;
|
||||
|
||||
$byline = ! empty( $attributes['byline'] ) ? $attributes['byline'] : false;
|
||||
$classes = array_merge(
|
||||
isset( $attributes['className'] ) ? array( $attributes['className'] ) : array(),
|
||||
isset( $attributes['itemsJustification'] ) ? array( 'items-justified-' . $attributes['itemsJustification'] ) : array(),
|
||||
isset( $attributes['textAlign'] ) ? array( 'has-text-align-' . $attributes['textAlign'] ) : array()
|
||||
);
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );
|
||||
|
||||
return sprintf( '<div %1$s>', $wrapper_attributes ) .
|
||||
( ! empty( $attributes['showAvatar'] ) ? '<div class="wp-block-post-author__avatar">' . $avatar . '</div>' : '' ) .
|
||||
'<div class="wp-block-post-author__content">' .
|
||||
( ! empty( $byline ) ? '<p class="wp-block-post-author__byline">' . $byline . '</p>' : '' ) .
|
||||
'<p class="wp-block-post-author__name">' . get_the_author_meta( 'display_name', $author_id ) . '</p>' .
|
||||
( ! empty( $attributes['showBio'] ) ? '<p class="wp-block-post-author__bio">' . get_the_author_meta( 'user_description', $author_id ) . '</p>' : '' ) .
|
||||
'</div>' .
|
||||
'</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/post-author` block on the server.
|
||||
*/
|
||||
function register_block_core_post_author() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/post-author',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_post_author',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_author' );
|
39
wp-includes/blocks/post-author/block.json
Normal file
39
wp-includes/blocks/post-author/block.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/post-author",
|
||||
"title": "Post Author",
|
||||
"category": "design",
|
||||
"description": "Add the author of this post.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"textAlign": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatarSize": {
|
||||
"type": "number",
|
||||
"default": 48
|
||||
},
|
||||
"showAvatar": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"showBio": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"byline": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postType", "postId" ],
|
||||
"supports": {
|
||||
"html": false,
|
||||
"fontSize": true,
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true
|
||||
},
|
||||
"lineHeight": true
|
||||
},
|
||||
"editorStyle": "wp-block-post-author-editor",
|
||||
"style": "wp-block-post-author"
|
||||
}
|
98
wp-includes/blocks/post-author/editor-rtl.css
Normal file
98
wp-includes/blocks/post-author/editor-rtl.css
Normal file
@ -0,0 +1,98 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-author {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__byline {
|
||||
font-size: 0.5em;
|
||||
margin-top: 0;
|
||||
position: relative;
|
||||
font-style: normal;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__content {
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__avatar img {
|
||||
margin: 0;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__avatar {
|
||||
margin-bottom: -8px;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__name {
|
||||
margin: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__bio {
|
||||
margin: 0 0 8px;
|
||||
font-size: 0.7em;
|
||||
}
|
1
wp-includes/blocks/post-author/editor-rtl.min.css
vendored
Normal file
1
wp-includes/blocks/post-author/editor-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-author{display:flex;flex-wrap:wrap}.wp-block-post-author .wp-block-post-author__byline{font-size:.5em;margin-top:0;position:relative;font-style:normal}.wp-block-post-author .wp-block-post-author__content{flex-grow:1;flex-basis:0}.wp-block-post-author .wp-block-post-author__avatar img{margin:0}.wp-block-post-author .wp-block-post-author__avatar{margin-bottom:-8px}.wp-block-post-author .wp-block-post-author__name{margin:0;font-weight:700}.wp-block-post-author .wp-block-post-author__bio{margin:0 0 8px;font-size:.7em}
|
98
wp-includes/blocks/post-author/editor.css
Normal file
98
wp-includes/blocks/post-author/editor.css
Normal file
@ -0,0 +1,98 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-author {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__byline {
|
||||
font-size: 0.5em;
|
||||
margin-top: 0;
|
||||
position: relative;
|
||||
font-style: normal;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__content {
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__avatar img {
|
||||
margin: 0;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__avatar {
|
||||
margin-bottom: -8px;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__name {
|
||||
margin: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.wp-block-post-author .wp-block-post-author__bio {
|
||||
margin: 0 0 8px;
|
||||
font-size: 0.7em;
|
||||
}
|
1
wp-includes/blocks/post-author/editor.min.css
vendored
Normal file
1
wp-includes/blocks/post-author/editor.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-author{display:flex;flex-wrap:wrap}.wp-block-post-author .wp-block-post-author__byline{font-size:.5em;margin-top:0;position:relative;font-style:normal}.wp-block-post-author .wp-block-post-author__content{flex-grow:1;flex-basis:0}.wp-block-post-author .wp-block-post-author__avatar img{margin:0}.wp-block-post-author .wp-block-post-author__avatar{margin-bottom:-8px}.wp-block-post-author .wp-block-post-author__name{margin:0;font-weight:700}.wp-block-post-author .wp-block-post-author__bio{margin:0 0 8px;font-size:.7em}
|
95
wp-includes/blocks/post-author/style-rtl.css
Normal file
95
wp-includes/blocks/post-author/style-rtl.css
Normal file
@ -0,0 +1,95 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-author {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.wp-block-post-author__byline {
|
||||
width: 100%;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 0.5em;
|
||||
}
|
||||
.wp-block-post-author__avatar {
|
||||
margin-left: 1em;
|
||||
}
|
||||
.wp-block-post-author__bio {
|
||||
margin-bottom: 0.7em;
|
||||
font-size: 0.7em;
|
||||
}
|
||||
.wp-block-post-author__content {
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
}
|
||||
.wp-block-post-author__name {
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
}
|
1
wp-includes/blocks/post-author/style-rtl.min.css
vendored
Normal file
1
wp-includes/blocks/post-author/style-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-author{display:flex;flex-wrap:wrap}.wp-block-post-author__byline{width:100%;margin-top:0;margin-bottom:0;font-size:.5em}.wp-block-post-author__avatar{margin-left:1em}.wp-block-post-author__bio{margin-bottom:.7em;font-size:.7em}.wp-block-post-author__content{flex-grow:1;flex-basis:0}.wp-block-post-author__name{font-weight:700;margin:0}
|
95
wp-includes/blocks/post-author/style.css
Normal file
95
wp-includes/blocks/post-author/style.css
Normal file
@ -0,0 +1,95 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-author {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.wp-block-post-author__byline {
|
||||
width: 100%;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 0.5em;
|
||||
}
|
||||
.wp-block-post-author__avatar {
|
||||
margin-right: 1em;
|
||||
}
|
||||
.wp-block-post-author__bio {
|
||||
margin-bottom: 0.7em;
|
||||
font-size: 0.7em;
|
||||
}
|
||||
.wp-block-post-author__content {
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
}
|
||||
.wp-block-post-author__name {
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
}
|
1
wp-includes/blocks/post-author/style.min.css
vendored
Normal file
1
wp-includes/blocks/post-author/style.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-author{display:flex;flex-wrap:wrap}.wp-block-post-author__byline{width:100%;margin-top:0;margin-bottom:0;font-size:.5em}.wp-block-post-author__avatar{margin-right:1em}.wp-block-post-author__bio{margin-bottom:.7em;font-size:.7em}.wp-block-post-author__content{flex-grow:1;flex-basis:0}.wp-block-post-author__name{font-weight:700;margin:0}
|
81
wp-includes/blocks/post-content.php
Normal file
81
wp-includes/blocks/post-content.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/post-content` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/post-content` block on the server.
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
* @return string Returns the filtered post content of the current post.
|
||||
*/
|
||||
function render_block_core_post_content( $attributes, $content, $block ) {
|
||||
static $seen_ids = array();
|
||||
|
||||
if ( ! isset( $block->context['postId'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$post_id = $block->context['postId'];
|
||||
|
||||
if ( isset( $seen_ids[ $post_id ] ) ) {
|
||||
if ( ! is_admin() ) {
|
||||
trigger_error(
|
||||
sprintf(
|
||||
// translators: %s is a post ID (integer).
|
||||
__( 'Could not render Post Content block with post ID: <code>%s</code>. Block cannot be rendered inside itself.' ),
|
||||
$post_id
|
||||
),
|
||||
E_USER_WARNING
|
||||
);
|
||||
}
|
||||
|
||||
$is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG &&
|
||||
defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY;
|
||||
return $is_debug ?
|
||||
// translators: Visible only in the front end, this warning takes the place of a faulty block.
|
||||
__( '[block rendering halted]' ) :
|
||||
'';
|
||||
}
|
||||
|
||||
$seen_ids[ $post_id ] = true;
|
||||
|
||||
if ( ! in_the_loop() ) {
|
||||
the_post();
|
||||
}
|
||||
|
||||
$content = get_the_content( null, false, $post_id );
|
||||
|
||||
if ( empty( $content ) ) {
|
||||
unset( $seen_ids[ $post_id ] );
|
||||
return '';
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) );
|
||||
/** This filter is documented in wp-includes/post-template.php */
|
||||
$content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
|
||||
unset( $seen_ids[ $post_id ] );
|
||||
|
||||
return (
|
||||
'<div ' . $wrapper_attributes . '>' .
|
||||
$content .
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/post-content` block on the server.
|
||||
*/
|
||||
function register_block_core_post_content() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/post-content',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_post_content',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_content' );
|
15
wp-includes/blocks/post-content/block.json
Normal file
15
wp-includes/blocks/post-content/block.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/post-content",
|
||||
"title": "Post Content",
|
||||
"category": "design",
|
||||
"description": "Displays the contents of a post or page.",
|
||||
"textdomain": "default",
|
||||
"usesContext": [ "postId", "postType" ],
|
||||
"supports": {
|
||||
"align": [ "wide", "full" ],
|
||||
"html": false,
|
||||
"__experimentalLayout": true
|
||||
},
|
||||
"editorStyle": "wp-block-post-content-editor"
|
||||
}
|
80
wp-includes/blocks/post-content/editor-rtl.css
Normal file
80
wp-includes/blocks/post-content/editor-rtl.css
Normal file
@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-content__placeholder {
|
||||
height: 100px;
|
||||
border: 1px dashed;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.wp-block-post-content__placeholder span {
|
||||
font-style: italic;
|
||||
}
|
1
wp-includes/blocks/post-content/editor-rtl.min.css
vendored
Normal file
1
wp-includes/blocks/post-content/editor-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-content__placeholder{height:100px;border:1px dashed;display:flex;justify-content:center;align-items:center}.wp-block-post-content__placeholder span{font-style:italic}
|
80
wp-includes/blocks/post-content/editor.css
Normal file
80
wp-includes/blocks/post-content/editor.css
Normal file
@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-content__placeholder {
|
||||
height: 100px;
|
||||
border: 1px dashed;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.wp-block-post-content__placeholder span {
|
||||
font-style: italic;
|
||||
}
|
1
wp-includes/blocks/post-content/editor.min.css
vendored
Normal file
1
wp-includes/blocks/post-content/editor.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-content__placeholder{height:100px;border:1px dashed;display:flex;justify-content:center;align-items:center}.wp-block-post-content__placeholder span{font-style:italic}
|
48
wp-includes/blocks/post-date.php
Normal file
48
wp-includes/blocks/post-date.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/post-date` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/post-date` block on the server.
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
* @return string Returns the filtered post date for the current post wrapped inside "time" tags.
|
||||
*/
|
||||
function render_block_core_post_date( $attributes, $content, $block ) {
|
||||
if ( ! isset( $block->context['postId'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$post_ID = $block->context['postId'];
|
||||
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
|
||||
$formatted_date = get_the_date( isset( $attributes['format'] ) ? $attributes['format'] : '', $post_ID );
|
||||
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
|
||||
$formatted_date = sprintf( '<a href="%1s">%2s</a>', get_the_permalink( $post_ID ), $formatted_date );
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'<div %1$s><time datetime="%2$s">%3$s</time></div>',
|
||||
$wrapper_attributes,
|
||||
get_the_date( 'c', $post_ID ),
|
||||
$formatted_date
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/post-date` block on the server.
|
||||
*/
|
||||
function register_block_core_post_date() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/post-date',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_post_date',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_date' );
|
30
wp-includes/blocks/post-date/block.json
Normal file
30
wp-includes/blocks/post-date/block.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/post-date",
|
||||
"title": "Post Date",
|
||||
"category": "design",
|
||||
"description": "Add the date of this post.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"textAlign": {
|
||||
"type": "string"
|
||||
},
|
||||
"format": {
|
||||
"type": "string"
|
||||
},
|
||||
"isLink": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType" ],
|
||||
"supports": {
|
||||
"html": false,
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true
|
||||
},
|
||||
"fontSize": true,
|
||||
"lineHeight": true
|
||||
}
|
||||
}
|
63
wp-includes/blocks/post-excerpt.php
Normal file
63
wp-includes/blocks/post-excerpt.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/post-excerpt` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/post-excerpt` block on the server.
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
* @return string Returns the filtered post excerpt for the current post wrapped inside "p" tags.
|
||||
*/
|
||||
function render_block_core_post_excerpt( $attributes, $content, $block ) {
|
||||
if ( ! isset( $block->context['postId'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$more_text = isset( $attributes['moreText'] ) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $block->context['postId'] ) ) . '">' . $attributes['moreText'] . '</a>' : '';
|
||||
|
||||
$filter_excerpt_length = function() use ( $attributes ) {
|
||||
return isset( $attributes['wordCount'] ) ? $attributes['wordCount'] : 55;
|
||||
};
|
||||
add_filter(
|
||||
'excerpt_length',
|
||||
$filter_excerpt_length
|
||||
);
|
||||
|
||||
$classes = '';
|
||||
if ( isset( $attributes['textAlign'] ) ) {
|
||||
$classes .= 'has-text-align-' . $attributes['textAlign'];
|
||||
}
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
||||
|
||||
$content = '<p class="wp-block-post-excerpt__excerpt">' . get_the_excerpt( $block->context['postId'] );
|
||||
if ( ! isset( $attributes['showMoreOnNewLine'] ) || $attributes['showMoreOnNewLine'] ) {
|
||||
$content .= '</p><p class="wp-block-post-excerpt__more-text">' . $more_text . '</p>';
|
||||
} else {
|
||||
$content .= " $more_text</p>";
|
||||
}
|
||||
|
||||
remove_filter(
|
||||
'excerpt_length',
|
||||
$filter_excerpt_length
|
||||
);
|
||||
|
||||
return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/post-excerpt` block on the server.
|
||||
*/
|
||||
function register_block_core_post_excerpt() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/post-excerpt',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_post_excerpt',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_excerpt' );
|
36
wp-includes/blocks/post-excerpt/block.json
Normal file
36
wp-includes/blocks/post-excerpt/block.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/post-excerpt",
|
||||
"title": "Post Excerpt",
|
||||
"category": "design",
|
||||
"description": "Display a post's excerpt.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"textAlign": {
|
||||
"type": "string"
|
||||
},
|
||||
"wordCount": {
|
||||
"type": "number",
|
||||
"default": 55
|
||||
},
|
||||
"moreText": {
|
||||
"type": "string"
|
||||
},
|
||||
"showMoreOnNewLine": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType" ],
|
||||
"supports": {
|
||||
"html": false,
|
||||
"fontSize": true,
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true
|
||||
},
|
||||
"lineHeight": true
|
||||
},
|
||||
"editorStyle": "wp-block-post-excerpt-editor",
|
||||
"style": "wp-block-post-excerpt"
|
||||
}
|
73
wp-includes/blocks/post-excerpt/editor-rtl.css
Normal file
73
wp-includes/blocks/post-excerpt/editor-rtl.css
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline {
|
||||
display: inline-block;
|
||||
}
|
1
wp-includes/blocks/post-excerpt/editor-rtl.min.css
vendored
Normal file
1
wp-includes/blocks/post-excerpt/editor-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline{display:inline-block}
|
73
wp-includes/blocks/post-excerpt/editor.css
Normal file
73
wp-includes/blocks/post-excerpt/editor.css
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline {
|
||||
display: inline-block;
|
||||
}
|
1
wp-includes/blocks/post-excerpt/editor.min.css
vendored
Normal file
1
wp-includes/blocks/post-excerpt/editor.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline{display:inline-block}
|
73
wp-includes/blocks/post-excerpt/style-rtl.css
Normal file
73
wp-includes/blocks/post-excerpt/style-rtl.css
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-excerpt__more-link {
|
||||
display: inline-block;
|
||||
}
|
1
wp-includes/blocks/post-excerpt/style-rtl.min.css
vendored
Normal file
1
wp-includes/blocks/post-excerpt/style-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-excerpt__more-link{display:inline-block}
|
73
wp-includes/blocks/post-excerpt/style.css
Normal file
73
wp-includes/blocks/post-excerpt/style.css
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-excerpt__more-link {
|
||||
display: inline-block;
|
||||
}
|
1
wp-includes/blocks/post-excerpt/style.min.css
vendored
Normal file
1
wp-includes/blocks/post-excerpt/style.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-excerpt__more-link{display:inline-block}
|
47
wp-includes/blocks/post-featured-image.php
Normal file
47
wp-includes/blocks/post-featured-image.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/post-featured-image` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/post-featured-image` block on the server.
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
* @return string Returns the featured image for the current post.
|
||||
*/
|
||||
function render_block_core_post_featured_image( $attributes, $content, $block ) {
|
||||
if ( ! isset( $block->context['postId'] ) ) {
|
||||
return '';
|
||||
}
|
||||
$post_ID = $block->context['postId'];
|
||||
|
||||
$featured_image = get_the_post_thumbnail( $post_ID );
|
||||
if ( ! $featured_image ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
|
||||
$featured_image = sprintf( '<a href="%1s">%2s</a>', get_the_permalink( $post_ID ), $featured_image );
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
|
||||
return '<p ' . $wrapper_attributes . '>' . $featured_image . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/post-featured-image` block on the server.
|
||||
*/
|
||||
function register_block_core_post_featured_image() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/post-featured-image',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_post_featured_image',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_featured_image' );
|
21
wp-includes/blocks/post-featured-image/block.json
Normal file
21
wp-includes/blocks/post-featured-image/block.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/post-featured-image",
|
||||
"title": "Post Featured Image",
|
||||
"category": "design",
|
||||
"description": "Display a post's featured image.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"isLink": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType" ],
|
||||
"supports": {
|
||||
"align": [ "left", "right", "center", "wide", "full" ],
|
||||
"html": false
|
||||
},
|
||||
"editorStyle": "wp-block-post-featured-image-editor",
|
||||
"style": "wp-block-post-featured-image"
|
||||
}
|
93
wp-includes/blocks/post-featured-image/editor-rtl.css
Normal file
93
wp-includes/blocks/post-featured-image/editor-rtl.css
Normal file
@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
div[data-type="core/post-featured-image"] img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .post-featured-image_placeholder {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
border-radius: 2px;
|
||||
background-color: #fff;
|
||||
box-shadow: inset 0 0 0 1px #1e1e1e;
|
||||
padding: 12px;
|
||||
}
|
||||
.editor-styles-wrapper .post-featured-image_placeholder svg {
|
||||
margin-left: 12px;
|
||||
}
|
||||
.editor-styles-wrapper .post-featured-image_placeholder p {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
}
|
1
wp-includes/blocks/post-featured-image/editor-rtl.min.css
vendored
Normal file
1
wp-includes/blocks/post-featured-image/editor-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
div[data-type="core/post-featured-image"] img{max-width:100%;height:auto;display:block}.editor-styles-wrapper .post-featured-image_placeholder{display:flex;flex-direction:row;align-items:flex-start;border-radius:2px;background-color:#fff;box-shadow:inset 0 0 0 1px #1e1e1e;padding:12px}.editor-styles-wrapper .post-featured-image_placeholder svg{margin-left:12px}.editor-styles-wrapper .post-featured-image_placeholder p{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;margin:0}
|
93
wp-includes/blocks/post-featured-image/editor.css
Normal file
93
wp-includes/blocks/post-featured-image/editor.css
Normal file
@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
div[data-type="core/post-featured-image"] img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .post-featured-image_placeholder {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
border-radius: 2px;
|
||||
background-color: #fff;
|
||||
box-shadow: inset 0 0 0 1px #1e1e1e;
|
||||
padding: 12px;
|
||||
}
|
||||
.editor-styles-wrapper .post-featured-image_placeholder svg {
|
||||
margin-right: 12px;
|
||||
}
|
||||
.editor-styles-wrapper .post-featured-image_placeholder p {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
}
|
1
wp-includes/blocks/post-featured-image/editor.min.css
vendored
Normal file
1
wp-includes/blocks/post-featured-image/editor.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
div[data-type="core/post-featured-image"] img{max-width:100%;height:auto;display:block}.editor-styles-wrapper .post-featured-image_placeholder{display:flex;flex-direction:row;align-items:flex-start;border-radius:2px;background-color:#fff;box-shadow:inset 0 0 0 1px #1e1e1e;padding:12px}.editor-styles-wrapper .post-featured-image_placeholder svg{margin-right:12px}.editor-styles-wrapper .post-featured-image_placeholder p{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;margin:0}
|
77
wp-includes/blocks/post-featured-image/style-rtl.css
Normal file
77
wp-includes/blocks/post-featured-image/style-rtl.css
Normal file
@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-featured-image a {
|
||||
display: inline-block;
|
||||
}
|
||||
.wp-block-post-featured-image img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
1
wp-includes/blocks/post-featured-image/style-rtl.min.css
vendored
Normal file
1
wp-includes/blocks/post-featured-image/style-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-featured-image a{display:inline-block}.wp-block-post-featured-image img{max-width:100%;height:auto}
|
77
wp-includes/blocks/post-featured-image/style.css
Normal file
77
wp-includes/blocks/post-featured-image/style.css
Normal file
@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-featured-image a {
|
||||
display: inline-block;
|
||||
}
|
||||
.wp-block-post-featured-image img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
1
wp-includes/blocks/post-featured-image/style.min.css
vendored
Normal file
1
wp-includes/blocks/post-featured-image/style.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-post-featured-image a{display:inline-block}.wp-block-post-featured-image img{max-width:100%;height:auto}
|
60
wp-includes/blocks/post-terms.php
Normal file
60
wp-includes/blocks/post-terms.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/post-terms` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/post-terms` block on the server.
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
* @return string Returns the filtered post terms for the current post wrapped inside "a" tags.
|
||||
*/
|
||||
function render_block_core_post_terms( $attributes, $content, $block ) {
|
||||
if ( ! isset( $block->context['postId'] ) || ! isset( $attributes['term'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$post_terms = get_the_terms( $block->context['postId'], $attributes['term'] );
|
||||
if ( is_wp_error( $post_terms ) ) {
|
||||
return '';
|
||||
}
|
||||
if ( empty( $post_terms ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$align_class_name = empty( $attributes['textAlign'] ) ? '' : ' ' . "has-text-align-{$attributes['textAlign']}";
|
||||
|
||||
$terms_links = '';
|
||||
foreach ( $post_terms as $term ) {
|
||||
$terms_links .= sprintf(
|
||||
'<a href="%1$s">%2$s</a> | ',
|
||||
get_term_link( $term->term_id ),
|
||||
esc_html( $term->name )
|
||||
);
|
||||
}
|
||||
$terms_links = trim( $terms_links, ' | ' );
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
|
||||
|
||||
return sprintf(
|
||||
'<div %1$s>%2$s</div>',
|
||||
$wrapper_attributes,
|
||||
$terms_links
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/post-terms` block on the server.
|
||||
*/
|
||||
function register_block_core_post_terms() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/post-terms',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_post_terms',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_terms' );
|
26
wp-includes/blocks/post-terms/block.json
Normal file
26
wp-includes/blocks/post-terms/block.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "core/post-terms",
|
||||
"title": "Post Terms",
|
||||
"category": "design",
|
||||
"description": "Post terms.",
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"term": {
|
||||
"type": "string"
|
||||
},
|
||||
"textAlign": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"usesContext": [ "postId", "postType" ],
|
||||
"supports": {
|
||||
"html": false,
|
||||
"fontSize": true,
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true
|
||||
},
|
||||
"lineHeight": true
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user