-
AuthorPosts
-
May 15, 2023 at 5:34 pm #1407459
I am getting multiple PHP warnings in my error logs:
PHP Warning: Undefined array key "key" in /home/gyghgfduser/public_html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/class-svg-shapes.php on line 515
I have this in my functions.php which may or may not be related:
function custom_avf_custom_svg_shapes( array $custom_shapes ) { // example for uploading a svg file: your_file.svg $custom_shapes = array ( 'grad-triangle' => array( 'title' => __('Gradient triangle', 'avia_framework' ), // Name displayed in select box - whatever you like 'has_negative' => false, // uploaded file had to be named: your_file-negative.svg 'has_flip' => true, 'has_width' => true, //'path' => string, // if you like to determine a different path (absolute) 'filename' => 'grad-triangle' // .svg will be added if missing //'attachment' => integer, // attachment id of uploaded media ( if you like to determine ) //'attachment_negative' => integer // attachment id of negative uploaded media ( if you like to determine ) ), 'hp-banner-divider' => array( 'title' => __('Homepage divider', 'avia_framework' ), // Name displayed in select box - whatever you like 'has_negative' => false, // uploaded file had to be named: your_file-negative.svg 'has_flip' => false, 'has_width' => false, //'path' => string, // if you like to determine a different path (absolute) 'filename' => 'hp-banner-divider' // .svg will be added if missing //'attachment' => integer, // attachment id of uploaded media ( if you like to determine ) //'attachment_negative' => integer // attachment id of negative uploaded media ( if you like to determine ) ), 'hp-banner-divider-no-wedge' => array( 'title' => __('Homepage divider (no wedge)', 'avia_framework' ), // Name displayed in select box - whatever you like 'has_negative' => false, // uploaded file had to be named: your_file-negative.svg 'has_flip' => false, 'has_width' => false, //'path' => string, // if you like to determine a different path (absolute) 'filename' => 'hp-banner-divider-no-wedge' // .svg will be added if missing //'attachment' => integer, // attachment id of uploaded media ( if you like to determine ) //'attachment_negative' => integer // attachment id of negative uploaded media ( if you like to determine ) ), ); return $custom_shapes; } add_filter( 'avf_custom_svg_shapes', 'custom_avf_custom_svg_shapes', 10, 1 );
Are the PHP Warnings likely to be because of something I have done or a missing key check in Enfold?
Thanks
May 15, 2023 at 7:16 pm #1407474Hey Rustybucket,
Please send us a temporary WordPress admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.
Best regards,
RikardMay 16, 2023 at 10:45 am #1407534Details in private
May 16, 2023 at 11:08 am #1407542Hi,
You have to add ‘key’ to your array, e.g.
'hp-banner-divider-no-wedge' => array( 'key' => 'hp-banner-divider-no-wedge', ......
Sorry, I missed to add this to the the comment. Will fix this for next release.
Compare config-templatebuilder\avia-template-builder\php\class-svg-shapes.php function init_native_shapes()Best regards,
GünterMay 16, 2023 at 11:11 am #1407546Thanks Günter, much appreciated.
May 16, 2023 at 3:37 pm #1407630 -
AuthorPosts
- You must be logged in to reply to this topic.