Add filters for customizing Imagify promotion notice#29
Add filters for customizing Imagify promotion notice#29pratikrm wants to merge 1 commit intowp-media:trunkfrom
Conversation
Introduces new filters to allow third parties to customize the Imagify partner ID and the promotion notice text. Also adds a filter to control asset enqueuing on admin pages. Updates JS and PHP to use the filtered notice text, improving extensibility and localization.
| // Allow host plugin to define the Imagify partner ID. | ||
| $partner = apply_filters( 'wpmedia/plugin_family/imagify_partner', '%imagifypartnerid%' ); | ||
| $this->set_imagify_partner( $partner ); |
There was a problem hiding this comment.
We already cater for dynamic partner ID, you only need to add imagify_partner to your extra option in composer.json. During installation of the package, composer will take care of this and automatically pick the ID from your composer.json and replace the wildcard with it. you should also configure your plugin_domain as well

There was a problem hiding this comment.
Thanks @jeawhanlee
I'll make this change in the plugin. Still we'll need to add some hook when plugin is being installed because we also want to add tracking event.
There was a problem hiding this comment.
Hi @jeawhanlee
I added imagify_partner in composer.json file, but that is not working on my setup. Upon installing the plugin, the %imagifypartnerid% is stored in the imagifyp_id . Here is the composer.json file from my setup:
composer.json
There was a problem hiding this comment.
For that to work, you'll need to use a post-install-cmd and post-update-cmd, majorly to perform the same operations for both composer install & update. We do that here for WPR
Description
Introduces new filters to allow third parties to customize the Imagify partner ID and the promotion notice text. Also adds a filter to control asset enqueuing on admin pages. Updates JS and PHP to use the filtered notice text, improving extensibility and localization.