ACF_Admin_Updates::display_wp_error
display_wp_error
Adds an admin notice using the provided WP_Error.
Method of the class: ACF_Admin_Updates{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ACF_Admin_Updates = new ACF_Admin_Updates(); $ACF_Admin_Updates->display_wp_error( $wp_error );
- $wp_error(WP_Error) (required)
- The error to display.
Changelog
| Since 5.7.10 | Introduced. |
ACF_Admin_Updates::display_wp_error() ACF Admin Updates::display wp error code ACF 6.8.8
function display_wp_error( $wp_error ) {
// Only show one error on page.
if ( acf_has_done( 'display_wp_error' ) ) {
return;
}
// Create new notice.
acf_new_admin_notice(
array(
'text' => __( '<strong>Error</strong>. Could not connect to the update server', 'acf' ) . ' <span class="description">(' . esc_html( $wp_error->get_error_message() ) . ').</span>',
'type' => 'error',
)
);
}