Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: littlebizzy/hovercraft
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.395
Choose a base ref
...
head repository: littlebizzy/hovercraft
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Nov 7, 2024

  1. Update google-fonts.php

    jessuppi authored Nov 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d31d6c2 View commit details
  2. Update style.css

    jessuppi authored Nov 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6321895 View commit details

Commits on Nov 8, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3f67c7e View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7043a9c View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9102f0e View commit details
  4. Update css-generator.php

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0f77dfe View commit details
  5. Update css-generator.php

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9a24c25 View commit details
  6. Update style.css

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2dd5e74 View commit details
  7. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    077222f View commit details
  8. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8c983f9 View commit details
  9. Update functions.php

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    cd303ce View commit details
  10. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    843bd81 View commit details
  11. Update style.css

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    de7a67c View commit details
  12. Update google-fonts.php

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e3b22d1 View commit details
  13. Update style.css

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f4fd975 View commit details
  14. Update readme.md

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3e99d1c View commit details
  15. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d1e33e1 View commit details
  16. Update style.css

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c496c9f View commit details
  17. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a6c07f6 View commit details
  18. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    683dc52 View commit details
  19. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0aaa3b4 View commit details
  20. Update style.css

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    006a175 View commit details
  21. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c7789c3 View commit details
  22. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2087877 View commit details
  23. Update css-generator.php

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7098a05 View commit details
  24. Update style.css

    jessuppi authored Nov 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2ba1fa9 View commit details

Commits on Dec 7, 2024

  1. Update css-generator.php

    jessuppi authored Dec 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2d5a94f View commit details
  2. Update style.css

    jessuppi authored Dec 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dd1a0cc View commit details

Commits on Dec 9, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c62c9fd View commit details
  2. Update css-generator.php

    jessuppi authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1def8a9 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5da6b70 View commit details
  4. Update style.css

    jessuppi authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    352cba3 View commit details
  5. Update css-generator.php

    jessuppi authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    472429e View commit details
  6. Update style.css

    jessuppi authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d2abad8 View commit details
  7. Update css-generator.php

    jessuppi authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7719f59 View commit details
  8. Update style.css

    jessuppi authored Dec 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5be153f View commit details

Commits on Dec 11, 2024

  1. Update css-generator.php

    jessuppi authored Dec 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5af5611 View commit details
  2. Update css-generator.php

    jessuppi authored Dec 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    30d925b View commit details
  3. Update css-generator.php

    jessuppi authored Dec 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    24704d9 View commit details
  4. Update css-generator.php

    jessuppi authored Dec 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9e1d8e2 View commit details
  5. Update google-fonts.php

    jessuppi authored Dec 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    17c36d6 View commit details
  6. Update style.css

    jessuppi authored Dec 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    466168c View commit details
  7. Update css-generator.php

    jessuppi authored Dec 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a4c0de8 View commit details
Showing with 547 additions and 238 deletions.
  1. +3 −0 functions.php
  2. +194 −71 inc/css-generator.php
  3. +291 −161 inc/customizer/customizer-settings.php
  4. +44 −0 inc/customizer/font-family-helper.php
  5. +12 −4 inc/google-fonts.php
  6. +2 −1 readme.md
  7. +1 −1 style.css
3 changes: 3 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
@@ -47,6 +47,9 @@
// Register snippets category (customizer)
require get_template_directory() . '/inc/customizer/register-snippets-category.php';

// font family helper (customizer)
require get_template_directory() . '/inc/customizer/font-family-helper.php';

// google fonts array (customizer)
require get_template_directory() . '/inc/customizer/google-fonts-array.php';

265 changes: 194 additions & 71 deletions inc/css-generator.php

Large diffs are not rendered by default.

452 changes: 291 additions & 161 deletions inc/customizer/customizer-settings.php

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions inc/customizer/font-family-helper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
function hovercraft_available_fonts() {
// get and format the first font family for google fonts
$first_font_family = get_theme_mod( 'hovercraft_first_font_family', 'noto_sans' );
$first_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $first_font_family ) ) );

// get and format the second font family for google fonts
$second_font_family = get_theme_mod( 'hovercraft_second_font_family', 'open_sans' );
$second_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $second_font_family ) ) );

// get and format the third font family for google fonts
$third_font_family = get_theme_mod( 'hovercraft_third_font_family', 'roboto' );
$third_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $third_font_family ) ) );

// get and format the multilingual font family for google fonts
$multilingual_font_family = get_theme_mod( 'hovercraft_multilingual_font_family', 'none' );
$multilingual_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $multilingual_font_family ) ) );

// initialize an array for font families with the default option included
$hovercraft_font_families = array(
'' => __( 'Default (unspecified)', 'hovercraft' ), // always include this as the first option
);

// add each formatted font family to the array if it's not empty or 'none'
if ( ! empty( $first_font_family ) && $first_font_family !== 'none' ) {
$hovercraft_font_families[ $first_font_family ] = $first_font_family_final;
}

if ( ! empty( $second_font_family ) && $second_font_family !== 'none' ) {
$hovercraft_font_families[ $second_font_family ] = $second_font_family_final;
}

if ( ! empty( $third_font_family ) && $third_font_family !== 'none' ) {
$hovercraft_font_families[ $third_font_family ] = $third_font_family_final;
}

if ( ! empty( $multilingual_font_family ) && $multilingual_font_family !== 'none' ) {
$hovercraft_font_families[ $multilingual_font_family ] = $multilingual_font_family_final;
}

return $hovercraft_font_families;
}

// Ref: ChatGPT
16 changes: 12 additions & 4 deletions inc/google-fonts.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<?php

function hovercraft_google_fonts() {
function hovercraft_enqueue_google_fonts() {

// get and format the first font family for google fonts
$first_font_family = get_theme_mod( 'hovercraft_first_font_family', 'noto_sans' );
$first_font_family_final = ucwords( ucfirst( str_replace( '_', '+', $first_font_family ) ), '+' );

// get and format the second font family for google fonts
$second_font_family = get_theme_mod( 'hovercraft_second_font_family', 'open_sans' );
$second_font_family = get_theme_mod( 'hovercraft_second_font_family', '' );
$second_font_family_final = ucwords( ucfirst( str_replace( '_', '+', $second_font_family ) ), '+' );

// get and format the third font family for google fonts
$third_font_family = get_theme_mod( 'hovercraft_third_font_family', 'roboto' );
$third_font_family = get_theme_mod( 'hovercraft_third_font_family', '' );
$third_font_family_final = ucwords( ucfirst( str_replace( '_', '+', $third_font_family ) ), '+' );

// get and format the multilingual font family for google fonts
$multilingual_font_family = get_theme_mod( 'hovercraft_multilingual_font_family', '' );
$multilingual_font_family_final = ucwords( ucfirst( str_replace( '_', '+', $multilingual_font_family ) ), '+' );

// specify only the font variations 400, 600, and 700 for both regular and italic styles
$font_variations = 'ital,wght@0,400;0,600;0,700;1,400;1,600;1,700';

@@ -33,14 +37,18 @@ function hovercraft_google_fonts() {
$google_fonts[] = "family={$third_font_family_final}:$font_variations";
}

if ( ! empty( $multilingual_font_family ) && $multilingual_font_family !== 'none' ) {
$google_fonts[] = "family={$multilingual_font_family_final}:$font_variations";
}

// enqueue the google fonts stylesheet if any font families are set
if ( ! empty( $google_fonts ) ) {
$google_fonts_url = esc_url( 'https://fonts.googleapis.com/css2?' . implode( '&', $google_fonts ) . '&display=swap' );
wp_enqueue_style( 'google-fonts', $google_fonts_url, array(), null, 'all' );
}
}

add_action( 'wp_enqueue_scripts', 'hovercraft_google_fonts' );
add_action( 'wp_enqueue_scripts', 'hovercraft_enqueue_google_fonts' );

// Ref: ChatGPT
// Ref: https://wordpress.org/support/topic/new-google-fonts-url-incompatible-with-wp_enqueue_style/
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -16,5 +16,6 @@ No maintenance WordPress theme
- more messing around

### 0.0.x
- support for Git Updater
- requires PHP 7.0+
- supports Git Updater
- messing around
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Theme Name: HoverCraft
Theme URI: https://hovercraft.vip
Version: 0.2.395
Version: 0.2.407
Description: No maintenance WordPress theme
Author: LittleBizzy
Author URI: https://www.littlebizzy.com