You are asking two questions. The one being how can you test an update and the other being how can you run code after an update.
You can test a theme update by pushing the updates out your self and testing it if it works. You can do that by using GitHub Updater.
If you want to run code only after a upgrade there is no core solution. There are two ways it could work.
- You save the theme version to the database as with this you can calculate what version or update it is and then run the update code.
- If you are including new options in the update you could check if the new options exist yet and if not then run the update code.
I think the after_setup_theme
should be fine.
Related Posts:
- Upgrade from 5.0.4 to 5.1.1 causes $theme to be null
- Installing WordPress Theme Unit Data
- Fatal error: Maximum execution time of 60 seconds exceeded in H:\wamp\www\custom\wp-includes\class-wp-http-curl.php
- Upgrading a custom theme through the Dashboard
- Theme unit test data Foreign fonts come in garbled on my machine
- How exactly *does* unit testing work for themes?
- WP 3.1 upgrade breaks AutoFocus+ theme
- Execute upgrade-theme with coding
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- Custom theme updater – random string in new theme name
- Using My Own Classes On Wp Unit Tests
- Fastest way to update a theme
- Updatable theme developing
- Do core themes normally allow automatic upgrades?
- How to create .pot files with POedit?
- What is the difference between wp_register_sidebar_widget and register_widget?
- How to enqueue script if widget is displayed on page?
- Custom Image section in Customizer
- Form Submitting Error with get_template_part()
- Get 10 posts from a WP_Query. If less than 10, get the remainder from elsewhere
- get_stylesheet_directory() returns wrong URI… localhost/using vhosts
- How Do I Programmatically Force Custom Permalinks with My Theme?
- wp_get_attachment_image_attributes not working for me
- How to edit an existing WordPress theme? [closed]
- Where is default wp_head() implemented?
- How do I hide tags that have only been used once?
- Questions about WordPress.org theme review
- Excluding categories from “Manage Categories” using a get_terms filter
- Translated strings not appearing – what am I missing?
- Feature Survey – What would you want in a resume theme?
- Can I upload WordPress-react theme in Wp theme repository
- How should I store global information such as a phone number so that it is editable through the CMS?
- What are the Theme tags in style.css used for?
- WordPress nav_menu_css_class theme filter is not being called
- How do I locally enqeue the mediaelement.js file into a wordpress theme
- Cannot get full thumbnail size using the_post_thumbnail
- Is it safe to enqueue a font style without putting http or https?
- Is there a way to activate different theme for specified users? [closed]
- current_user_can Not Always Working Properly
- using jQuery Cycle by Malsup with WordPress Page and Gallery
- filter out “uncategorized” from all category listings with one filter in functions.php?
- Can’t select my block by clicking on it
- Is it possible to use Twitter intents with the post’s image in WordPress?
- Using PIE CSS in WordPress. “localizing” styles
- Category specific themes?
- Missing tested up to on readme text validator
- Why is it needed to enqueue parent stylesheet in child theme?
- Posting page on all subdomains
- WordPress Unite Theme: Footer isn’t sticking [closed]
- How to set a correct $content_width when there are two content widths on one page?
- Limit number of users a role can create
- How to enqueue javascript for WP Customize options sidebar?
- WordPress 500 Internal server error when activating custom theme [closed]
- Do not display post images on front page
- Customize how a WordPress theme looks like in the Theme Selector
- Change WordPress header color using customizer
- Default Text not showing from customizer
- Images not showing after path specified in header.php
- How to set wp_options in functions.php for removeing the Default Front Page
- Template for landing pages
- Wpautop in wp_editor not working
- How to show a manageable list of images on a post?
- html5-reset theme does not show the image [closed]
- WordPress HTML5 Gallery Support – Convert HTML4 -> HTML5
- Remove link on full-size images
- How to reset post data properly
- Theme options save routine clashes with plugin save
- Contact Form Security
- Customizer Color Control Not Working
- get_search_query() not working with search queries with ampersand in it
- where to start with WordPress theme development [closed]
- Create a Grid/List Toggle in WordPress Archive
- Fixed button and slideshow in template upload per page
- Non-standard (new) theme file
- Best Practice for Server Processing
- 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
- Menu is in Reversed order
- How to connect two child themes on different sub domains to the same base theme
- Group several custom global page templates in sub-folder
- Should I detect the device or the page first?
- Get chronological page order
- Query wp_postmeta into an array based on post_id
- Theme not uploading showing maximum upload size on live site
- WordPress Theme Developments – Start from another theme
- Access meta box checked value in another file
- Best way to access variables in template markup
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- Problem with multiple menus in theme
- How to convert that page to a wordpress template? [closed]
- JQuery Equal Height in Rows Conflicts Only Works without Registering wp_footer();
- Saving Permalinks Results in 403 MAMP (Windows)
- Add rel to all images in a post
- WordPress theme Modifications not showing up on live server
- Incorrect sidebar showing on WooCommerce Store page [closed]
- customize functionality of share buttons under each blog post [closed]
- My wordpress site memory exhausted more than 1GB trying to debug with default
- Display first post on each page differently than the others
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- Image and font support missing in editor when deploying theme remotely