Skip to content

Instantly share code, notes, and snippets.

View SanketChodavadiya's full-sized avatar
🎯
Focusing

Sanket Chodavadiya SanketChodavadiya

🎯
Focusing
  • Ahmedabad, India
View GitHub Profile
@SanketChodavadiya
SanketChodavadiya / TweakPHP-to-LocalWP.md
Created October 31, 2025 11:24
Connect TweakPHP to LocalWP MySQL (Fix "Host not allowed" & Socket Errors)

Connect TweakPHP to LocalWP MySQL via Unix Socket

Problem: Host '127.0.0.1' is not allowed Host '::1' is not allowed Can't assign requested address

Solution: Use Unix socket by editing wp-config.php and loading the correct PHP binary in TweakPHP.


@SanketChodavadiya
SanketChodavadiya / functions.php
Last active March 13, 2024 06:53
Save local JSON of all ACF group, Remove code once json file is generated.
<?php
$field_groups = acf_get_field_groups();
// Apply our callback to all field groups
array_map( function ( $field_group ) {
// Load up the fields on the field group.
$field_group['fields'] = acf_get_fields( $field_group );
// Write the local JSON file for the field group.
acf_write_json_field_group( $field_group );
}, $field_groups );