“Update Failed” message but data is actually saved, Gutenberg
-
I have been making a plugin and it uses a shortcode to display content on the users front end. The plugin works fully as expected apart from with the Gutenberg editor.
When I press “save” or “update” WP displays the “publishing failed” or “update failed” error message. The strange thing is that it actually does save the content/changes.
I have enable WP_DEBUG but it does not provide any further insight, I enable WP_DEBUG_LOG and I can see the following error:
PHP Notice: edit_form_advanced is deprecated since version 5.0.0! Use block_editor_meta_box_hidden_fields instead. This action is still supported in the classic editor, but is deprecated in the block editor. in /wp-includes/functions.php on line 4112
I have been digging around trying to find the cause and I am stumped. I have seen people quoting you need to return your content, which I am, my actual shortcode is as follows:
function enu_explorer_shortcode() { return begin_eurno_explorer(); } add_shortcode( 'eurno_explorer', 'enu_explorer_shortcode' );
The function which it calls is as follows:
function begin_eurno_explorer() { if (!isset($_GET['action'])) { if(((!empty(key($_GET))) && (!isset($_GET['preview']))) ){ $chainName = key($_GET); if(isset($_GET[$chainName])){ $name = $_GET[$chainName]; } if(isset(get_option('eurno_explorer')['eurno_data']['api'][$chainName][0])){ $api = get_option('eurno_explorer')['eurno_data']['api'][$chainName][0]; } if(!isset(get_option('eurno_explorer')['eurno_data']['api'][$chainName][0])) { $api = 'https://enu.qsx.io:443'; } } else { $chainName = 'enu'; $api = 'https://enu.qsx.io:443'; } include_once "header.php"; include_once "config/search.php"; if((isset($_GET[$chainName])) && (empty($_GET[$chainName])) || (!isset($_GET[$chainName]))) { include_once "config/chain-info.php"; include_once "config/block-producers.php"; return; } elseif(isset($_GET[$chainName]) && (strlen($_GET[$chainName]) === 64) && (ctype_xdigit($_GET[$chainName]))) { include_once "config/transaction.php"; return; } elseif((isset($_GET[$chainName])) && (strlen($_GET[$chainName]) <= 12)){ include_once 'config/recent-transactions.php'; return; } $term = implode(", ", $_GET); $chain = key($_GET); echo '<div class="card border border-danger mt-5">'; echo '<div class="card-header alert alert-danger">'; echo 'Showing results for: '.$term.' on: ' . $chain; echo '</div>'; echo '<div class="card-body">'; echo '<div class="p-4">'; echo '<h4>Well, this is embarassing.</h4>'; echo '<p>We can\'t seem to find anything for <b>'.$term.'</b> on the <b>'.$chain.'</b> blockchain. Are you sure you have entered a valid transaction ID or account name?.</p>'; echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; } }
Any insight is really appreciated.
Thank you.
The page I need help with: [log in to see the link]
- The topic ‘“Update Failed” message but data is actually saved, Gutenberg’ is closed to new replies.