In Woocommerce, I have added button with meta boxes but on click of that button at admin order detail page showing order updated and next function is not getting execute.
This is my code:
add_action( 'add_meta_boxes', 'add_meta_boxesws' );
function add_meta_boxesws()
{
add_meta_box(
'add_meta_boxes',
__( 'Custom' ),
'sun'
);
}
function sun(){
echo '<input type="hidden" value="abc" name="abc"/>';
echo '<p><button id="mybutton" type="submit">Return Shipment</button></p>';
}
if ( !empty( $_POST['abc'] ) ) {
function call_this(){
echo "hello";
}
add_action('dbx_post_sidebar','call_this');
}
Any Help will be appreciated.
dbx_post_sidebar
action hook is coming from? This is not a wordpress or a Woocommerce hook. So If you are using a plugin or some other costumizations, you should edit your question adding the necessary details related to that. Without it, nobody can help you. – LoicTheAztec