PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 1.9.13
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v1.9.13
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / inc / common / partners.php

partners.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 1.9.13, at inc/common/partners.php

34 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
3
4 add_action( 'update_option_' . Imagify_Options::get_instance()->get_option_name(), 'imagify_maybe_delete_partner_on_option_update', 10, 2 );
5 /**
6 * After the first API key has been successfully added, make sure the partner ID is deleted.
7 *
8 * @since 1.6.14
9 * @author Grégory Viguier
10 *
11 * @param mixed $old_value The old option value.
12 * @param mixed $new_value The new option value.
13 */
14 function imagify_maybe_delete_partner_on_option_update( $old_value, $new_value ) {
15 if ( empty( $old_value['api_key'] ) && ! empty( $new_value['api_key'] ) ) {
16 imagify_delete_partner();
17 }
18 }
19
20 add_action( 'update_site_option_' . Imagify_Options::get_instance()->get_option_name(), 'imagify_maybe_delete_partner_on_network_option_update', 10, 3 );
21 /**
22 * After the first API key has been successfully added to the network option, make sure the partner ID is deleted.
23 *
24 * @since 1.6.14
25 * @author Grégory Viguier
26 *
27 * @param string $option Name of the network option.
28 * @param mixed $new_value The new network option value.
29 * @param mixed $old_value The old network option value.
30 */
31 function imagify_maybe_delete_partner_on_network_option_update( $option, $new_value, $old_value ) {
32 imagify_maybe_delete_partner_on_option_update( $old_value, $new_value );
33 }
34