Title: MagpieRSS::append
Published: April 25, 2014
Last modified: May 20, 2026

---

# MagpieRSS::append( $el,  $text )

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/magpierss/append/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/magpierss/append/?output_format=md#related)

[ Back to top](https://developer.wordpress.org/reference/classes/magpierss/append/?output_format=md#wp--skip-link--target)

## 󠀁[Source](https://developer.wordpress.org/reference/classes/magpierss/append/?output_format=md#source)󠁿

    ```php
    function append($el, $text) {
    	if (!$el) {
    		return;
    	}
    	if ( $this->current_namespace )
    	{
    		if ( $this->initem ) {
    			$this->concat(
    				$this->current_item[ $this->current_namespace ][ $el ], $text);
    		}
    		elseif ($this->inchannel) {
    			$this->concat(
    				$this->channel[ $this->current_namespace][ $el ], $text );
    		}
    		elseif ($this->intextinput) {
    			$this->concat(
    				$this->textinput[ $this->current_namespace][ $el ], $text );
    		}
    		elseif ($this->inimage) {
    			$this->concat(
    				$this->image[ $this->current_namespace ][ $el ], $text );
    		}
    	}
    	else {
    		if ( $this->initem ) {
    			$this->concat(
    				$this->current_item[ $el ], $text);
    		}
    		elseif ($this->intextinput) {
    			$this->concat(
    				$this->textinput[ $el ], $text );
    		}
    		elseif ($this->inimage) {
    			$this->concat(
    				$this->image[ $el ], $text );
    		}
    		elseif ($this->inchannel) {
    			$this->concat(
    				$this->channel[ $el ], $text );
    		}

    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rss.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rss.php#L297)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rss.php#L297-L339)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/magpierss/append/?output_format=md#related)󠁿

| Uses | Description | 
| [MagpieRSS::concat()](https://developer.wordpress.org/reference/classes/magpierss/concat/)`wp-includes/rss.php` |  |

| Used by | Description | 
| [MagpieRSS::feed_start_element()](https://developer.wordpress.org/reference/classes/magpierss/feed_start_element/)`wp-includes/rss.php` |  | 
| [MagpieRSS::feed_cdata()](https://developer.wordpress.org/reference/classes/magpierss/feed_cdata/)`wp-includes/rss.php` |  |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fmagpierss%2Fappend%2F)
before being able to contribute a note or feedback.