Fatal error: Uncaught Error: Cannot use object of type WP_Error as array

As per the lines around the line number of the error: $response = wp_remote_get($this->backup_domain . “?s=” . is_404(), $args); $ups= json_decode($response[‘body’], true); $response may be a WP_Error object if there was an error with the request. Thus, trying to access it as an array on the next line $response[‘body’] can cause the fatal error. You … Read more

How to hook into debug.log?

WordPress tells PHP, using ini_set(), in wp_debug_mode() which errors should be handled and which file they should be written to. The function is called in wp-settings.php when WP is starting up. As suggested by David in How to catch all PHP errors with custom error handler? answers you could use PHP’s set_error_handler() to define a … Read more

Core error when calling remove_menu_page

The error line comes from the following in wp-admin/includes/plugin.php: function remove_menu_page( $menu_slug ) { global $menu; foreach ( $menu as $i => $item ) { if ( $menu_slug === $item[2] ) { unset( $menu[ $i ] ); return $item; } } return false; } The global $menu does not actually get populated until the wp-admin/menu-header.php … Read more

How to use filter in this situation, can not modify the structure using filter

So you’re trying to call the hide_empty_fields() and maybe_add_disclaimer_and_courtesy() methods in the Register_Impress_Shortcodes class, from within a global function, and it’s not impossible to call class methods from within such global functions, but you cannot use $this in your function because $this is only available from within a class method which is called from within … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)