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.8.7.0

apply_filters('woocommerce_geolocation_local_database_path') is found 2 times:

  • /includes/wc-update-functions.php line 2065
     * 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 2074
     
    	// 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 );
    }