woocommerce_geolocation_local_database_path

woocommerce_geolocation_local_database_path

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_geolocation_local_database_path') is found 2 times:

  • /includes/wc-update-functions.php line 2074
    2070
    2071
    2072
    2073
    2074
    2075
    2076
    2077
    2078
    2079
    2080
    * be publicly accessible.
     */
    function wc_update_390_move_maxmind_database() {
        // Make sure to use all of the correct filters to pull the local database path.
        $old_path = apply_filters( 'woocommerce_geolocation_local_database_path', WP_CONTENT_DIR . '/uploads/GeoLite2-Country.mmdb', 2 );
     
        // Generate a prefix for the old file and store it in the integration as it would expect it.
        $prefix = wp_generate_password( 32, false );
        update_option( 'woocommerce_maxmind_geolocation_settings', array( 'database_prefix' => $prefix ) );
     
        // Generate the new path in the same way that the integration will.
  • /includes/wc-update-functions.php line 2083
    2080
    2081
    2082
    2083
    2084
    2085
    2086
    2087
    2088
        // Generate the new path in the same way that the integration will.
        $uploads_dir = wp_upload_dir();
        $new_path    = trailingslashit( $uploads_dir['basedir'] ) . 'woocommerce_uploads/' . $prefix . '-GeoLite2-Country.mmdb';
        $new_path    = apply_filters( 'woocommerce_geolocation_local_database_path', $new_path, 2 );
        $new_path    = apply_filters( 'woocommerce_maxmind_geolocation_database_path', $new_path );
     
        // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
        @rename( $old_path, $new_path );
    }