Skip to content

Commit

Permalink
🔥 Remove deprecated Admin Columns support
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Oct 24, 2024
1 parent a50e5b9 commit f1c7b42
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Advanced Custom Fields: Phone Number
* Plugin URI: https://github.com/log1x/acf-phone-number
* Description: A real ACF phone number field.
* Version: 1.2.6
* Version: 1.3.0
* Author: Brandon Nifong
* Author URI: https://github.com/log1x
*/
Expand Down Expand Up @@ -36,10 +36,6 @@ public function __invoke()
}

$this->register();

if (defined('ACP_FILE')) {
$this->hookAdminColumns();
}
}

/**
Expand All @@ -60,24 +56,4 @@ protected function register()
return (new PhoneNumber($value))->toArray();
}, 10, 4);
}

/**
* Hook the Admin Columns Pro plugin to provide basic field support
* if detected on the current WordPress installation.
*
* @return void
*/
protected function hookAdminColumns()
{
add_filter('ac/column/value', function ($value, $id, $column) {
if (
! is_a($column, '\ACA\ACF\Column') ||
$column->get_acf_field_option('type') !== 'phone_number'
) {
return $value;
}

return get_field($column->get_meta_key())->national ?? $value;
}, 10, 3);
}
});

0 comments on commit f1c7b42

Please sign in to comment.