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 web app manifest display setting in Reading settings page #985

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

thelovekesh
Copy link
Collaborator

Fixes: #970

@codecov-commenter
Copy link

codecov-commenter commented May 14, 2023

Codecov Report

Patch coverage: 2.94% and project coverage change: -0.28 ⚠️

Comparison is base (456f039) 19.65% compared to head (39805fe) 19.38%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #985      +/-   ##
=============================================
- Coverage      19.65%   19.38%   -0.28%     
  Complexity       347      347              
=============================================
  Files             57       58       +1     
  Lines           2325     2358      +33     
=============================================
  Hits             457      457              
- Misses          1868     1901      +33     
Flag Coverage Δ
php 19.38% <2.94%> (-0.28%) ⬇️
unit 19.38% <2.94%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pwa.php 0.00% <0.00%> (ø)
wp-admin/options-web-app-manifest-display.php 0.00% <0.00%> (ø)
wp-includes/class-wp-web-app-manifest.php 66.52% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@thelovekesh thelovekesh requested a review from westonruter May 14, 2023 14:38
Comment on lines +16 to +23
register_setting(
'reading',
'web_app_manifest_display',
array(
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
)
);
Copy link
Collaborator

@westonruter westonruter May 15, 2023

Choose a reason for hiding this comment

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

We should make sure this doesn't end up adding web_app_manifest_display as an autoloaded option, since it is only used in the web app manifest request.

I think this may mean adding a call to add_option before this call.

add_option( 'web_app_manifest_display', 'minimal-ui', '', false );

Although there may be a better place for it.

I realize this should also be done for the short_name field.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And for the offline_browsing option.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For existing installs that have offline_browsing and short_name options that are autoloaded, they should switch to non-autoloaded.

*/
function render_web_app_manifest_display_setting_field() {
// See: <https://developer.mozilla.org/en-US/docs/Web/Manifest/display#values>.
$allowed_values = array( 'fullscreen', 'standalone', 'minimal-ui', 'browser' );
Copy link
Collaborator

Choose a reason for hiding this comment

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

While probably out of scope of this UI, there is also a display_override property: https://developer.chrome.com/articles/display-override/

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.

Expose the Web App Manifest display member as setting in admin
3 participants