Trigger custom action when setting button pressed
You need a second form with admin_url(‘admin-post.php’) as form action. Then you can hook into admin_post_custom_action to execute your action. Sample code: add_action( ‘admin_post_wpse_79898’, ‘wpse_79898_test’ ); function wpse_79898_test() { if ( isset ( $_GET[‘test’] ) ) echo esc_html( $_GET[‘test’] ); die( __FUNCTION__ ); } In your settings page: <form action=”<?php echo admin_url( ‘admin-post.php’ ); ?>”> … Read more