• Resolved yamahapower

    (@yamahapower)


    Hi, i updated my wordpress site and now i have a problem. Please help me for fixing this. Thanks.

    // Font Rule
                        $font = json_decode( $mod );
                        if ( isset( $font->family->name ) && '' != $font->family->name ) {
                            if ( isset( $font->family->fonttype ) && 'google' == $font->family->fonttype ) {
                                $user_subsets = themify_check( 'setting-webfonts_subsets' ) ? themify_get( 'setting-webfonts_subsets' ) : array('latin');
                                $font_hash = $font->family->name . $font->family->variant . implode(',', $user_subsets); /*This line is 647*/
                                wp_enqueue_style( 'custom-google-fonts-' . md5($font_hash), themify_https_esc( 'https://fonts.googleapis.com/css' ) . '?family=' . str_replace( ' ', '+', $font->family->name ) . ':' . $font->family->variant . '&subset=' . implode(',', $user_subsets) ); /*This line is 648*/
                            }
                            $out .= sprintf("\n\tfont-family:%s;", $prefix . $font->family->name . $suffix );
                        }
Viewing 10 replies - 1 through 10 (of 10 total)
  • i just saw u posted this in stackoverflow, do you have any url of the site?

    Thread Starter yamahapower

    (@yamahapower)

    https://www.cemsahin.net my friend’s web site. Why do you need the url? Thanks.

    My guess is that line 646 and: themify_get( ‘setting-webfonts_subsets’ ) returns something other than an array (which is required by implode()) e.g: a string, int/float, boolean, function, object etc.etc. So on the line between 646 and 647 add: var_dump($user_subsets); to see what type and content $user_subsets is

    Thread Starter yamahapower

    (@yamahapower)

    So, is this right? If yes, i’m going to edit. Thanks.

    // Font Rule
                        $font = json_decode( $mod );
                        if ( isset( $font->family->name ) && '' != $font->family->name ) {
                            if ( isset( $font->family->fonttype ) && 'google' == $font->family->fonttype ) {
                                $user_subsets = themify_check( 'setting-webfonts_subsets' ) ? themify_get( 'setting-webfonts_subsets' ) : array('latin');
    var_dump($user_subsets);
                                $font_hash = $font->family->name . $font->family->variant . implode(',', $user_subsets); /*This line is 647*/
                                wp_enqueue_style( 'custom-google-fonts-' . md5($font_hash), themify_https_esc( 'https://fonts.googleapis.com/css' ) . '?family=' . str_replace( ' ', '+', $font->family->name ) . ':' . $font->family->variant . '&subset=' . implode(',', $user_subsets) ); /*This line is 648*/
                            }
                            $out .= sprintf("\n\tfont-family:%s;", $prefix . $font->family->name . $suffix );
                        }

    Yes thats right.

    Thread Starter yamahapower

    (@yamahapower)

    I added the line. Could you check the site for new errors, please?

    Warning: implode(): Invalid arguments passed in /home/cemsahin.net/httpdocs/wp-content/themes/themify-music/themify/customizer/class-themify-customizer.php on line 649
    string(64) “latin,cyrillic-ext,latin-ext,greek-ext,greek,vietnamese,cyrillic”

    What can i do now?

    Ok now were getting somewhere. Remove the var_dump($user_subsets); that you added earlier and in its place put the following three lines in its place (above line 647):

    if (is_string($user_subsets)) {
        $user_subsets = explode(',', $user_subsets);
    }

    Thread Starter yamahapower

    (@yamahapower)

    Yes it’s done! Thank you very much. ??

    Dont forget to set the status of this issue to resolved.

    Thread Starter yamahapower

    (@yamahapower)

    Ok, i am a newbie, Thanks for inform.

    Thank you so much again.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Warning: implode(): Invalid arguments passed in example.php on lines 647 & 648’ is closed to new replies.