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:
@@ -21,6 +21,9 @@ class DDHH_JM_Post_Types {
|
|||||||
|
|
||||||
// Hook capability mapping filter
|
// Hook capability mapping filter
|
||||||
add_filter( 'map_meta_cap', array( __CLASS__, 'map_job_offer_capabilities' ), 10, 4 );
|
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_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
|
* Map job_offer capabilities to enforce ownership
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user