// functions.php — Gallery CPT registration
register_post_type( 'ai_image', [
'labels' => [ 'name' => 'AI Images' ],
'public' => true,
'has_archive' => true,
'supports' => [ 'title', 'thumbnail', 'custom-fields' ],
'rewrite' => [ 'slug' => 'gallery' ],
] );
// Tier access filter
add_filter( 'the_content', 'cw_tier_gate_content' );
function cw_tier_gate_content( $content ) {
if ( ! is_singular( 'ai_image' ) ) return $content;
$tier = get_post_meta( get_the_ID(), '_access_tier', true );
if ( $tier === 'vip' && ! cw_user_has_plan( 'vip' ) ) {
return cw_locked_placeholder( 'VIP' );
}
return $content;
}
// Plan IDs defined in ProfilePress > Membership Plans
// Free: plan_id = 1
// Standard: plan_id = 2 ($12/mo, Stripe)
// VIP: plan_id = 3 ($29/mo, Stripe)
// Helper used throughout the theme
function cw_user_has_plan( $slug ) {
if ( ! is_user_logged_in() ) return false;
$map = [ 'free' => 1, 'standard' => 2, 'vip' => 3 ];
return ppress_is_user_a_member_of_plan(
get_current_user_id(), $map[ $slug ] ?? 1
);
}
| Hash | Message | Date | Branch | Status |
|---|---|---|---|---|
| a7f3c12 | ProfilePress plan hooks, tier conditional filters | Jun 15 | feature/memberships | Merged |
| e2b88d0 | Login/registration template overrides | Jun 14 | feature/auth-templates | Merged |
| 9c1fa4e | Gallery CPT, rewrite rules, archive template | Jun 13 | feature/gallery-cpt | Merged |
| 3d72af1 | Stripe webhook handler + plan activation hook | Jun 12 | feature/memberships | Merged |
| b84ec09 | Child theme scaffold, enqueue setup | Jun 9 | main | Merged |
| f19a230 | Lazy load image grid (Intersection Observer) | Jun 16 | feature/gallery-perf | Staging |
| c55b8f7 | Watermark overlay: free-tier image filter | Jun 16 | feature/gating | Staging |
| d2209aa | Vimeo embed helper + video CPT single template | Jun 17 | feature/video | In review |