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

3.18 - Admin UI part #7068

Open
piotrbak opened this issue Oct 27, 2024 · 2 comments · Fixed by #7094
Open

3.18 - Admin UI part #7068

piotrbak opened this issue Oct 27, 2024 · 2 comments · Fixed by #7094
Assignees
Labels
type: new feature Indicates the issue is a request for new functionality
Milestone

Comments

@piotrbak
Copy link
Contributor

User Story
As a user, I’d like to see the host Google font option in the UI

Acceptance Criteria

  • Host Google Font option is added in the media tab as a checkbox below the Image Dimensions section
  • The text under the media tab changes to “LazyLoad, image dimensions, font optimization”
  • The section heading is “Fonts”
  • The section description is “Download and serve fonts directly from your server. Reduces connections to external servers and minimizes font shifts. More info” (need links to documentation, FR and EN)
  • The checkbox label is “Host Google Fonts locally”
  • When enabling the option, the option is there in the options table
@piotrbak piotrbak added the type: new feature Indicates the issue is a request for new functionality label Oct 27, 2024
@piotrbak piotrbak added this to the 3.18 milestone Oct 27, 2024
@Khadreal
Copy link
Contributor

Khadreal commented Oct 30, 2024

Scope Solution:

  • On this line we should update the menu description to "LazyLoad, image dimensions, font optimization"
  • On this line add
    $fonts = $this->beacon->get_suggest( 'font_optimization' );
  • Add google_font array data after this line
'font_optimization_section' => [
    'title'       => __( 'Fonts', 'rocket' ),
    'type'        => 'fields_container',
    // translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
    'description' => sprintf( __( 'Download and serve fonts directly from your server. Reduces connections to external servers and minimizes font shifts. %1$sMore info%2$s', 'rocket' ), '<a href="' . esc_url( $fonts['url'] ) . '" data-beacon-article="' . esc_attr( $fonts['id'] ) . '" target="_blank" rel="noopener noreferrer">', '</a>' ),
    'help'        => $fonts,
    'page'        => 'media',
],
  • Here you can add after this line
'font_optimization'    => [
   'type'              => 'checkbox',
   'label'             => __( 'Host Google Fonts locally', 'rocket' ),
   'section'           => 'font_optimization_section',
   'page'              => 'media',
   'default'           => 0,
   'sanitize_callback' => 'sanitize_checkbox',
],
  • Lastly, don't forget to update beacon for the documentation link for FR and EN

@Miraeld
Copy link
Contributor

Miraeld commented Oct 30, 2024

The grooming is missing this AC:

The text under the media tab changes to “LazyLoad, image dimensions, font optimization”

Otherwise it looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: new feature Indicates the issue is a request for new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants