Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add navigation block #443

Merged
merged 6 commits into from
Sep 7, 2023
Merged

Add navigation block #443

merged 6 commits into from
Sep 7, 2023

Conversation

adamwoodnz
Copy link
Contributor

@adamwoodnz adamwoodnz commented Sep 6, 2023

Closes #442

Copies the navigation block from wporg-main-2022 for reuse, and adds config for the documentation menu.

Testing

  • Test with the Main theme, remove/disable the local block first (PR)
  • Test with the Documentation theme (PR)

@adamwoodnz adamwoodnz self-assigned this Sep 6, 2023
@adamwoodnz adamwoodnz added [Block] New Block Redesign Related to the wordpress.org redesign project labels Sep 6, 2023
Copied from wporg-main-2022 for reuse
@adamwoodnz adamwoodnz force-pushed the add/442-navigation-block branch from e88836b to 8f03c79 Compare September 6, 2023 03:39
* `wp_json_file_decode` & `register_block_script_handle.
*/
function init() {
$metadata_file = dirname( dirname( __DIR__ ) ) . '/blocks/navigation/build/block.json';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path changed from main due to different file structure

@adamwoodnz adamwoodnz force-pushed the add/442-navigation-block branch from 14a0e95 to 9b73837 Compare September 7, 2023 02:42
'enqueue_block_assets',
function() use ( $editor_script_handle ) {
if ( is_admin() && wp_should_load_block_editor_scripts_and_styles() ) {
wp_localize_script(
Copy link
Contributor Author

@adamwoodnz adamwoodnz Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass menus to block editor frontend

Copy link
Contributor

@ryelle ryelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working great! I tested with both WordPress/wporg-documentation-2022#67 & WordPress/wporg-main-2022#323, and the frontend display works + editor UI looks good too.

A few minor comments, but nothing blocking 👍🏻

mu-plugins/blocks/navigation/index.php Outdated Show resolved Hide resolved
mu-plugins/blocks/navigation/index.php Show resolved Hide resolved
mu-plugins/blocks/navigation/index.php Outdated Show resolved Hide resolved
@adamwoodnz adamwoodnz merged commit 465fda5 into trunk Sep 7, 2023
@adamwoodnz adamwoodnz deleted the add/442-navigation-block branch September 7, 2023 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] New Block Redesign Related to the wordpress.org redesign project
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add translatable navigation block
3 participants