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
- Theme seems to have different options on wordpress.com and own-server install
- Publish page by invoking submit via jQuery
- Does WP, php, or a current framework (woofoo / genesis, etc). Offer a way to schedule text / bg color changes?
- Get data from Theme Options and use them into meta options field in custom post type
- different theme in one website
- how would I change background color of a theme using a plugin?
- Jquery Theme Roller to WordPress
- Implementation of language_attributes function
- get_pages Not accepting my query
- Cannot update a file for my theme
- Date based CSS/theme
- Wp-Admin FTPS Connection Error unlike Filezilla
- Is there a (offical) way for a theme to deactivate itself and show a message in admin?
- How to get the theme directory URI?
- Blackberry mobile theme redirection
- Twenty Ten theme – how to put a different header banner on every page
- List of categories instead of dropdown menu selector in admin options
- one page wordpress theme
- Admin: Custom Query Returning Permissions Error
- Child theme breaks after update of master theme
- Insert the current theme header into an external HTML/XHTML file
- How to remove the tripadvisor logo from the wordpress theme?
- How to use one git (github) repository for version control for multiple themes
- WordPress doesn’t recognise created theme
- Is there a way to see how a theme will look before buying it?
- Custom fields in post later used in loop
- Menu items do not “open” when mouse hover over them?
- Can’t see themes for Multi-site wildcard subdomain
- How to create a theme that can be updated by people using the theme on their site
- Looking for a theme to show unread/updated posts since last visit or like that
- why is this script not working on my site
- Uncaught SyntaxError: Unexpected Token Illegal
- From where wp ecommerce is loading plugin theme files?
- Making first post wider than other posts on home page(default)
- Migrating a website using custom image tags to use featured images instead
- Editing Theme and Moving Servers
- is theme network enabled?
- Are the Theme frame works or Theme builders slow downs the performance? [closed]
- Do all themes accommodate all features?
- How to reduce Header at the top of the page
- Custom fields not displaying on front end
- Functions.php error – when trying to change the theme
- My blog suddenly can’t find my stylesheet?
- Twenty Eleven NOT valid
- Make a menu item unselectable
- Make the “Add New Post” one column for all users
- What happened to my Inactive Widgets?
- What’s the easiest way of adding more options in the Theme Options of the twenty eleven theme?
- Query for all themes?
- Fix warning: Missing argument
- My first WP development project – am I envisaging this right?
- my blog crashes ie7?
- WordPress | Theme error
- How can I fetch the next level of the currently selected main menu (hierarchical menu)?
- remove theme’s name from dashboard .. How?
- How can I show some standard html code across any theme I install?
- Fix threaded comments