JPKCom ACF References

media.php

Media and image size registration functions

Registers custom image sizes for reference posts, companies, and locations:

  • jpkcom-acf-reference-16x9: 576x324px (16:9 aspect ratio) for reference images
  • jpkcom-acf-reference-logo: 512x512px (square) for company logos
  • jpkcom-acf-reference-header: 992x558px (16:9 aspect ratio) for header images
  • jpkcom-acf-reference-card-overlay: 800x600px (4:3 aspect ratio) for image overlay cards
  • jpkcom-acf-reference-gallery-thumb: 200x200px (square) for gallery thumbnails
  • jpkcom-acf-reference-gallery-modal: 1400px width (proportional) for modal lightbox
Tags
since
1.0.0

Table of Contents

Functions

jpkcom_acf_references_media_size()  : void
Register custom image sizes for reference posts
jpkcom_acf_references_image_sizes_to_selector()  : array<string|int, string>
Add custom image sizes to media library size selector

Functions

jpkcom_acf_references_media_size()

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)
Tags
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.

Tags
since
1.0.0
Return values
array<string|int, string>

Modified array with custom sizes added.


        
On this page

Search results