Title: API to set theme menu
Last modified: August 21, 2016

---

# API to set theme menu

 *  [rhj4](https://wordpress.org/support/users/rhj4/)
 * (@rhj4)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/)
 * I have created a WordPress menu:
 * `$menu_id = wp_create_nav_menu('MyMenu');`
 * and added menu items to it successfully. They show up in Appearance–>Menus properly.
 * At the bottom of the menu list is “Menu Settings” with two check boxes. The first
   is “Automatically add…” and the second, “Primary Menu (currently set to:)”.
 * I need the code to do what happens when the box is checked and I save the menu.
 * I am using Thesis-185 as the theme.

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/#post-4868095)
 * I’m sorry but as you appear to be using a commercial theme, you need to seek 
   support from the theme’s developer/vendor. We do not support [commercial products](http://codex.wordpress.org/Forum_Welcome#Commercial_Products)
   here.
 *  Thread Starter [rhj4](https://wordpress.org/support/users/rhj4/)
 * (@rhj4)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/#post-4868292)
 * Thank you esmi, but I think you skipped past my question, The Appearance–>Menu
   is a core WordPress function. What I am asking is what is the API Under that 
   UI. What gets called when the user checks the box associated with the menu name
   and then presses save?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/#post-4868294)
 * It’s part of the Theme API.
 *  Thread Starter [rhj4](https://wordpress.org/support/users/rhj4/)
 * (@rhj4)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/#post-4868335)
 * esmi – it is NOT part of the Thesis API. It is entirely within WordPress. I have
   checked this with diythemes and I have followed the code. There is a convoluted
   process that the WordPress code goes through to create a new copy of the post
   each post. I think the problem may have something to do with the edit_lock functionality.
 * If there is a write-up somewhere that describes how to create a page and insert
   it into the menu properly, that would be wonderful.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/#post-4868336)
 * > It’s part of the **Theme** API.
 *  Thread Starter [rhj4](https://wordpress.org/support/users/rhj4/)
 * (@rhj4)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/#post-4868337)
 * OK, sorry. I misunderstood you; however, the only Theme API’s I can find are 
   Theme Customization and Theme Modification and neither says anything about modifying
   the menu.
 * Perhaps you could take yourself out of ‘terse’ mode and give me an answer that
   actually tells me something.

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

The topic ‘API to set theme menu’ is closed to new replies.

 * 6 replies
 * 2 participants
 * Last reply from: [rhj4](https://wordpress.org/support/users/rhj4/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/api-to-set-theme-menu/#post-4868337)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
