Skip to content

Instantly share code, notes, and snippets.

View shamimkhan539's full-sized avatar

Shamim Khan shamimkhan539

View GitHub Profile

Git Usage

  • use the following prefixes for commit messages followed by a colon and a space:
    • "fix" for bug fixes
    • "feat" for new features
    • "perf" for performance improvements
    • "docs" for documentation changes
    • "style" for formatting changes
    • "refactor" for code refactoring
    • "test" for adding missing tests
  • "chore" for chore tasks
@shamimkhan539
shamimkhan539 / acf_load_json_local.php
Last active September 16, 2022 10:44 — forked from yratof/f.php
acf load json files and sync
<?php
function acf_fields() {
// Load field files dynamically
$field_files = glob( dirname(__FILE__) .'/acf-fields/*.json' );
foreach ( $field_files as $file ) {
if ( apply_filters( 'midsona_allow_acf_file', true, $file ) ) {
$json = json_decode( file_get_contents( $file ), true );
$json[0]['local'] = 'json';
// $json[] =
acf_add_local_field_group( $json[0] );