UNPKG

claudeus-wp-mcp

Version:

The most comprehensive WordPress MCP server - 145 production-ready tools for complete WordPress management with AI

95 lines 2.6 kB
/** * WordPress Menus API Client * Handles menus, menu items, and menu locations */ import { BaseApiClient } from './base-client.js'; export class MenusApiClient extends BaseApiClient { // ========================================== // MENUS CRUD // ========================================== /** * Get a list of menus with pagination metadata */ async getMenus(filters) { return this.getPaginated('/menus', filters); } /** * Get a single menu by ID */ async getMenu(id) { return this.get(`/menus/${id}`); } /** * Create a new menu */ async createMenu(data) { return this.post('/menus', data); } /** * Update an existing menu */ async updateMenu(id, data) { return this.put(`/menus/${id}`, data); } /** * Delete a menu * @param id Menu ID * @param force Whether to bypass trash and force deletion */ async deleteMenu(id, force = false) { const queryString = force ? '?force=true' : ''; return this.delete(`/menus/${id}${queryString}`); } // ========================================== // MENU ITEMS CRUD // ========================================== /** * Get a list of menu items with pagination metadata */ async getMenuItems(filters) { return this.getPaginated('/menu-items', filters); } /** * Get a single menu item by ID */ async getMenuItem(id) { return this.get(`/menu-items/${id}`); } /** * Create a new menu item */ async createMenuItem(data) { return this.post('/menu-items', data); } /** * Update an existing menu item */ async updateMenuItem(id, data) { return this.put(`/menu-items/${id}`, data); } /** * Delete a menu item * @param id Menu item ID * @param force Whether to bypass trash and force deletion */ async deleteMenuItem(id, force = false) { const queryString = force ? '?force=true' : ''; return this.delete(`/menu-items/${id}${queryString}`); } // ========================================== // MENU LOCATIONS // ========================================== /** * Get all menu locations registered by the theme */ async getMenuLocations() { return this.get('/menu-locations'); } /** * Get a specific menu location by slug */ async getMenuLocation(location) { return this.get(`/menu-locations/${location}`); } } //# sourceMappingURL=menus.js.map