jpkcom_acf_references_abilities_enabled()
Decide whether the abilities should be registered at all.
jpkcom_acf_references_abilities_enabled() : bool
Requires Plugins only blocks activation; core does not stop a dependency
being deactivated while dependents are active. get_field() is therefore
checked rather than assumed.
-
since
-
1.2.0
Return values
bool
—
True when registration should proceed.
jpkcom_acf_references_ability_log()
Write a debug line, and only with WP_DEBUG.
jpkcom_acf_references_ability_log(string $message) : void
Parameters
-
$message
: string
-
-
since
-
1.2.0
jpkcom_acf_references_ability_error()
Build a WP_Error carrying an HTTP status.
jpkcom_acf_references_ability_error(string $code, string $message[, int $status = 400 ]) : WP_Error
The status is not decoration. The REST run controller returns the WP_Error
verbatim and rest_ensure_response() defaults to 500 without data['status'] —
and a 5xx tells an agent "transient fault, retry unchanged", which is the
exact opposite of what a caller mistake needs to hear.
Parameters
-
$code
: string
-
-
$message
: string
-
-
$status
: int
= 400
-
-
since
-
1.2.0
jpkcom_acf_references_ability_boundary()
Turn a Throwable out of a callback into a WP_Error.
jpkcom_acf_references_ability_boundary(callable $body, string $ability) : array<string, mixed>|WP_Error
ACF throws while READING corrupt meta, so no check on the shape beforehand
catches it. This rim does not catch everything: schema validation and the
permission check both run before it.
Parameters
-
$body
: callable
-
Callback returning the ability result.
-
$ability
: string
-
Ability name, for the log line.
-
since
-
1.2.0
Return values
array<string, mixed>|WP_Error
—
jpkcom_acf_references_ability_json_object()
Wrap an empty map so it encodes as {} rather than [].
jpkcom_acf_references_ability_json_object(array<string, mixed> $map) : array<string, mixed>|stdClass
PHP serialises an empty array as the JSON array [], and a client validating
against a schema declaring type: object rejects that. Only the empty case
is wrapped, so PHP callers keep array access where there is data.
Parameters
-
$map
: array<string, mixed>
-
-
since
-
1.2.0
Return values
array<string, mixed>|stdClass
—
jpkcom_acf_references_ability_capability()
Capability required to run an ability.
jpkcom_acf_references_ability_capability(string $ability) : bool
Defaults to read. Every query is hard-scoped to published references, so
this cannot expose drafts — but it is bulk machine-readable access, and a
site may want it narrower.
Parameters
-
$ability
: string
-
-
since
-
1.2.0
Return values
bool
—
True when the current user may run it.
Build the meta array for an ability.
jpkcom_acf_references_ability_meta(string $ability) : array<string, mixed>
Three independent switches: show_in_rest (core REST), public (WP 7.1; inert
passthrough before that), and mcp.public — not a core key at all, but the
MCP Adapter's own gate for discovery AND execution.
All three annotations are set explicitly. They default to null, and the REST
run controller derives the HTTP verb from them: readonly makes the run route
GET-only and POST answers 405.
Parameters
-
$ability
: string
-
-
since
-
1.2.0
Return values
array<string, mixed>
—
Refuse a top-level input key the ability does not declare.
jpkcom_acf_references_ability_validate_input_keys(array<string, mixed> $input, array<string|int, string> $allowed) : true|WP_Error
On EVERY ability, not a subset. A guard on some of them is a trap: a caller
that learned the refusal on one assumes it everywhere, and the ability that
silently accepts is the one it will trust. The sibling plugin shipped
exactly that gap for a whole release.
Without this, an axis the ability does not declare is not applied and the
answer is the complete unfiltered set behind an HTTP 200 — a caller has to
notice an absence to notice the failure.
Parameters
-
$input
: array<string, mixed>
-
-
$allowed
: array<string|int, string>
-
-
since
-
1.2.0
Return values
true|WP_Error
—
True when every key is declared.
Bring the value core hands the callback into array form.
jpkcom_acf_references_ability_normalise_input(mixed $input) : array<string, mixed>|null
normalize_input() substitutes the schema's TOP-LEVEL default when the input
is exactly null, and that default is a stdClass — so the callback receives
an object and must read it. A callback that only accepts an array answers
400 to the most obvious call it has. This exact defect shipped twice in the
sibling plugins.
Parameters
-
$input
: mixed
-
-
since
-
1.2.0
Return values
array<string, mixed>|null
—
Array form, or null when unusable.
jpkcom_acf_references_ability_slug_list()
Normalise a filter axis into a bounded list of term slugs.
jpkcom_acf_references_ability_slug_list(mixed $value) : array<string|int, string>
Parameters
-
$value
: mixed
-
-
since
-
1.2.0
Return values
array<string|int, string>
—
Slugs, deduplicated and capped.
jpkcom_acf_references_ability_id_list()
Normalise a filter axis into a bounded list of positive post IDs.
jpkcom_acf_references_ability_id_list(mixed $value) : array<string|int, int>
Parameters
-
$value
: mixed
-
-
since
-
1.2.0
Return values
array<string|int, int>
—
IDs, deduplicated and capped.
jpkcom_acf_references_ability_validate_search()
Refuse a search term core would silently discard.
jpkcom_acf_references_ability_validate_search(string $search) : true|WP_Error
Parameters
-
$search
: string
-
-
since
-
1.2.0
Return values
true|WP_Error
—
True when the term is usable.
jpkcom_acf_references_ability_vocabulary()
Read one taxonomy's terms as the filter vocabulary.
jpkcom_acf_references_ability_vocabulary(string $taxonomy) : array{terms: array>, truncated: bool}
hide_empty is false: a term with no reference today is still a valid filter
value, and reporting only used terms would make the vocabulary shift under a
caller that cached it.
Parameters
-
$taxonomy
: string
-
-
since
-
1.2.0
Return values
array{terms: array>, truncated: bool}
—
Read the customers or locations a caller may filter by.
jpkcom_acf_references_ability_related_vocabulary(string $post_type) : array{items: array>, truncated: bool}
Published only, and projected to id/title. Never a WP_Post: ACF resolves
these relations with post_status => 'any' elsewhere, and WP_Post exposes
post_password as a public property.
Parameters
-
$post_type
: string
-
-
since
-
1.2.0
Return values
array{items: array>, truncated: bool}
—
jpkcom_acf_references_ability_count_query()
Count posts matching a set of query arguments, cheaply.
jpkcom_acf_references_ability_count_query(array<string, mixed> $args) : int
Parameters
-
$args
: array<string, mixed>
-
-
since
-
1.2.0
jpkcom_acf_references_ability_visibility_counts()
Report how many published references the listing rule excludes, and why.
jpkcom_acf_references_ability_visibility_counts() : array<string, int>
Both numbers are DIFFERENCES, derived from the rule itself. Restating what
"expired" means as its own meta_query is the defect this shape exists to
prevent: the rule's expiry clause is an OR group of three branches, and
negating only the first is not its complement — MariaDB casts '' to
'0000-00-00', so every reference whose date had been saved and cleared would
be counted as expired in the same response that lists it.
hidden_expired = ( published + featured row ) - listed
hidden_missing_featured = published - ( published + featured row )
-
since
-
1.2.0
Return values
array<string, int>
—
jpkcom_acf_references_ability_archive_url()
The reference archive URL, or an empty string when there is none.
jpkcom_acf_references_ability_archive_url() : string
-
since
-
1.2.0
jpkcom_acf_references_ability_permission_list_filters()
Permission callback for list-filters.
jpkcom_acf_references_ability_permission_list_filters([mixed $input = null ]) : bool
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
bool
—
True when the current user may run it.
jpkcom_acf_references_ability_permission_query_references()
Permission callback for query-references.
jpkcom_acf_references_ability_permission_query_references([mixed $input = null ]) : bool
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
bool
—
True when the current user may run it.
jpkcom_acf_references_ability_permission_get_reference()
Permission callback for get-reference.
jpkcom_acf_references_ability_permission_get_reference([mixed $input = null ]) : bool
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
bool
—
True when the current user may run it.
jpkcom_acf_references_ability_list_filters_inner()
Report the values a caller may filter references by.
jpkcom_acf_references_ability_list_filters_inner([mixed $input = null ]) : array<string, mixed>|WP_Error
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
array<string, mixed>|WP_Error
—
jpkcom_acf_references_ability_query_references_inner()
Run a filtered, paginated query over publicly listed references.
jpkcom_acf_references_ability_query_references_inner([mixed $input = null ]) : array<string, mixed>|WP_Error
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
array<string, mixed>|WP_Error
—
jpkcom_acf_references_ability_get_reference_inner()
Return one reference by ID.
jpkcom_acf_references_ability_get_reference_inner([mixed $input = null ]) : array<string, mixed>|WP_Error
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
array<string, mixed>|WP_Error
—
jpkcom_acf_references_ability_list_filters()
Execute callback for jpkcom-acf-references/list-filters.
jpkcom_acf_references_ability_list_filters([mixed $input = null ]) : array<string, mixed>|WP_Error
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
array<string, mixed>|WP_Error
—
jpkcom_acf_references_ability_query_references()
Execute callback for jpkcom-acf-references/query-references.
jpkcom_acf_references_ability_query_references([mixed $input = null ]) : array<string, mixed>|WP_Error
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
array<string, mixed>|WP_Error
—
jpkcom_acf_references_ability_get_reference()
Execute callback for jpkcom-acf-references/get-reference.
jpkcom_acf_references_ability_get_reference([mixed $input = null ]) : array<string, mixed>|WP_Error
Parameters
-
$input
: mixed
= null
-
-
since
-
1.2.0
Return values
array<string, mixed>|WP_Error
—
jpkcom_acf_references_get_ability_definitions()
Build the registration arguments for every ability this plugin provides.
jpkcom_acf_references_get_ability_definitions() : array<string, array<string, mixed>>
Reads no WordPress state and touches no registry, which is what lets the CI
harness assert the shape of these arrays without a WordPress installation.
Not free of side effects though: __() and the meta filter each fire
apply_filters(), so third-party callbacks run whenever this is called.
-
since
-
1.2.0
Return values
array<string, array<string, mixed>>
—
Ability name => registration args.
jpkcom_acf_references_register_ability_category()
Register the shared category, unless a sibling plugin already did.
jpkcom_acf_references_register_ability_category() : void
Categories are global and first-wins. Without the check all abilities still
register - the category exists either way - but _doing_it_wrong() fires, and
which plugin wins depends on load order.
-
since
-
1.2.0
jpkcom_acf_references_register_abilities()
Register every ability this plugin provides.
jpkcom_acf_references_register_abilities() : void
wp_register_ability() returns null on EVERY failure path and reports only
through _doing_it_wrong(), which is silent in production - and so is the
debug log without WP_DEBUG. The return value is checked, but do not expect a
registration failure to announce itself on a customer site.
-
since
-
1.2.0
jpkcom_acf_references_disable_archive_field()
Render disable archive checkbox field
jpkcom_acf_references_disable_archive_field() : void
-
since
-
1.0.0
jpkcom_acf_references_redirect_url_field()
Render archive redirect URL field
jpkcom_acf_references_redirect_url_field() : void
-
since
-
1.0.0
jpkcom_acf_references_shortcodes_page()
Render Shortcodes admin page
jpkcom_acf_references_shortcodes_page() : void
Tags
-
since
-
1.0.0
jpkcom_acf_references_options_page()
Render Options admin page
jpkcom_acf_references_options_page() : void
Tags
-
since
-
1.0.0
jpkcom_acf_references_breadcrumb()
Output Bootstrap 5 breadcrumb navigation
jpkcom_acf_references_breadcrumb() : void
Generates breadcrumb navigation for:
- Single reference posts (Home > References > Reference Title)
- Reference archive (Home > References)
- Other pages (Home > Page Title)
Includes proper ARIA labels and semantic HTML5 markup.
-
since
-
1.0.0
-
global
-
WP_Post $post Current post object.
jpkcom_render_acf_fields()
Renders all ACF fields of a post with Bootstrap 5 markup and smart icons
jpkcom_render_acf_fields([string $post_type = '' ]) : void
Automatically detects field types and renders them with appropriate styling:
- Images: Responsive with rounded corners
- WYSIWYG/Textarea: Light background container
- Relationships/Post Objects: Linked post titles
- True/False: Badge indicators
- Repeater: Responsive tables
- Groups: Nested definition lists
Parameters
-
$post_type
: string
= ''
-
Optional. Post type for field group query. Default empty (uses current post type).
-
since
-
1.0.0
-
global
-
WP_Post $post Current post object.
acf_get_field_label()
Get ACF field label by field key or field name
acf_get_field_label(string $field_key_or_name) : string
Attempts to retrieve the field label from ACF. If not found,
returns a formatted fallback based on the field name/key.
Parameters
-
$field_key_or_name
: string
-
Field key (e.g., 'field_abc123') or field name (e.g., 'job_title').
-
since
-
1.0.0
Return values
string
—
Field label or formatted fallback string.
jpkcom_get_acf_field_label()
Get ACF field label with enhanced search capabilities
jpkcom_get_acf_field_label(string $field_name_or_key[, string $post_type = '' ]) : string
Searches for field labels in this order:
- Direct field key lookup (if starts with 'field_')
- Search through field groups by post type
- Search through sub_fields (repeater/group fields)
- Fallback to formatted field name
Parameters
-
$field_name_or_key
: string
-
Field name (e.g., 'job_title') or field key (e.g., 'field_abc123').
-
$post_type
: string
= ''
-
Optional. Post type for context-specific field group search. Default empty.
-
since
-
1.0.0
Return values
string
—
Field label or formatted fallback string.
jpkcom_human_readable_relative_date()
Convert timestamp to human-readable relative date string
jpkcom_human_readable_relative_date(int $timestamp) : string
Converts Unix timestamps into relative date strings like:
- "Published today"
- "Published yesterday"
- "Published 3 days ago"
- "Published 2 weeks ago"
- "Published 5 months ago"
- "Published 2 years ago"
All strings are translatable via the 'jpkcom-acf-references' text domain.
Parameters
-
$timestamp
: int
-
Unix timestamp to convert.
-
since
-
1.0.0
Return values
string
—
Translated relative date string.
Register custom image sizes for reference posts
jpkcom_acf_references_media_size() : void
Registers six image sizes:
- jpkcom-acf-reference-16x9: 576x324px (16:9, hard crop)
- jpkcom-acf-reference-logo: 512x512px (square, hard crop)
- jpkcom-acf-reference-header: 992x558px (16:9, hard crop)
- jpkcom-acf-reference-card-overlay: 800x600px (4:3, hard crop)
- jpkcom-acf-reference-gallery-thumb: 200x200px (square, hard crop)
- jpkcom-acf-reference-gallery-modal: 1400px width (proportional, no crop)
-
since
-
1.0.0
jpkcom_acf_references_image_sizes_to_selector()
Add custom image sizes to media library size selector
jpkcom_acf_references_image_sizes_to_selector(array<string|int, string> $sizes) : array<string|int, string>
Makes custom image sizes available in the WordPress media library
dropdown when inserting images into posts.
Parameters
-
$sizes
: array<string|int, string>
-
Existing image size options.
-
since
-
1.0.0
Return values
array<string|int, string>
—
Modified array with custom sizes added.
Output Bootstrap 5 pagination navigation
jpkcom_acf_references_pagination([string|int $pages = '' ][, int $range = 2 ]) : void
Generates numbered pagination with first/last and prev/next controls.
Includes proper ARIA labels and accessible markup.
Features:
- First/Last page links (« »)
- Previous/Next page links (‹ ›)
- Numbered page links with range control
- Active page indicator
- Disabled state for unavailable actions
Parameters
-
$pages
: string|int
= ''
-
Optional. Total number of pages. Default empty (auto-detect from query).
-
$range
: int
= 2
-
Optional. Number of page links to show on either side of current page. Default 2.
-
since
-
1.0.0
-
global
-
int $paged Current page number (set by WordPress).
-
WP_Query $wp_query WordPress query object.
jpkcom_acf_references_build_reference_query_args()
Build the WP_Query arguments that define a publicly listed reference.
jpkcom_acf_references_build_reference_query_args([array<string, mixed> $args = [] ]) : array<string, mixed>
Extracted verbatim from the list shortcode, which was its only home. Three
parts carry weight and none of them may be simplified:
-
reference_featured EXISTS — the site treats a reference without that
meta row as not listed at all. The row's VALUE is irrelevant; a stored 0
is listed, a missing row is not, and get_field() cannot tell those apart.
-
The expiry OR group has THREE branches: at or after today, no row, and
the empty string. The third is the ordinary case, not an edge case — ACF
writes '' when a date is cleared rather than deleting the row, and
MariaDB casts '' to '0000-00-00', which is less than any real date. A
negation of only the first branch is not the complement of this group.
-
meta_key is set for the ordering, and its own postmeta.meta_key
condition lands in the WHERE clause. So a reference with no featured row
is excluded TWICE, independently. Removing either one changes nothing,
which is why the number of references carrying the row cannot be read off
this query and needs one of its own.
current_time( 'Y-m-d' ) and not date(): WordPress sets the PHP timezone
to UTC in wp-settings.php, so date() returns the UTC date and an expired
reference would stay visible for the length of the site's offset past local
midnight.
Parameters
-
$args
: array<string, mixed>
= []
-
Arguments merged over the base rule.
-
since
-
1.2.0
Return values
array<string, mixed>
—
jpkcom_acf_references_normalise_date()
Normalise a stored ACF date into ISO 8601, or null when it cannot be read.
jpkcom_acf_references_normalise_date(mixed $raw) : string|null
Never date( 'Y-m-d', strtotime( $x ) ): under strict_types a false from
strtotime() makes date() throw a TypeError. The round-trip check is
load-bearing rather than decorative — without it '20251340' becomes
2026-02-09 and '20259999' becomes 2033-06-07, both silently.
Wrapped in try/catch because a NUL byte in the stored value makes
createFromFormat() throw a ValueError, and MySQL longtext stores NUL.
Parameters
-
$raw
: mixed
-
-
since
-
1.2.0
Return values
string|null
—
Y-m-d, or null when the value is unusable.
jpkcom_acf_references_plain_text()
Reduce a stored value to plain text.
jpkcom_acf_references_plain_text(mixed $value) : string
Parameters
-
$value
: mixed
-
Tags
-
since
-
1.2.0
Return values
string
—
Plain text, empty when the value is not a string.
Project a post-object field into id/title pairs.
jpkcom_acf_references_normalise_related(mixed $value) : array<int, array<string, mixed>>
Never emits a WP_Post. ACF resolves post_object fields through
acf_get_posts() with post_status => 'any', so drafts and private customers
genuinely arrive here — and WP_Post implements no JsonSerializable while
exposing post_password, post_content and post_status as public properties.
A reference linked to a password-protected customer would otherwise hand a
subscriber that password in plain text.
absint() before get_post(): get_post( 0 ) returns the GLOBAL post, and
absint() maps false, '', null and 'abc' all to 0. ACF returns false for an
unassigned post_object, and both relation fields here allow null — without
this guard a reference with no customer projects itself as its own customer.
Parameters
-
$value
: mixed
-
-
since
-
1.2.0
Return values
array<int, array<string, mixed>>
—
jpkcom_acf_references_attachment_url()
Resolve an attachment field to a URL, or null.
jpkcom_acf_references_attachment_url(mixed $value) : string|null
Accepts the three shapes ACF returns depending on return_format — id, url
string, or array — and refuses anything that is not an attachment. The
post-type check matters: an id pointing at a normal post would otherwise
produce a permalink where the caller expects an image.
Parameters
-
$value
: mixed
-
-
since
-
1.2.0
Return values
string|null
—
jpkcom_acf_references_normalise_gallery()
Project a gallery field into url/alt records.
jpkcom_acf_references_normalise_gallery(mixed $value) : array<int, array<string, mixed>>
Emits only what a caller can use and nothing that identifies the attachment
post itself. The alt text is read from the attachment meta rather than from
ACF's formatted array, so this does not depend on the field's return_format.
Parameters
-
$value
: mixed
-
-
since
-
1.2.0
Return values
array<int, array<string, mixed>>
—
jpkcom_acf_references_normalise_terms()
Read a reference's terms in one taxonomy as slug/name records.
jpkcom_acf_references_normalise_terms(int $post_id, string $taxonomy) : array<int, array<string, string>>
Reads the term relationships rather than the ACF meta, for the same reason
the list shortcode does: the relationships are indexed, and the two stores
can drift (import, direct DB write, a WPML duplication that never ran ACF's
save routine). tools/check-term-sync.php is what detects that drift.
Parameters
-
$post_id
: int
-
-
$taxonomy
: string
-
-
since
-
1.2.0
Return values
array<int, array<string, string>>
—
jpkcom_acf_references_get_reference_data()
Project one reference into plain data, or [] when it cannot be read.
jpkcom_acf_references_get_reference_data(int $post_id[, bool $full = false ]) : array<string, mixed>
This function gates, because nothing else does. The existing readers are
safe only because the shortcode hands them posts a post_type/post_status
query already filtered; this one takes a bare int and inherits none of that,
and the abilities above it answer to any subscriber. It therefore refuses a
non-reference post type, any status but publish, a non-empty post_password
and a non-positive id.
"Does not exist" and "cannot be read" return the same empty array on
purpose, so the ability above cannot be used to probe which IDs exist.
$full adds the detail block. It is emitted ONLY for a reference whose
detail page would actually render for an anonymous visitor: an external
reference URL 307s every visitor away (redirects.php:59-77) and an expired
reference 307s to the archive (redirects.php:149-206). For those the
address, the gallery and the description have no public render path at all,
so publishing them here would publish what the site never showed.
Parameters
-
$post_id
: int
-
-
$full
: bool
= false
-
Whether to include the detail block.
-
since
-
1.2.0
Return values
array<string, mixed>
—
Reference data, or [] when unreadable.
jpkcom_acf_references_locate_template()
jpkcom_acf_references_locate_template(string $template_name) : string|false
Parameters
-
$template_name
: string
-
Return values
string|false
jpkcom_acf_references_locate_template()
Locate template file with override support
jpkcom_acf_references_locate_template(string $template_name) : string|false
Searches for template files in this priority order:
- Child Theme: /wp-content/themes/your-child-theme/jpkcom-acf-references/
- Parent Theme: /wp-content/themes/your-theme/jpkcom-acf-references/
- MU plugin override: /wp-content/mu-plugins/jpkcom-acf-references-overrides/templates/
- Plugin itself: /wp-content/plugins/jpkcom-acf-references/templates/ (or debug-templates/ if WP_DEBUG)
Parameters
-
$template_name
: string
-
Template filename (e.g., 'single-reference.php' or 'partials/reference/customer.php').
-
since
-
1.0.0
Return values
string|false
—
Full path to template file if found, false otherwise.
jpkcom_acf_references_template_include()
Template loader for singular and archive templates
jpkcom_acf_references_template_include(string $template) : string
Intercepts WordPress template_include filter and loads custom templates
for reference, reference_customer, and reference_location post types (single and archive views).
Parameters
-
$template
: string
-
Default template path from WordPress.
-
since
-
1.0.0
Return values
string
—
Template path to use (plugin template or default).
jpkcom_acf_references_get_template_part()
Load partial templates with full override support
jpkcom_acf_references_get_template_part(string $slug[, string $name = '' ][, array<string|int, mixed> $args = [] ]) : void
Similar to WordPress get_template_part() but uses the plugin's
template hierarchy system. Useful for loading reusable template partials.
Example usage:
jpkcom_acf_references_get_template_part('partials/reference/customer');
jpkcom_acf_references_get_template_part('partials/reference/customer', 'detailed');
jpkcom_acf_references_get_template_part('partials/reference/modal', '', ['data' => $data]);
Parameters
-
$slug
: string
-
Template slug (e.g., 'partials/reference/customer').
-
$name
: string
= ''
-
Optional. Template name/variation (e.g., 'alternative'). Default empty.
-
$args
: array<string|int, mixed>
= []
-
Optional. Array of variables to pass to the template. Default empty.
-
since
-
1.0.0
jpkcom_acfreferences_textdomain()
Load plugin text domain for translations
jpkcom_acfreferences_textdomain() : void
Loads translation files from the /languages directory.
Tags
-
since
-
1.0.0
jpkcom_acfreferences_locate_file()
Locate file with override support
jpkcom_acfreferences_locate_file(string $filename) : string|null
Searches for a file in multiple locations with priority:
- Child theme
- Parent theme
- MU plugin overrides
- Plugin includes directory
Parameters
-
$filename
: string
-
The filename to locate (without path).
-
since
-
1.0.0
Return values
string|null
—
Full path to the file if found, null otherwise.