Error messages when adding code to function.php or trying to delete inactive plugin files

Your functions.php file is outputting instead of returning something, on line 519. Can you post whatever code/functions are around Line 519? EDIT: You have a syntax error in your cpt_Search_category_Filter() function. You have a couple stray semi-colons after closing braces. Change this: function cpt_Search_category_Filter($query) { $post_type = array(‘post’,’business_sold’); if ($query->is_search || $query->is_category) { $query->set(‘post_type’, $post_type); … Read more

Redirect to “All Posts” after post update or publish in Block Editor

As far as I can see, the function redirect_post, where the redirect_post_location filter resides, is not automatically called anywhere, so that filter won’t be triggered. The save_post hook (or preferably save_post_post_type) still works, but not with metaboxes, as Gutenberg saves these separately using ajax calls. Ajax calls run in the background and do not affect … Read more

wp_sanitize_redirect strips out @ signs (even from parameters) — why?

Question why does wp_sanitize_redirect strip out @ signs, exactly? Anybody could anyway try to load a url with an @ sign in it – is there some security issue I’m not thinking about? Just take a look at the source: function wp_sanitize_redirect($location) { $location = preg_replace(‘|[^a-z0-9-~+_.?#=&;,/:%!]|i’, ”, $location); $location = wp_kses_no_null($location); // remove %0d and … Read more

Can Not Redirect from Plugin-Registered Admin Page

You can’t redirect to another page, because WordPress has already rendered admin header and sidebar templates. If you really wish to redirect users to another page, you need to do it earlier, before header and sidebar are rendered. You can use action of following structure to redirect to another page: load-{parent_page_slug}_page_{plugin_subpage_slug} The full snippet: define( … Read more