• Resolved Oliver Campion

    (@domainsupport)


    Hey guys,

    Your plugin is causing a PHP Notice …

    [20-May-2020 21:24:17 UTC] PHP Notice: Array to string conversion in /wp-includes/formatting.php on line 1117

    … when the Customizer is loaded. PHP Version: 7.3.11.

    The array that is being sent instead of a string is …

    [20-May-2020 21:24:17 UTC] Array
    (
        [0] => 100
        [1] => 200
        [2] => 300
        [3] => 400
        [4] => 500
        [5] => 600
        [6] => 700
        [7] => 800
        [8] => 900
        [9] => 100i
        [10] => 200i
        [11] => 300i
        [12] => 400i
        [13] => 500i
        [14] => 600i
        [15] => 700i
        [16] => 800i
        [17] => 900i
    )

    Hope this makes sense to you.

    Oliver

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author DannyCooper

    (@dannycooper)

    Hi @domainsupport,

    Are you using the latest version (2.0.4)?

    Thread Starter Oliver Campion

    (@domainsupport)

    Yes.

    Your issue is on line 182 of settings.php …

    		$wp_customize->add_setting(
    			$font_id . '_weights',
    			array(
    				'default'   => array( '100', '200', '300', '400', '500', '600', '700', '800', '900', '100i', '200i', '300i', '400i', '500i', '600i', '700i', '800i', '900i' ),
    				'transport' => 'refresh',
    			)
    		);

    … the default value of a customizer setting should be a string, not an array.

    Hope that helps.

    Oliver

    Plugin Author DannyCooper

    (@dannycooper)

    Hi @domainsupport,

    I believe this is fixed in the latest version. But please let me know if your problem persists.

    Thanks

    Thread Starter Oliver Campion

    (@domainsupport)

    Looks fixed to us.

    Thanks.

    Oliver

    Plugin Author DannyCooper

    (@dannycooper)

    That’s great to hear. And thank you for the kind review, Oliver!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Notice in Customizer’ is closed to new replies.