Tuesday, May 31, 2016

A curious case of "you are not allowed" in WordPress

Register a custom taxonomy. Everything looks great, except for one "tiny" problem: any attempt to Add New results in immediate "You are not allowed" message!

Blame Yoast, of course! :)
He suggested "is_admin, but not DOING_AJAX". So, the "register taxonomy" was hooked on "not AJAX". Oooooopsi!

Re-hooked. Ta-da!

Thursday, May 19, 2016

debug_backtrace and call_user_func in PHP 7

Before PHP 7, functions call_user_func() and call_user_func_array() appeared in debug_backtrace() as separate entries. Since the version 7, they do not.

Demonstration code Gist