You’re almost there… If you send the request to admin-post.php, then only your callback will print the response. And since your callback doesn’t print anything, then you’re getting blank screen.
Most of the time what you want to do is to perform a redirect inside such callback:
public function kh_update_media_seo() {
delete_option('myoption');
wp_redirect( admin_url('admin.php?page=mycustomoptionspage') );
exit;
}
add_action( 'admin_post_my_media_update', 'kh_update_media_seo' );
Related Posts:
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- How to store widget fields data as an array?
- How To Add New Option Types To Option Tree?
- Modular theme settings
- How does WordPress decide what template to use as frontpage
- get_option function
- Get category slug and display it on a query_post
- Override Current Theme Setting in wp_config.php
- Why might $input (Settings API) be coming through empty?
- Multiple Custom_Background, is it possible?
- Front End Post Submit Form
- Static Front Page problem
- two tinyMCE editors in the same page
- Cannot update WordPress General Settings Site Title and Tagline
- How to upload images using Settings API
- How to handle custom form submission?
- Theme settings keep getting reset/erased
- searchform.php override not working
- Where should I update_options in a theme?
- How can I display/hide certain content based on a Theme Option field?
- How to create a multiple choice radio group for a single theme option
- Custom form in theme template displaying internal server error upon submission
- How can I make my options in an array and store theme in WP options one DB row?
- How to Call pages from a Options Panel
- Efficiency of wp_options vs a new table
- How to set wp_options in functions.php for removeing the Default Front Page
- Override plugin option by with a custom theme
- Forms won’t submit
- not getting API setting saved confirmation message after update on option page
- Update Specific Key Value in Complex `wp_options` object
- How to remove permalinks links presents in each page of my site?
- Tabbed theme options query about add_settings_section callback function
- How to use multiple check-box values to work in a function and insert values in database
- How to fix a conflict cause by my theme with Woocommerce and/or Gravity Forms?
- Data not saved WordPress Custom Admin Page
- Theme Option’s Save Button is not working
- How to Find the Page the Front Page is Using?
- My jQuery is enqueued properly. So why isn’t it working?
- Database Tables in WordPress Theme
- 3 Level Deep Navigation Menu Not Showing All Levels
- Broken theme, template is missing
- WordPress page/blog incorporated into static website
- wp_enqueue_script not working?
- Random white space before doctype
- Theme Development -> Specific Homepage
- Premium theme licensing of php called through AJAX
- is_single() works in plugin, not in theme?
- Do I need to create a child theme for JointsWP
- why mytheme/single-product.php works but not mytheme/woocommerce/single-product.php
- Issue on Accessing To Ajax Enqeued File to Pass to URL for Ajax Call
- pass wordpress template directory into ajax url call
- theme-independent CSS/JS files
- What is the need for the static front page [closed]
- Do translation functions like __e() have to take strings in English in themes?
- Javascript development in Custom Themes
- Custom jquery not code not working in wordpress
- License of the used Bootstrap Theme is not GPL compatible
- Customize Option Framework
- How to include posts with a theme
- Under theme folder, what’s sequence of action for index.php, page.php, single.php?
- Register a custom post type as public = false, but have content appear in search engines?
- Pagination don’t work with active filters
- Theme author.php transfer
- restrain filter on get_the_excerpt to queried item in stead of current post
- Theme has disappeared
- Array for WordPress Avatar Size and Class
- How to display only author’s name for the current post?
- How can I include custom Gutenberg Blocks in a theme?
- WordPress displaying two different headers, one at top and one below footer
- How to show metabox on page if it is using a template
- Mix it up & WordPress
- two col layout bootstrap 4 with one fixed col and fade in effect on image
- Debugging slow WordPress Theme Customizer (Any option similar to Query Monitor)?
- register_theme_directory() sees custom themes directory, but blank frontend
- Jetpack Infinite Scroll Not Working
- After WP 4.6.1 Update , Blog page started giving 500 error
- How to show children pages as array
- wp_nav_menu custom walker class
- Changes to template not showing up unless ?reset=1 added to URL
- Enqueue Stylesheets After Theme’s “rtl.css”
- How do I keep images in posts below a certain size without editing the post?
- Theme options not displaying correctly after theme update
- Multiple Content Shortcodes
- Is it possible to customize the layout of Gallery Shortcode?
- How can i use archive.php for indexing wordpress default posts?
- Add the ability of changing background color of a theme [closed]
- How to use esc_attr__() function properly to translate a variable that contains string?
- What to do when child theme is out of date with parent theme
- How to make website with many template that active [closed]
- Query for tag given slug
- Image Size wrong during upload
- How can I add a single image from a gallery into the page header?
- How to create full header but keep content narrow
- Creating image grid on products page in wordpress
- Insert gutenberg blocks into template
- Bootstrap 4 mobile menu not working for WordPress Development
- How to make it so I can “use” template parts in (classic/full) site editor
- How do I send out an update for my custom wordpress theme?
- custom wordpress theme blog page always not showing the last two pages of the articles
- How to add multiple custom blocks in custom WordPress theme using create-block?