I'm building the admin page for my plugin, I'm saving well in the DB, but when I press the button Save the page is reloaded with an empty form. I'm looking how can I save the form but make a redirect (I don't know if this would be a redirect) but when the page is reloaded display the object recent saved and show the corresponding data in each field, for example, when we write a post, first we are in post-new.php
but when we save WP take us to post.php?post=195&action=edit
. Until now I have this:
public function puzzle_manager(){
global $wpdb;
$file = file_get_contents('puzzle_manager.php', FILE_USE_INCLUDE_PATH);
if($file == false){
echo 'file not found';
}
else{
echo $file;
}
$default = array(
'puzzle_title' => '',
'image' => '',
'rows' => '',
'cols' => '',
'timer' => '',
'movements_counter' => '',
'original_button' => '',
'numbers_button' => '',
);
$item = shortcode_atts( $default, $_REQUEST );
$wpdb->insert( 'wp_puzzle' , $item );
}