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

Kirki_Fonts::is_google_font, function parameter is array, string should be #986

Closed
tcgunel opened this issue May 23, 2016 · 1 comment
Closed

Comments

@tcgunel
Copy link

tcgunel commented May 23, 2016

Issue description:

I'm using typography option, and receiving

Warning: array_key_exists(): The first argument should be either a string or an integer in /Applications/AMPPS/www/wp/wp-content/plugins/kirki/includes/class-kirki-fonts.php on line 229
Warning: strpos() expects parameter 1 to be string, array given in /Applications/AMPPS/www/wp/wp-content/plugins/kirki/includes/output/property/class-kirki-output-property-font-family.php on line 49

Version used:

Used both development and production 2.3.2

Using theme_mods or options?

theme_mod

Code to reproduce the issue (config + field(s))

Kirki::add_section( 'sweipe_typography_section', array(
'title' => esc_html__( 'Typography', 'sweipe' ),
'priority' => 160,
'capability' => 'edit_theme_options',
) );

Kirki::add_config( 'sweipe_typography', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
'option_name' => 'sweipe_typography',
) );

Kirki::add_field( 'sweipe_typography', array(
'type' => 'typography',
'settings' => 'sweipe_base_font',
'label' => esc_html__( 'Body Fonts', 'sweipe' ),
'section' => 'sweipe_typography_section',
'default' => array(
'font-family' => 'Roboto',
'variant' => 'regular',
'font-size' => '14px',
'line-height' => '2.1',
'letter-spacing' => '0',
'subsets' => array( 'latin' ),
'color' => '#666666',
'text-transform' => 'none',
'text-align' => 'left'
),
'priority' => 20,
'output' => array(
array(
'element' => 'body',
'property' => 'font-family',
),
),
'transport' => 'postMessage',
'js_vars' => array(
array(
'element' => 'body',
'function' => 'css',
'property' => 'font-family',
),
)
) );

Kirki::add_field( 'sweipe_typography', array(
'type' => 'typography',
'settings' => 'sweipe_headings_font',
'label' => esc_html__( 'Heading Fonts', 'sweipe' ),
'section' => 'sweipe_typography_section',
'default' => array(
'font-family' => 'Roboto',
'variant' => '500',
'line-height' => '1.4',
'subsets' => array( 'latin' ),
'color' => '#212121'
),
'priority' => 20,
'output' => array(
array(
'element' => 'h1,h2,h3,h4,h5,h6,h7',
'property' => 'font-family',
),
),
'transport' => 'postMessage',
'js_vars' => array(
array(
'element' => 'h1,h2,h3,h4,h5,h6,h7',
'function' => 'css',
'property' => 'font-family',
),
)
) );

@tcgunel
Copy link
Author

tcgunel commented May 23, 2016

duplicate of #975

@tcgunel tcgunel closed this as completed May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant