Title: Undefined array key css_target
Last modified: August 13, 2024

---

# Undefined array key css_target

 *  Resolved [peter8nss](https://wordpress.org/support/users/peter8nss/)
 * (@peter8nss)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/)
 * Following upgrade to version 2.5.8 I am getting the following PHP warning:
 *     ```wp-block-code
       Undefined array key "css_target" in /home/sites/1a/4/44afcb079c/staging_html/wp-content/plugins/svg-support/admin/admin-init.php on line 54
       ```
   

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

 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17950454)
 * Thanks for letting me know. That is odd, I didn’t get this warning, I was flicking
   between all major versions of php and didn’t catch it.
 * what version of php are you using?
    -  This reply was modified 1 year, 9 months ago by [Benbodhi](https://wordpress.org/support/users/benbodhi/).
      Reason: spelling mistake
 *  [s3v3rin](https://wordpress.org/support/users/s3v3rin/)
 * (@s3v3rin)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17950489)
 * same here, php 8.2.17 
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17950545)
 * thanks for sharing the php version 🙏
 *  Thread Starter [peter8nss](https://wordpress.org/support/users/peter8nss/)
 * (@peter8nss)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17950620)
 * I don’t think it is to do with the PHP version. And I can’t seem to cause it 
   again.
 * Is “css_target” a recently added setting stored in (array) option “bodhi_svgs_settings”.
   If so, I suspect the first time you read it you get the PHP warning, but the 
   following code then adds it so that you don’t see the warning again.
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17950666)
 * it was an existing setting, but I did a lot of refactoring. 
   so you see the warning
   when first loading the plugin, but then it disappears because of the order of
   the settings being added?
 * thanks for this info, helpful for me to be able to track it down.
 *  [alissit](https://wordpress.org/support/users/alissit/)
 * (@alissit)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17950740)
 * Just more info – I’ve had the plugin enabled for at least a month, and today 
   was the first time I have the error in my error_log. So it doesn’t occur on activation:
 * PHP Warning: Undefined array key “css_target”
 *  [strarsis](https://wordpress.org/support/users/strarsis/)
 * (@strarsis)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17960400)
 * I have just encountered the same PHP warning after updating the plugin from `
   2.5.6` to `2.5.8`.
 *  [gsc89](https://wordpress.org/support/users/gsc89/)
 * (@gsc89)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17969244)
 * Same issue locked it to 2.5.7 on sites we used it on till this is resolved.
 *  [cataras](https://wordpress.org/support/users/cataras/)
 * (@cataras)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17975890)
 * Same problem with version 2.5.8 under PHP 8.3. It works when you switch back 
   to version 2.5.7.
    -  This reply was modified 1 year, 9 months ago by [cataras](https://wordpress.org/support/users/cataras/).
 *  [Carlos Faria](https://wordpress.org/support/users/frendeliko/)
 * (@frendeliko)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-17990197)
 * Same error here 2.5.8 under PHP 8.2.22
 *  [bekahmcdonald](https://wordpress.org/support/users/bekahmcdonald/)
 * (@bekahmcdonald)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-18008339)
 * Same issue here with version 2.5.8 on PHP 8.3.9
   `Undefined array key "css_target"`
   in `/plugins/svg-support/admin/**admin-init.php** (line 54)`
 *  [striffly](https://wordpress.org/support/users/striffly/)
 * (@striffly)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-18058948)
 * Same issue with PHP 8.2 & SVG Support 2.5.8
   Disable then enable the plugin resolve
   the issue (with wp-cli, or by deleting the plugin)
    -  This reply was modified 1 year, 7 months ago by [striffly](https://wordpress.org/support/users/striffly/).
 *  [twobyte](https://wordpress.org/support/users/twobyte/)
 * (@twobyte)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-18090447)
 * Also had this issue with 2.5.8
 * Downgrading wpackagist-plugin/svg-support (2.5.8 => 2.5.7)
 *  [Bruno](https://wordpress.org/support/users/andrea_brunato/)
 * (@andrea_brunato)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-18158844)
 * [@benbodhi](https://wordpress.org/support/users/benbodhi/) got same error on 
   PHP 7.4.
   The error is caused by line 54 in admin-init.php because of the undefined
   target css_target $value[‘css_target’] = esc_attr( sanitize_text_field( $value[‘
   css_target’] ) );You just need to check if the value exist before calling it.
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-18175680)
 * apologies for the delay on this!
   I have added the fix in the upcoming version
   2.5.9 which will be pushed to the WP repo soon.It’s still in development as I
   address a backlog of things here. Latest dev version is at [https://github.com/benbodhi/svg-support](https://github.com/benbodhi/svg-support)
   if you want to test it early.

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

The topic ‘Undefined array key css_target’ is closed to new replies.

 * ![](https://ps.w.org/svg-support/assets/icon.svg?rev=1417738)
 * [SVG Support](https://wordpress.org/plugins/svg-support/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/svg-support/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/svg-support/)
 * [Active Topics](https://wordpress.org/support/plugin/svg-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/svg-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/svg-support/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [update](https://wordpress.org/support/topic-tag/update/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 15 replies
 * 12 participants
 * Last reply from: [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/undefined-array-key-css_target/#post-18175680)
 * Status: resolved