Title: What can this code do when inserted in functions.php?
Last modified: July 9, 2022

---

# What can this code do when inserted in functions.php?

 *  [mplusplus](https://wordpress.org/support/users/mplusplus/)
 * (@mplusplus)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/what-can-this-code-do-when-inserted-in-functions-php/)
 * Hi there
 * What can this code do when inserted in functions.php?
 *     ```
       function custom_rewrite_tag() {
         add_rewrite_tag('%location%', '([^&]+)');
       }
       add_action('init', 'custom_rewrite_tag', 10, 0);
       ```
   
 * Thanks.
    -  This topic was modified 3 years, 11 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/what-can-this-code-do-when-inserted-in-functions-php/#post-15810704)
 * WP has documentation on function `add_rewrite_tag` at [https://developer.wordpress.org/reference/functions/add_rewrite_tag/](https://developer.wordpress.org/reference/functions/add_rewrite_tag/)
 *  Thread Starter [mplusplus](https://wordpress.org/support/users/mplusplus/)
 * (@mplusplus)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/what-can-this-code-do-when-inserted-in-functions-php/#post-15810757)
 * Hi [@t-p](https://wordpress.org/support/users/t-p/)
 * Unfortunately, that article did not help me. I hope someone can provide a short
   more straightforward explanation of what that code actually does.
 * Thanks so much.

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

The topic ‘What can this code do when inserted in functions.php?’ is closed to new
replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [mplusplus](https://wordpress.org/support/users/mplusplus/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/what-can-this-code-do-when-inserted-in-functions-php/#post-15810757)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
