Abilities API allows for extending WP_Ability by providing ability_class during the ability registration. This is meant to unlock complex abilities holding some sort of state or logic that requires multiple helper methods.
In all of those scenarios you would ovewrite execute or do_execute method.
However, because the check for execute_callback is in constructor, then in order to register an ability with ability_class overwrite, you have to BOTH: provide do_execute and provide a dummy execute_callback. The same need happens for permission_callback.
This commit fixes the issue execute_callback and permission_callback are now optional when a class is provided.
Props artpi, swissspidy, jorgefilipecosta, mindctrl.
Fixes#64407.
Built from https://develop.svn.wordpress.org/trunk@61390
git-svn-id: http://core.svn.wordpress.org/trunk@60702 1a063a9b-81f0-0310-95a4-ce76da25c4cd