PHP Error when assigning font

Home Forums Use Any Fonts PHP Error when assigning font

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #461116
    Ian
    Guest

    Trying to use Toledo Serial Heavy Font from the font catalogue, get fatal error when trying to assign the font.
    Error details are:-
    WordPress version 6.0.2
    Active theme: GeneratePress (version 3.1.3) Current plugin: Use Any Font (version 6.2.96) PHP version 8.0.24

    An error of type E_ERROR was caused in line 285 of the file /home/revinyl/public_html/wp-content/plugins/use-any-font/includes/functions/uaf_font_functions.php. Error message: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /home/revinyl/public_html/wp-content/plugins/use-any-font/includes/functions/uaf_font_functions.php:285
    Stack trace:
    #0 /home/revinyl/public_html/wp-content/plugins/use-any-font/includes/functions/uaf_font_functions.php(285): array_map(‘sanitize_text_f…’, NULL)
    #1 /home/revinyl/public_html/wp-content/plugins/use-any-font/includes/functions/uaf_admin_functions.php(279): uaf_save_font_assign()
    #2 /home/revinyl/public_html/wp-content/plugins/use-any-font/includes/functions/uaf_admin_functions.php(131): uaf_trigger_actions()
    #3 /home/revinyl/public_html/wp-includes/class-wp-hook.php(307): uaf_plugin_initialize(”)
    #4 /home/revinyl/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #5 /home/revinyl/public_html/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #6 /home/revinyl/public_html/wp-settings.php(598): do_action(‘init’)
    #7 /home/revinyl/public_html/wp-config.php(97): require_once(‘/home/revinyl/p…’)
    #8 /home/revinyl/public_html/wp-load.php(50): require_once(‘/home/revinyl/p…’)
    #9 /home/revinyl/public_html/wp-admin/admin.php(34): require_once(‘/home/revinyl/p…’)
    #10 {main}
    thrown

    Hope you can help.
    Regards
    Ian

    #461181
    Dinesh
    Keymaster

    Hi,

    Can you please select one of the predefined elements and see if that helps ?

    Thanks

    #461188
    Ian
    Guest

    Hi Dinesh,

    Yes, in fact the Toledo Serial Heavy font is one of the predefined elements so I don’t think that’s the issue.
    I have tried it in a local test environment under PHP 7.4, and although this still generates a PHP error it’s not classed as a fatal error and the font does then get assigned and works ok. The live server environment is PHP 8 though, so that doesn’t help with the live site.

    Regards
    Ian

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘PHP Error when assigning font’ is closed to new replies.