feat(05-03): register 200x200px cropped image size for job logos

Add register_image_sizes() method to DDHH_JM_Post_Types class that
registers 'job-logo' image size (200x200px with hard crop). Hook
method to after_setup_theme action for proper WordPress timing.

This enables Elementor templates to request consistent logo sizing
via wp_get_attachment_image() using size 'job-logo'. Auto-generates
cropped version when logos uploaded via ACF field.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-14 20:29:27 +09:00
parent e21de5a9e9
commit c8b911bd6b

View File

@@ -21,6 +21,9 @@ class DDHH_JM_Post_Types {
// Hook capability mapping filter
add_filter( 'map_meta_cap', array( __CLASS__, 'map_job_offer_capabilities' ), 10, 4 );
// Hook image size registration
add_action( 'after_setup_theme', array( __CLASS__, 'register_image_sizes' ), 10 );
}
/**
@@ -91,6 +94,14 @@ class DDHH_JM_Post_Types {
register_post_type( 'job_offer', $args );
}
/**
* Register custom image sizes for job logos
*/
public static function register_image_sizes() {
// Register 200x200px cropped size for job logos
add_image_size( 'job-logo', 200, 200, true );
}
/**
* Map job_offer capabilities to enforce ownership
*