Title: How to Return in WordPress Function php file?
Last modified: May 10, 2020

---

# How to Return in WordPress Function php file?

 *  Resolved [Chris](https://wordpress.org/support/users/dobeweb/)
 * (@dobeweb)
 * [6 years ago](https://wordpress.org/support/topic/how-to-return-in-wordpress-function-php-file/)
 * The code is:
 *     ```
       function my_custom_function( $html, $content ) {
   
       $html .=  get_post_field('post_content', $post_id);
   
       return $html;
       }
   
       $priority = 10;
   
       add_filter( 'tps_the_content_after', 'my_custom_function', $priority, 2 );
       ```
   
 * If my content is “this is my content”, then the code return “this is my content”
 * I want to add `<div>` before the content, but I don’t know how to write the code,
   it should return like this
 * `"<div class="post">this is my content</div>"`
    Thank you!

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

 *  [M Media](https://wordpress.org/support/users/mmediagroup/)
 * (@mmediagroup)
 * [6 years ago](https://wordpress.org/support/topic/how-to-return-in-wordpress-function-php-file/#post-12810432)
 * Hey [@dobeweb](https://wordpress.org/support/users/dobeweb/)!
 * Great question!
 * Have you tried just wrapping it around?
 *     ```
       $html .=  '<div class="post">';
       $html .=  get_post_field('post_content', $post_id);
       $html .=  '</div>';
       ```
   
 * Warm regards!
 *  Thread Starter [Chris](https://wordpress.org/support/users/dobeweb/)
 * (@dobeweb)
 * [6 years ago](https://wordpress.org/support/topic/how-to-return-in-wordpress-function-php-file/#post-12810469)
 * God! That’s it, thank you so much!

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

The topic ‘How to Return in WordPress Function php file?’ is closed to new replies.

## Tags

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

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [Chris](https://wordpress.org/support/users/dobeweb/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/how-to-return-in-wordpress-function-php-file/#post-12810469)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
