Skip to content

Add a check for the nav_menus panel.#2227

Draft
costdev wants to merge 1 commit intoWordPress:trunkfrom
costdev:check_for_nav_menus_panel
Draft

Add a check for the nav_menus panel.#2227
costdev wants to merge 1 commit intoWordPress:trunkfrom
costdev:check_for_nav_menus_panel

Conversation

@costdev
Copy link
Copy Markdown
Contributor

@costdev costdev commented Jan 25, 2022

<?php
$nav_menus = $this->manager->get_panel( 'nav_menus' );

if ( $nav_menus ) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hi thanks for the patch, tested and it works on my side, just one thought:

I think the if controle should wrap the span node too, to avoid orphan node https://prnt.sc/26tbhbx . thanks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @mauriac, thanks for the feedback! I couldn't reproduce the orphan node.

Some questions:

  1. What OS and browser are you using?
  2. What theme are you using?
  3. What steps did you take to find this issue?

I'm planning on a slightly different approach, but I want to make sure I can reproduce this issue and make sure that the new approach also removes this issue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. mac os, chrome
  2. TT2
  3. same steps to reproduce initial issue, but now you run the steps after applied your patch, then launch page inspection from chrome and search "customize-action" you will find what i've arrowed here. May be I wasn't clear; by "orphan" i was mean 'empty' node. And I think even without test, this is an evidence, if $nav_menus is empty nothing will not be displayed and the 'span' before the php code will be generated for nothing I think.

Hope you understand me.

@mauriac
Copy link
Copy Markdown
Member

mauriac commented Feb 11, 2022

hi thanks for the patch, tested and it works on my side, just one thought:

on line 1158, I think the "if" controle should wrap the span node too, to avoid orphan node https://prnt.sc/26tbhbx . thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants