-
Notifications
You must be signed in to change notification settings - Fork 806
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
Action Bar: Add Action Bar visibility
general setting
#41015
base: trunk
Are you sure you want to change the base?
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Mu Wpcom plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
* The setting is displayed only if the has the wp-admin interface selected. | ||
*/ | ||
function wpcomsh_wpcom_show_action_bar_settings_field() { | ||
add_settings_field( 'wpcom_show_action_bar', '', 'wpcom_show_action_bar_display', 'general', 'default' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that atomic sites don't show the Action Bar and I'm wondering whether we should check about the type before adding this setting ( at least for now ). 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should check if the site is Simple before running this.
Alternatively, if there are no plans to bring the action bar to Atomic sites, you could implement this logic directly in the wpcom
repo, which only runs on Simple sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an issue asking for the action bar in atomic sites: Automattic/wp-calypso#36795
In order to do that, I think we should move the actionbar mu-plugin from wpcom
repo to jetpack-wpcom-mu-plugin
or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to do that, I think we should move the actionbar mu-plugin from wpcom repo to jetpack-wpcom-mu-plugin or something like that.
Yes. @cbravobernal is something you're working on? My linked issue with yours are kind of co-dependent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, I was checking how to do it while I found this task and decided to wait. Feel free to take it if you feel more comfortable tackling all together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbravobernal sounds good. I'll see what's decided about atomic and handle these two issues accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are no plans to bring the action bar to Atomic sites, you could implement this logic directly in the wpcom repo, which only runs on Simple sites.
I would also recommend keeping things together in the dotcom codebase for now. It will make it easier to move things around when/if we eventually bring the action bar to WoA sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll port these changes to dotcom.
* The setting is stored in the `wpcom_show_action_bar` option. | ||
* The setting is displayed only if the has the wp-admin interface selected. | ||
*/ | ||
function wpcomsh_wpcom_show_action_bar_settings_field() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wpcom-admin-interface.php
file was intended to contain logic involving the different admin interfaces (Default, Classic), so I'd move this part to somewhere else. Maybe you can add a new features/action-bar/action-bar.php
file?
Also, this isn't a wpcomsh function, so I'd remove that prefix.
function wpcomsh_wpcom_show_action_bar_settings_field() { | |
function wpcom_show_action_bar_settings_field() { |
* The setting is displayed only if the has the wp-admin interface selected. | ||
*/ | ||
function wpcomsh_wpcom_show_action_bar_settings_field() { | ||
add_settings_field( 'wpcom_show_action_bar', '', 'wpcom_show_action_bar_display', 'general', 'default' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should check if the site is Simple before running this.
Alternatively, if there are no plans to bring the action bar to Atomic sites, you could implement this logic directly in the wpcom
repo, which only runs on Simple sites.
Part of: Automattic/wp-calypso#53830
This PR adds a new general setting (
wpcom_show_action_bar
) to conditionally show the Action Bar on the front end of a site. It adds the interface for the classic wp-admin interface and its default value istrue
to preserve current behavior where we always show the Action Bar.The main issue will need two more PRs to be complete that I'll create and link shortly:
wpcom
to check this option and not enqueue the Action Barcalypso
to add UI for this setting.Other information:
Does this pull request change what data or activity we track or use?
I saw that some other settings are being tracked. Do we need to do the same for this one?
Testing instructions:
true
.