Title: PHP Warning
Last modified: March 23, 2022

---

# PHP Warning

 *  [eliant](https://wordpress.org/support/users/eliant/)
 * (@eliant)
 * [4 years ago](https://wordpress.org/support/topic/php-warning-349/)
 * File list-posts-alphabetically.php is incorrectly handling a variable, and it’s
   throwing a PHP Warning and creating very large error logs. Three errors on each
   pass:
 *     ```
       Illegal string offset 'category' in /home/AccountName/public_html/wp-content/plugins/list-posts-alphabetically/list-posts-alphabetically.php on line 19
       Cannot assign an empty string to a string offset in /home/AccountName/public_html/wp-content/plugins/list-posts-alphabetically/list-posts-alphabetically.php on line 19
       Illegal string offset 'category' in /home/AccountName/public_html/wp-content/plugins/list-posts-alphabetically/list-posts-alphabetically.php on line 24
       ```
   
 * Here is the code causing the warning:
 *     ```
       function lpa_az_func( $lpa_az_atts ) {
       	var_dump($lpa_az_atts);
       	die("<BR><BR>X".$lpa_az_atts."Y");
           $lpa_az_a = shortcode_atts( array(
               'category' => '',
           ), $lpa_az_atts );
   
       if (!isset($lpa_az_atts['category'])) {
       	$lpa_az_atts['category'] = '';
       }
   
       $lpa_az_args = array(
         'numberposts' => 1000,
         'category_name'  => $lpa_az_atts['category'],
         'orderby' => 'title',
         'order' => 'ASC'
       );
       ```
   
 * The problem is that $lpa_az_atts is being treated as an array, but it is merely
   a string variable.
 * Any chance this will be fixed in an upcoming update?

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

 * ![](https://ps.w.org/list-posts-alphabetically/assets/icon-256x256.png?rev=1725859)
 * [List Posts Alphabetically](https://wordpress.org/plugins/list-posts-alphabetically/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/list-posts-alphabetically/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/list-posts-alphabetically/)
 * [Active Topics](https://wordpress.org/support/plugin/list-posts-alphabetically/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/list-posts-alphabetically/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/list-posts-alphabetically/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [eliant](https://wordpress.org/support/users/eliant/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/php-warning-349/)
 * Status: not resolved