Kirki: Standard Fonts in Typography field throw an error

Created on 9 Jun 2017  路  12Comments  路  Source: kirki-framework/kirki

Issue description:

When using Standard Fonts and the output parameter, we're getting the error:

Notice: Array to string conversion in /kirki/modules/css/field/class-kirki-output-field-typography.php on line 65

Generated CSS:

font-family: Array;

Version used:

develop branch

bug typography

All 12 comments

Can you post the code you're using?
I'll deal with all typography issues this weekend so having some code to test against would make things easier 馃憤

Sure!

But there's really nothing special:

Kirki::add_field( 'theme_name_theme_mod', array(
    'type'        => 'typography',
    'settings'    => 'typography_headings',
    'label'       => esc_html__( 'Heading', 'text-domain' ),
    'section'     => 'typography_headings',
    'default'     => array(
        'font-family'    => 'Montserrat',
        'variant'        => '600',
        'subsets'        => array( 'latin-ext' ),
        ),
    'priority'    => 10,
    'output'      => array(
        array(
            'element' => 'h1, h2, h3, h4, h5, h6',
            ),
        ),
) );

Same mistake

Fixed.
Thanks for reporting this!

I've just tested it, and seems there's an issue with switching font-weight for standard fonts. The weight doesn't get changed :(

For reproducing the issue, try changing between weights in Serif, then switch to Sans-Serif and change font-weights.

@hellor0bot I just tested it and can't replicate the issue you're describing

I've just added transport: auto to all typography fields and removed line breaks in the element parameter and it's working fine now.

By the way, transport: auto on typography fields is so awesome. Great job!

Nope, the issue is still there and I can't debug it :(

All fonts appear in the Customizer correctly with transport set to auto, however after saving a former (or incorrect) variant is displayed on the front-end.

The issue is related to all fonts, not standard ones, as I'd thought before.

Should be ok now.

Just checked it. All is good. Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MapSteps picture MapSteps  路  6Comments

Radzio1615 picture Radzio1615  路  4Comments

ravishakya picture ravishakya  路  7Comments

stylethemes picture stylethemes  路  6Comments

Vishal-Deshpande picture Vishal-Deshpande  路  3Comments