strip last comma from get_the_category

foreach((get_the_category()) as $category) { echo $category->cat_name . ', '; } So I’m echoing it like this because I don’t want the categories to appear as hyperlinks, I just want the cat names. The problem is I can’t get rid of the last separator so it ends up like : category, category, category, I tried ‘stripping’ … Read more

Disable Debug Log Programmatically

I’m trying to disable WP_DEBUG_LOG if and only if debug.log exists. I’d like to hook into wp_footer and test if the file exists and if so disable my debug log. All I’ve found though is that WP_DEBUG_LOG is a constant and can only be changed from the wp-config.php file which is too early for my case. Is there a way to change it from a constant on install and keep it working as normal?