woocommerce_log_legacy_rest_api_usages

woocommerce_log_legacy_rest_api_usages

Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

apply_filters('woocommerce_log_legacy_rest_api_usages') is found 1 times:

  • /includes/legacy/class-wc-legacy-api.php line 116
    		 * @param bool $do_logging True to enable the logging of all the Legacy REST API usages (default), false to disable.
    		 *
    		 * @since 8.5.0
    		 */
    		if ( apply_filters( 'woocommerce_log_legacy_rest_api_usages', true ) ) {
                $user_agent = sanitize_text_field( wp_unslash( $user_agent ) );
                $route = sanitize_text_field( wp_unslash( $route ) );
                $info = 'Version: ' . WC_API_REQUEST_VERSION . ", Route: $route, User agent: $user_agent";
                $ip_address = WC_Geolocation::get_ip_address();
                if( '' !== $ip_address ) {
                    $info .= ", IP: $ip_address";