← Back
Editing: DeprecateOldTemplateHook.php
<?php namespace Give\Form\LegacyConsumer\Commands; use Give\Form\LegacyConsumer\FilterCallbackCollection; /** * @since 2.10.2 */ class DeprecateOldTemplateHook implements HookCommandInterface { /** * @since 4.19.1 Add translators comments. * @since 2.10.2 * * @param string $hook * * @return void */ public function __invoke($hook) { global $wp_filter; if (has_filter("give_$hook")) { $callbacks = FilterCallbackCollection::make( $wp_filter["give_$hook"]->callbacks ) ->flatten() ->withoutPrefix('give_') ->withoutPrefix('__give_'); if ($callbacks->count() > 1) { _give_deprecated_function( /* translators: %s: Name of the deprecated action */ sprintf(__('The %s action', 'give'), "give_$hook"), '2.10', "give_fields_$hook" ); } } } }
Save File
Cancel