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

Remove Selected Admin Bar Links #52

Merged
merged 10 commits into from
Oct 25, 2023
Merged

Remove Selected Admin Bar Links #52

merged 10 commits into from
Oct 25, 2023

Conversation

vancoder
Copy link
Contributor

@vancoder vancoder commented Oct 23, 2023

Summary

Removes specific admin bar links that we don't normally want to include (comments and themes).

Changelog entries

Added

Added the clean_admin_bar feature.

Fixes #6

Summary by CodeRabbit

  • New Feature: Introduced the "Clean Admin Bar" feature in WordPress. This update enhances the user interface by decluttering the admin bar, removing specified menus for a cleaner, more intuitive experience.
  • Test: Added comprehensive test cases for the new "Clean Admin Bar" feature, ensuring its functionality and reliability.
  • Documentation: Updated the README file, removing the handle for the now obsolete disable_dashboard_widgets feature for clarity and accuracy.

@vancoder vancoder requested a review from a team as a code owner October 23, 2023 22:15
@kevinfodness kevinfodness changed the title Feature/6/tidy admin bar Remove Selected Admin Bar Links Oct 24, 2023
@kevinfodness kevinfodness added enhancement New feature or request php Requires understanding PHP labels Oct 24, 2023
Copy link
Member

@kevinfodness kevinfodness left a comment

Choose a reason for hiding this comment

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

Let me know when you've made the requested changes and I'll be happy to do a second review.

Copy link
Member

@kevinfodness kevinfodness left a comment

Choose a reason for hiding this comment

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

One small fix-up for the test, otherwise 🍣

public function test_filter() {

$admin_bar = $this->apply_admin_bar();
$node = 'comments';
Copy link
Member

Choose a reason for hiding this comment

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

comments is one of the nodes that the feature removes by default. I would recommend doing one of two things here to test the filter:

  1. Add a node that the feature doesn't remove by default. Check for its existence before running the removal, then ensure it was removed. Or:
  2. Instead of adding a node to the node list in the filter, return an array with only one thing in it (e.g., comments) and then check to ensure that comments was removed but one of the other default nodes (e.g., themes) wasn't.

@coderabbitai
Copy link

coderabbitai bot commented Oct 25, 2023

Walkthrough

The pull request introduces a new feature to clean the WordPress admin bar by removing specified menus. The feature is implemented in a new class Clean_Admin_Bar and is added to the list of features in load.php. The PR also includes test cases for the new feature in test-clean-admin-bar.php.

Changes

File Summary
README.md The description for the disable_dashboard_widgets feature has been updated.
.../class-clean-admin-bar.php A new class Clean_Admin_Bar is introduced to clean the WordPress admin bar by removing specified menus.
.../load.php The new feature "clean_admin_bar" is added to the list of features.
.../test-clean-admin-bar.php Test cases for the new feature are added. The tests cover the removal of admin bar nodes and the application of filters.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

@vancoder vancoder merged commit 4665bec into main Oct 25, 2023
7 checks passed
@vancoder vancoder deleted the feature/6/tidy-admin-bar branch October 25, 2023 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request php Requires understanding PHP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unused admin bar links
2 participants