Title: Custom Attribute Code for SiteOrigin Row giving Error Message
Last modified: May 1, 2017

---

# Custom Attribute Code for SiteOrigin Row giving Error Message

 *  [katart17](https://wordpress.org/support/users/katart17/)
 * (@katart17)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/custom-attribute-code-for-siteorigin-row-giving-error-message/)
 * I’m using the following code to add a Select field to the Attributes Row:
 *     ```
       // Add Custom Class Options to SiteOrigin Rows
       add_filter( 'siteorigin_panels_row_style_fields', 'custom_row_style_fields' );
       function custom_row_style_fields($fields) {
       	$row_styles = array(
       		'default-row-style' => 'Choose Style',
       		'row-notification' => 'Notification'
       	);
   
       	$fields['row_styles'] = array(
       		'name' => __('Row Styles', 'siteorigin-panels'),
       		'type' => 'select',
       		'options' => $row_styles,
       		'group' => 'attributes',
       		'description' => __('Choose a style option for this row of content', 'siteorigin-panels'),
       		'priority' => 1,
       	);
   
       	return $fields;
       }
   
       function custom_row_style_attributes( $attributes, $args ) {
       	if( $args['row_styles'] != 'default-row-style' ) {
       		array_push($attributes['class'], $args['row_styles'] );
       	}
   
       	return $attributes;
       }
   
       add_filter('siteorigin_panels_row_style_attributes', 'custom_row_style_attributes', 10, 2);
       ```
   
 * This code is throwing the following error:
 *     ```
       [01-May-2017 13:29:39 UTC] PHP Notice:  Undefined index: row_styles in /xx/xx/xx/wp-content/themes/edmond/functions.php on line 223
       [01-May-2017 13:29:39 UTC] PHP Notice:  Undefined index: row_styles in /xx/xx/xx/wp-content/themes/edmond/functions.php on line 224
       ```
   
 * Line 223 is `if( $args['row_styles'] != 'default-row-style' ) {`
    Line 224 is`
   array_push($attributes['class'], $args['row_styles'] );`
 * Any ideas why?

The topic ‘Custom Attribute Code for SiteOrigin Row giving Error Message’ is closed
to new replies.

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

## Tags

 * [siteorigin](https://wordpress.org/support/topic-tag/siteorigin/)

 * 0 replies
 * 1 participant
 * Last reply from: [katart17](https://wordpress.org/support/users/katart17/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/custom-attribute-code-for-siteorigin-row-giving-error-message/)
 * Status: not resolved