JPKCOM_ACFREFERENCES_BASENAME
public
mixed
JPKCOM_ACFREFERENCES_BASENAME
= \plugin_basename(__FILE__)
public
mixed
JPKCOM_ACFREFERENCES_BASENAME
= \plugin_basename(__FILE__)
public
mixed
JPKCOM_ACFREFERENCES_PLUGIN_PATH
= \plugin_dir_path(__FILE__)
public
mixed
JPKCOM_ACFREFERENCES_PLUGIN_URL
= \plugin_dir_url(__FILE__)
public
mixed
JPKCOM_ACFREFERENCES_VERSION
= '1.0.4'
Render disable archive checkbox field
jpkcom_acf_references_disable_archive_field() : void
Render archive redirect URL field
jpkcom_acf_references_redirect_url_field() : void
Render Shortcodes admin page
jpkcom_acf_references_shortcodes_page() : void
Render Options admin page
jpkcom_acf_references_options_page() : void
Output Bootstrap 5 breadcrumb navigation
jpkcom_acf_references_breadcrumb() : void
Generates breadcrumb navigation for:
Includes proper ARIA labels and semantic HTML5 markup.
Outputs HTML directly.
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:
Optional. Post type for field group query. Default empty (uses current post type).
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.
Field key (e.g., 'field_abc123') or field name (e.g., 'job_title').
Field label or formatted fallback string.
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:
Field name (e.g., 'job_title') or field key (e.g., 'field_abc123').
Optional. Post type for context-specific field group search. Default empty.
Field label or formatted fallback string.
Convert timestamp to human-readable relative date string
jpkcom_human_readable_relative_date(int $timestamp) : string
Converts Unix timestamps into relative date strings like:
All strings are translatable via the 'jpkcom-acf-references' text domain.
Unix timestamp to convert.
Translated relative date string.
Register custom image sizes for reference posts
jpkcom_acf_references_media_size() : void
Registers six image sizes:
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.
Existing image size options.
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:
Optional. Total number of pages. Default empty (auto-detect from query).
Optional. Number of page links to show on either side of current page. Default 2.
Outputs HTML directly.
jpkcom_acf_references_locate_template(string $template_name) : string|false
Locate template file with override support
jpkcom_acf_references_locate_template(string $template_name) : string|false
Searches for template files in this priority order:
Template filename (e.g., 'single-reference.php' or 'partials/reference/customer.php').
Full path to template file if found, false otherwise.
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).
Default template path from WordPress.
Template path to use (plugin template or default).
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]);
Template slug (e.g., 'partials/reference/customer').
Optional. Template name/variation (e.g., 'alternative'). Default empty.
Optional. Array of variables to pass to the template. Default empty.
Load plugin text domain for translations
jpkcom_acfreferences_textdomain() : void
Loads translation files from the /languages directory.
Locate file with override support
jpkcom_acfreferences_locate_file(string $filename) : string|null
Searches for a file in multiple locations with priority:
The filename to locate (without path).
Full path to the file if found, null otherwise.