Title: Fixed PHP Warning
Last modified: January 19, 2017

---

# Fixed PHP Warning

 *  Resolved [itoben](https://wordpress.org/support/users/itoben/)
 * (@itoben)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fixed-php-warning/)
 * Hi,
 * I have this error reporting:
 * `PHP Warning: Cannot assign an empty string to a string offset`.
 * Call Stack :
 *     ```
       wp_localize_script()
          wp-content/plugins/toolbar-publish-button/toolbar-publish-button.php:307
       ```
   
 * In file `toolbar-publish-button.php`, I suggest to add this line (`function enqueue_admin_assets()`
   after line 300):
 * `$button_bg_color = !empty($button_bg_color) ? $button_bg_color : '#fff';`
 * And error it’s fixed.
 * Thanks for this plugin.
    -  This topic was modified 9 years, 4 months ago by [itoben](https://wordpress.org/support/users/itoben/).
    -  This topic was modified 9 years, 4 months ago by [itoben](https://wordpress.org/support/users/itoben/).
    -  This topic was modified 9 years, 4 months ago by [itoben](https://wordpress.org/support/users/itoben/).
      Reason: Updated message

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

 *  Plugin Author [webbistro](https://wordpress.org/support/users/webbistro/)
 * (@webbistro)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fixed-php-warning/#post-8673468)
 * Hi [@itoben](https://wordpress.org/support/users/itoben/),
 * Thank you! We will include this to the next update.
 * Best,
    -Nadia
 *  Thread Starter [itoben](https://wordpress.org/support/users/itoben/)
 * (@itoben)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fixed-php-warning/#post-8673742)
 * Great,
 * I just test this, it’s better to add:
 * `$button_bg_color = !empty($button_bg_color) ? $button_bg_color : '#23282d';`
 * Because it’s the WordPress background default color. 🙂
    -  This reply was modified 9 years, 4 months ago by [itoben](https://wordpress.org/support/users/itoben/).
      Reason: Add Resolved Topic
 *  Plugin Author [webbistro](https://wordpress.org/support/users/webbistro/)
 * (@webbistro)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/fixed-php-warning/#post-8737650)
 * Hi [@itoben](https://wordpress.org/support/users/itoben/),
 * It’s fixed, thank you for drawing my attention to the issue!
 * Best,
    -Nadia

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

The topic ‘Fixed PHP Warning’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/toolbar-publish-button_fefefe.svg)
 * [Toolbar Publish Button](https://wordpress.org/plugins/toolbar-publish-button/)
 * [Support Threads](https://wordpress.org/support/plugin/toolbar-publish-button/)
 * [Active Topics](https://wordpress.org/support/plugin/toolbar-publish-button/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/toolbar-publish-button/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/toolbar-publish-button/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [webbistro](https://wordpress.org/support/users/webbistro/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/fixed-php-warning/#post-8737650)
 * Status: resolved