Plugin.php: PHP Notice: Undefined offset: 0 in

Some code on your site registers a filter or an action with invalid arguments. The errors you see happen, because add_action() or add_filter() was called with a second argument that is not a string, an object or an array. Examples: add_action( ‘wp_head’, NULL ); add_filter( ‘the_content’, -1 ); Disable all plugins, switch to Twenty Eleven, … Read more

Settings API – Undefined Index when unchecking checkbox

Managed to fix this by doing the following: function dat_checkbox_field_0_render( ) { $options = get_option( ‘dat_settings’ ); $a = $options; if (array_key_exists(“dat_checkbox_field_0″,$a)) { } else { $options[‘data_checkbox_field_0’] = false; } ?> <input type=”checkbox” name=”dat_settings[dat_checkbox_field_0]” <?php checked( $options[‘dat_checkbox_field_0’], 1 ); ?> value=”1″> <?php }

The editor has encountered an unexpected error. // TypeError: Cannot read property ‘prefix’ of null

So, I was researching this topic a bit deeper. All answers found on this SE suggested disabling Gutenberg with a plugin. This couldn’t be a valid “fix” in my oppinion. After researching and browsing through the git issues of WordPress/gutenberg I’ve found a pretty easy solution for this problem. The user joshuafredrickson on the git … Read more

Error: “Cannot modify header information”

The basic problem you have is that you want to send a redirect header, and that redirection code is executed too late, namely in your shortcode handler. You can send HTTP headers only before any output has been sent, not later. So what you have to do, generally speaking, is separating the shortcode logic from … Read more

get_terms return errors

As i was mentioning before, it’s a case of your term fetching occuring before the taxonomy has been registered. The init action occurs after the theme’s functions file has been included, so if you’re looking for terms directly in the functions file, you’re doing so before they’ve actually been registered. Here’s a portion of the … Read more

Disable Debug Log Programmatically

@Wyck was right, ( well sorta 😛 ) you can set error logs but 1) You need to enable debugging 2) ini_set(‘log_errors’, 1); or 0 for false 3) You need to set a log location via ini_set(‘error_log, $location) Once you have that set you can then if need be test if said file exists via … Read more

How do I set up Debugging?

I use a plugin for this issue. Even if debug is set to false, it still prints error to the screen in red. It is easy and fast to create the plugin. In your plugins folder in your wordpress install, create a new file and call it anything you like, for instance, debugger-plugin.php. Open up … Read more

Error 310 too many redirects after switching domains

It is infinitely redirecting. I have seen (and created) this problem a lot when trying to do either a non-www to www domain or a non-trailing-slash to trailing-slash redirect. Did you or an SEO firm do 301 redirects after a new site launch and can you post the contents of your .htaccess file?