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

Standard Fonts in Typography field throw an error #1370

Closed
hellor0bot opened this issue Jun 9, 2017 · 12 comments
Closed

Standard Fonts in Typography field throw an error #1370

hellor0bot opened this issue Jun 9, 2017 · 12 comments

Comments

@hellor0bot
Copy link

hellor0bot commented Jun 9, 2017

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

@aristath
Copy link
Contributor

aristath commented Jun 9, 2017

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 👍

@hellor0bot
Copy link
Author

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',
			),
		),
) );

@vlthemes
Copy link

Same mistake

@aristath
Copy link
Contributor

Fixed.
Thanks for reporting this!

aristath added a commit that referenced this issue Jun 18, 2017
@hellor0bot
Copy link
Author

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

@hellor0bot
Copy link
Author

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

@aristath
Copy link
Contributor

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

@hellor0bot
Copy link
Author

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!

@hellor0bot
Copy link
Author

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.

@hellor0bot
Copy link
Author

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

@aristath aristath reopened this Jun 23, 2017
@aristath
Copy link
Contributor

Should be ok now.

@hellor0bot
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants