You could add a REST endpoint to check if the current theme has an update. Here’s a quick example to get you started:
function wpd_register_themecheck_route(){
register_rest_route(
'themecheck/v1',
'/updates/',
array(
'methods' => 'GET',
'callback' => 'wpd_check_theme'
)
);
}
add_action( 'rest_api_init', 'wpd_register_themecheck_route' );
function wpd_check_theme(){
$current_theme = get_option( 'template' );
$theme_updates = get_option( '_site_transient_update_themes' );
$return = false;
if( array_key_exists( $current_theme, $theme_updates->response ) ){
$return = $theme_updates->response[$current_theme];
}
$response = new WP_REST_Response( $return );
return $response;
}
Related Posts:
- Making update notification functionality for my themes
- Best practices for monitoring the need for future updates on a theme that I developed?
- Custom theme/plugin update checks
- Automatic Updates For Private And Commercial Themes?
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- Pushing updates to your premium theme
- Theme showing incorrect update
- There’s an image named g.gif somewhere in my WordPress site
- Prevent update check for specific theme
- Prevent WordPress updates from overriding custom language translations?
- Responsive Images – Generating multiple images from Theme Customizer control upload?
- How can one update a theme on a live site without interruption?
- WordPress 5.8 update problem custom theme styles are overridden by core styles common.min.css
- If I build a custom theme, will it update?
- Show warning if plugin is missing
- Is it a bad practice to use switch_to_blog in the frontend?
- Execute upgrade-theme with coding
- How to change database values on theme update
- How can I ping update-core.php with a script?
- WordPress Media Uploader in page template (On Front-end)
- Custom theme updater – random string in new theme name
- AJAXIFY WordPress Theme Frontend menu
- How to Find the Page the Front Page is Using?
- Updating a live theme safely?
- How to have content scroll over background
- is_home and is_frontpage always true
- Wordpres core-update theme renames theme folder name
- How to allow users to create their own website within my domain? [closed]
- How to make updatable custom WordPress theme?
- Updatable theme developing
- Update modified Shopify third-party theme [closed]
- Any way to permanently translate themes?
- How to throw the “We need ftp info” at a user
- Remove nonindex meta tag
- How do I send out an update for my custom wordpress theme?
- Should I use set_transient or update_option?
- Custom Taxonomy Tree view
- Add a preview to a WordPress Control Panel
- wp_insert_post breaks rewrite rules
- Where can I find a good reviewed collection of Twenty Ten child themes?
- Template Hierarchy for get_header()
- How to add (css) classes to only one wp_nav_menu()?
- Advantages of using instead of wp_enqueue_style()?
- Style.css redirects to 404 Page not found
- How to add suggest plugin to theme?
- How Can I setup WP CLI on Windows development machine running AMPPS?
- Looking for the code in twentyten that allows users to select images for the header/banner
- Relative Time On Posts
- using wordpress without javascript
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- Set a static front-page as a landing page programmatically
- Comment entry screen shows even though “Allow Comments” is unchecked
- How can I display/hide certain content based on a Theme Option field?
- Custom WordPress Theme – Search not working on posts
- How can I make that when I clic on one of the menu items, that page shows only posts with the same category?
- Hide header texts (Title & Tagline) in custom-header.php
- Why an arugment is missing in wp_get_attachment_image_attributes?
- Archive page doesn’t work
- Where to hook settings api init
- How to add “Template” option in page attributes panel?
- How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?
- How can i attach the attachment-ID to the user profile image?
- Remove settings if theme is deleted?
- Do not display post images on front page
- Change WordPress header color using customizer
- Default Text not showing from customizer
- Images not showing after path specified in header.php
- How to show a manageable list of images on a post?
- Where does the uploaded image go?
- Remove link on full-size images
- How to reset post data properly
- Theme options save routine clashes with plugin save
- get_search_query() not working with search queries with ampersand in it
- If user is logged in and has a role echo statement
- Fixed button and slideshow in template upload per page
- Let user to add input fields on theme option page
- Non-standard (new) theme file
- Best Practice for Server Processing
- MapPress Easy Google Map in Jquery Tabs Problem
- Homepage slider not using correct images
- WordPress Show Single Post on Home Page with previous/ Next Button
- Is there any way to store single.php wordpress file into a php variable
- How to change listing type permlink?
- Fatal error: Class WP_Customize_Image_Control not found
- Show all menu levels except top level. How to exclude top level of a menu?
- WooCommerce – edit templates
- How to include all files within a folder & its sub folders to functions.php?
- How to dowload and edit content of a website
- Uncaught Reference error in Retina.js
- wordpress thumbnail onclick then modal will come out
- Replaceing _custom_background_cb
- Best strategy for providing theme options using customizer
- Theme Development for a Newbie
- How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?
- get_footer not working boilerplate theme
- Deleting all Options on theme switch
- Is there any open source WordPress Themes?
- DIV containing iframe disappears below break point of 992 in Oxygen Builder
- After a while attachment meta data is missing “sizes” data
- Template for posts of category in block theme?