Image metadata filter
-
Hello,
In order to optimize db, I added this line to my functions.php file:
remove_filter( ‘wp_read_image_metadata’ );
and got a critical error:
[17-Jun-2021 16:23:40 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function remove_filter(), 1 passed in /home/rabbitr1/public_html/wp-content/themes/hello-elementor/functions.php on line 277 and at least 2 expected in /home/rabbitr1/public_html/wp-includes/plugin.php:282 Stack trace: #0 /home/rabbitr1/public_html/wp-content/themes/hello-elementor/functions.php(277): remove_filter('wp_read_image_m...') #1 /home/rabbitr1/public_html/wp-settings.php(528): include('/home/rabbitr1/...') #2 /home/rabbitr1/public_html/wp-config.php(116): require_once('/home/rabbitr1/...') #3 /home/rabbitr1/public_html/wp-load.php(37): require_once('/home/rabbitr1/...') #4 /home/rabbitr1/public_html/wp-blog-header.php(13): require_once('/home/rabbitr1/...') #5 /home/rabbitr1/public_html/index.php(17): require('/home/rabbitr1/...') #6 {main} thrown in /home/rabbitr1/public_html/wp-includes/plugin.php on line 282
That line in plugin.php says:
* * This function removes a function attached to a specified filter hook. This * method can be used to remove default functions attached to a specific filter * hook and possibly replace them with a substitute. * * To remove a hook, the $function_to_remove and $priority arguments must match * when the hook was added. This goes for both filters and actions. No warning * will be given on removal failure. * * @since 1.2.0 * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param string $tag The filter hook to which the function to be removed is hooked. * @param callable $function_to_remove The name of the function which should be removed. * @param int $priority Optional. The priority of the function. Default 10. * @return bool Whether the function existed before it was removed. */ function remove_filter( $tag, $function_to_remove, $priority = 10 ) { global $wp_filter; $r = false; if ( isset( $wp_filter[ $tag ] ) ) { $r = $wp_filter[ $tag ]->remove_filter( $tag, $function_to_remove, $priority ); if ( ! $wp_filter[ $tag ]->callbacks ) { unset( $wp_filter[ $tag ] ); } } return $r; }
How could I prevent from storing exif and iptc data in db? And is there a way to remove the already stored?
Regards,
Julia
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Image metadata filter’ is closed to new replies.