Skip to content

Commit

Permalink
Merge branch 'WordPress:trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
karthick-murugan authored Dec 12, 2024
2 parents 05bb54c + 8277a74 commit 619fed3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 23 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
"build:packages": "npm run --silent build:package-types && node ./bin/packages/build.js",
"postbuild:packages": " npm run --if-present --workspaces build:wp",
"build:plugin-zip": "bash ./bin/build-plugin-zip.sh",
"clean:package-types": "tsc --build --clean && rimraf --glob './packages/*/build-types'",
"clean:packages": "rimraf --glob './packages/*/{build,build-module,build-wp,build-style}'",
"clean:package-types": "tsc --build --clean && rimraf --glob \"./packages/*/build-types\"",
"clean:packages": "rimraf --glob \"./packages/*/{build,build-module,build-wp,build-style}\"",
"component-usage-stats": "node ./node_modules/react-scanner/bin/react-scanner -c ./react-scanner.config.js",
"dev": "cross-env NODE_ENV=development npm run build:packages && concurrently \"wp-scripts start\" \"npm run dev:packages\"",
"dev:packages": "cross-env NODE_ENV=development concurrently \"node ./bin/packages/watch.js\" \"tsc --build --watch\"",
Expand All @@ -195,7 +195,7 @@
"docs:gen": "node ./docs/tool/index.js",
"docs:theme-ref": "node ./bin/api-docs/gen-theme-reference.mjs",
"env": "wp-env",
"fixtures:clean": "rimraf --glob 'test/integration/fixtures/blocks/*.{json,serialized.html}'",
"fixtures:clean": "rimraf --glob \"test/integration/fixtures/blocks/*.{json,serialized.html}\"",
"fixtures:generate": "cross-env GENERATE_MISSING_FIXTURES=y npm run test:unit test/integration/full-content/ && npm run format test/integration/fixtures/blocks/*.json",
"fixtures:regenerate": "npm-run-all fixtures:clean fixtures:generate",
"format": "wp-scripts format",
Expand Down
17 changes: 16 additions & 1 deletion packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,22 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
// Don't render the block's subtree if it is a draft or if the ID does not exist.
if ( $is_post_type && $navigation_link_has_id ) {
$post = get_post( $attributes['id'] );
if ( ! $post || 'publish' !== $post->post_status ) {
/**
* Filter allowed post_status for navigation link block to render.
*
* @since 6.8.0
*
* @param array $post_status
* @param array $attributes
* @param WP_Block $block
*/
$allowed_post_status = (array) apply_filters(
'render_block_core_navigation_link_allowed_post_status',
array( 'publish' ),
$attributes,
$block
);
if ( ! $post || ! in_array( $post->post_status, $allowed_post_status, true ) ) {
return '';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
__experimentalVStack as VStack,
__experimentalHStack as HStack,
FlexItem,
FlexBlock,
Button,
} from '@wordpress/components';
import {
Expand Down Expand Up @@ -111,23 +110,18 @@ function FontSizeGroup( {
key={ size.slug }
path={ `/typography/font-sizes/${ origin }/${ size.slug }` }
>
<HStack direction="row">
<HStack>
<FlexItem className="edit-site-font-size__item">
{ size.name }
</FlexItem>
<FlexItem>
<HStack justify="flex-end">
<FlexBlock className="edit-site-font-size__item edit-site-font-size__item-value">
{ size.size }
</FlexBlock>
<Icon
icon={
isRTL()
? chevronLeft
: chevronRight
}
/>
</HStack>
<FlexItem display="flex">
<Icon
icon={
isRTL()
? chevronLeft
: chevronRight
}
/>
</FlexItem>
</HStack>
</NavigationButtonAsItem>
Expand Down
12 changes: 8 additions & 4 deletions packages/edit-site/src/components/global-styles/shadows-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
Flex,
FlexItem,
} from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import { __, sprintf, isRTL } from '@wordpress/i18n';
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import { plus, shadow as shadowIcon } from '@wordpress/icons';
import { plus, Icon, chevronLeft, chevronRight } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -135,9 +135,13 @@ function ShadowItem( { shadow, category } ) {
return (
<NavigationButtonAsItem
path={ `/shadows/edit/${ category }/${ shadow.slug }` }
icon={ shadowIcon }
>
{ shadow.name }
<HStack>
<FlexItem>{ shadow.name }</FlexItem>
<FlexItem display="flex">
<Icon icon={ isRTL() ? chevronLeft : chevronRight } />
</FlexItem>
</HStack>
</NavigationButtonAsItem>
);
}

0 comments on commit 619fed3

Please sign in to comment.