You can write your own endpoint and use wp_get_themes
to get a list of themes via that. Here is a simple one:
add_action( 'rest_api_init', function () {
//Path to rest endpoint
register_rest_route( 'theme_API/v1', '/get_theme_list/', array(
'methods' => 'GET',
'callback' => 'theme_list_function'
) );
});
// Our function to get the themes
function theme_list_function(){
// Get a list of themes
$list = wp_get_themes();
// Return the value
return $list;
}
Now you can get a list of your themes by accessing http://example.com/wp-json/theme_API/v1/get_theme_list
.
I wouldn’t suggest activating/deactivating themes via API. It can totally mess up things, such as activated widgets.
Related Posts:
- Is There A Plugin to Create WP Multisite Installs programatically
- Get the name WordPress default theme in the core
- Rest API does not work after changing WordPress Theme
- Link to specific Customizer section
- How to refresh WordPress Customizer panel upon entering a value
- Any official way to create an admin theme?
- How do I create my own admin button and theme settings page?
- How can I add a set featured image function to a theme that doesn’t already have it built in?
- A minimalistic admin theme for a WP 3 install
- Exclude stylesheet from admin
- Activate a new WordPress Theme Only for Admins
- How can I show more than 15 themes at a time in the admin menu?
- Making menu link open in new tab?
- How do you get thumbnails to show up in the admin edit post?
- Theme Development Admin Area [closed]
- Disable Theme API / Front end (for API only environment)
- Creating a theme options page
- Posts and Pages not showing on admin, but showing in theme
- How to display message (with switch_theme hook) after deactivating My theme?
- How can we hide the parent’s theme url at the child themes details on a multisite?
- How to switch theme if the current user is admin?
- Functions containing parameter ‘yourtheme’
- Passing dynamic options from backend to frontend
- Problems to disable the comments for my statics pages
- How to reset a custom theme
- Theme javascript/css 404
- WordPress activate theme error $pagenow
- How to include stylesheet in custom admin using parent_slug
- Multiple sub directories for theme template pages
- I made new theme directory, why won’t it show up in admin GUI?
- Using DePo Masthead with WP 3+
- Is there any way to modify images from a theme using the web interface?
- Why does an ad page open when I browse my websites’s wp-admin page?
- Theme seems to be preventing me from adding a new page to my site
- share wrordpress data between two shared hosts using REST API
- Does anyone know where to find the area to edit this text
- How to change WordPress theme outside of admin? Can’t access dashboard
- Default and warning messages & no login
- WP Customize API Checkbox change value
- WordPress theme is not displayed properly on other computers
- Does WordPress provide themes_api function?
- modify buddpress adminbar only in admin pages
- Page structure using The Customizer Api
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Override parent theme translation on child theme
- How to incorporate admin theme in my back-end-plugin
- Using chunk theme from wordpress.com on my own host
- What is the first file wordpress looks at in a theme?
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Duplicate and change a Theme Widget
- Theme not showing after uploading
- I want to run different WordPress websites under the same database
- get_template_directory_uri does not seem to work when defining WP_CONTENT_DIR
- A hook that runs only when the theme is previewed
- WordPress theme with multiple color schemes
- How can I have case-sensitive theme directory names when installed with Composer?
- When can changing a theme damage a website?
- Load a different theme for IE less than 9
- Theme Check reporting an incorrect theme slug and text domain
- WordPress themes that are browser tested and maintained?
- Remove transparancy in Sydney theme’s headerimage
- stylesheet is not readable error after installation
- Customizing page content layout
- Putting two themes together to create a complete site
- How does WP generate html?
- How to dynamically change theme’s slogan from admin?
- Using WordPress Multisite to manage multiple projects?
- What’s a good way to unenqueue all scripts for a single template page?
- Icons not showing [closed]
- Building a REST API for your web app exposes primary keys of DB records?
- WP HTML Templates – Any way to get bloginfo() or the path to the theme folder?
- How to change the date and time in REST API for comments?
- Changing URL of scripts, scripts outside theme folder?
- How to use only scripts from new theme?
- Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?
- WordPress Theme Breaking on Migration to Live Site [closed]
- Looking for a theme to show unread/updated posts since last visit or like that
- WordPress Admin extremely slow when other admin logged in
- Edit post & page option does not display on latest wordpress
- How do I use the default style for widget?
- WordPress fails to embed video URL on specific theme
- Hook into the Admin Dashboard and redirect users
- Unable to set social icons using Advance Portfolio Theme
- How to add extra custom social icons to page with same style?
- how make wp include urls as https?
- how to costume title single page
- Can I get programmatic access to wp-admin?
- Where can I find a theme that has a big banner
- Featured images are cropped on index and post page
- Change theme’s thumbnail to cropped WP featured image
- Stylesheet not being loaded? [closed]
- is it possible to create a website with wordpress with these requirements without coading?
- Where can I decide the number of posts to display on the blog index page?
- I need to disable responsive feature of a theme called Meet GavernWP [closed]
- how to add dynamic footer credit in Greatmag theme [closed]
- Twenty Fifteen Premium Theme [closed]
- Absolute and relative paths
- Am having issues intergrating this api into my wordpress site, any help please?
- Is it possible to create post in wordpress using postman?
- Help!!! Old theme doesn’t load scripts and conflitcs with plugins