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

[menu] Added a new filter for enabling the advanced CPT-related menu … #779

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

fajardoleo
Copy link
Contributor

…logic.

Copy link
Collaborator

@DanieleAlessandra DanieleAlessandra left a comment

Choose a reason for hiding this comment

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

Please take a look to my comments

'admin.php';

if ( fs_apply_filter( $this->_module_unique_affix, 'enable_cpt_advanced_menu_logic', false ) ) {
$parent_slug = 'admin.php';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to re-define $parent_slug here? it has just been defined on line 703.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DanieleAlessandra The line above preserves the original behavior when the new filter is not used. When the filter is applied, the behavior changes slightly, and not using admin.php may lead to unexpected issues.

$menu['parent_slug'] :
'admin.php';

if ( fs_apply_filter( $this->_module_unique_affix, 'enable_cpt_advanced_menu_logic', false ) ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have documentation about enable_cpt_advanced_menu_logic hook somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DanieleAlessandra This will be documented. Thanks!

Copy link
Collaborator

@DanieleAlessandra DanieleAlessandra left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Contributor

@swashata swashata left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@fajardoleo fajardoleo merged commit 30965dd into develop Jan 13, 2025
5 checks passed
@fajardoleo fajardoleo deleted the feature/leo/advanced-menu-logic-filter branch January 13, 2025 06:41
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.

3 participants