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 Group ID to Level Settings page #2978

Merged
merged 3 commits into from
May 8, 2024

Conversation

andrewlimaza
Copy link
Contributor

  • ENHANCEMENT: Added group ID value to the menu location within the Level Settings page. This makes it easier to identify the group's ID for developers and future features that may need this.

The idea of putting this to the right of the name is to try and not clutter up the group names and make it easily visible without clicking around to get this data.

Screenshots
Screenshot 2024-04-26 at 13 15 05

Screenshot 2024-04-26 at 13 15 15

All Submissions:

* ENHANCEMENT: Added group ID value to the menu location.
@@ -342,7 +342,7 @@ function update_level_group_order(event, ui) {
<button class="pmpro_section-toggle-button" type="button" aria-expanded="<?php echo $section_visibility === 'hidden' ? 'false' : 'true'; ?>">
<span class="dashicons dashicons-arrow-<?php echo $section_visibility === 'hidden' ? 'down' : 'up'; ?>-alt2"></span>
<input type="hidden" class="pmpro-level-settings-group-id" value="<?php echo esc_attr( $level_group->id ); ?>" />
<?php echo esc_html( $level_group->name ) ?>
<?php echo esc_html( $level_group->name ) . '<small>'. sprintf( esc_html( 'ID: %d', 'paid-memberships-pro' ), $level_group->id ) . '</small>'; ?>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<?php echo esc_html( $level_group->name ) . '<small>'. sprintf( esc_html( 'ID: %d', 'paid-memberships-pro' ), $level_group->id ) . '</small>'; ?>
<?php echo esc_html( $level_group->name ) . '<small>'. esc_html( sprintf( __( 'ID: %d', 'paid-memberships-pro' ), $level_group->id ) ) . '</small>'; ?>

Localizing the ID string and making sure that PHPCS doesn't complain about non-escaped strings.

Copy link
Contributor Author

@andrewlimaza andrewlimaza Apr 29, 2024

Choose a reason for hiding this comment

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

Thanks for catching that, I made it translatable by changing esc_html to esc_html__

f4dfb4a

adminpages/membershiplevels.php Outdated Show resolved Hide resolved
@dparker1005 dparker1005 merged commit a2a76d0 into strangerstudios:dev May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants