Add core data structures for Buildings and Rooms (v0.1.0)
All checks were successful
Create Release Package / build-release (push) Successful in 1m6s
All checks were successful
Create Release Package / build-release (push) Successful in 1m6s
Phase 1 implementation includes: - Custom Post Type: Buildings with address, contact, and details meta - Custom Post Type: Rooms with building relationship and gallery - Custom Taxonomy: Room Types (hierarchical) - Custom Taxonomy: Amenities (non-hierarchical with icons) - Admin columns, filters, and status badges - Gallery meta box with media library integration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
51
CLAUDE.md
51
CLAUDE.md
@@ -215,8 +215,14 @@ wp-bnb/
|
||||
│ └── release.yml # CI/CD release pipeline
|
||||
├── src/ # PHP source code (PSR-4: Magdev\WpBnb)
|
||||
│ ├── Plugin.php # Main plugin singleton
|
||||
│ └── License/
|
||||
│ └── Manager.php # License management
|
||||
│ ├── License/
|
||||
│ │ └── Manager.php # License management
|
||||
│ ├── PostTypes/ # Custom post types
|
||||
│ │ ├── Building.php # Building post type
|
||||
│ │ └── Room.php # Room post type
|
||||
│ └── Taxonomies/ # Custom taxonomies
|
||||
│ ├── Amenity.php # Amenity taxonomy (tags)
|
||||
│ └── RoomType.php # Room type taxonomy (categories)
|
||||
├── lib/ # Git submodules
|
||||
│ └── wc-licensed-product-client/ # License client library
|
||||
├── vendor/ # Composer dependencies (auto-generated)
|
||||
@@ -303,3 +309,44 @@ Admin features always work; frontend requires valid license.
|
||||
- Settings page uses tabs with nonce-protected form submission
|
||||
- AJAX handlers require `check_ajax_referer()` and `current_user_can()` checks
|
||||
- CI/CD workflow excludes `lib/` directory but includes `vendor/` in releases
|
||||
|
||||
### 2026-01-31 - Version 0.1.0 (Core Data Structures)
|
||||
|
||||
**Completed:**
|
||||
|
||||
- Created Custom Post Type: Buildings (`bnb_building`)
|
||||
- Address meta box with full address fields
|
||||
- Contact meta box with phone, email, website
|
||||
- Details meta box with rooms count, floors, year built, check-in/out times
|
||||
- Custom admin columns (city, country, room count)
|
||||
- Sortable columns and country dropdown
|
||||
- Created Custom Post Type: Rooms (`bnb_room`)
|
||||
- Building relationship via meta field
|
||||
- Room details: number, floor, size, capacity, beds, bathrooms
|
||||
- Room status with color-coded badges
|
||||
- Image gallery with media library and drag-and-drop sorting
|
||||
- Building filter dropdown in admin list
|
||||
- Custom admin columns with building link
|
||||
- Created Custom Taxonomy: Room Types (`bnb_room_type`)
|
||||
- Hierarchical structure with parent/child support
|
||||
- Base capacity and sort order meta fields
|
||||
- Default terms with subtypes (Standard > Single/Double/Twin, etc.)
|
||||
- Created Custom Taxonomy: Amenities (`bnb_amenity`)
|
||||
- Non-hierarchical (tag-like) structure
|
||||
- Dashicon selection for visual display
|
||||
- Icon column in taxonomy list
|
||||
- Default amenities: WiFi, Parking, Breakfast, etc.
|
||||
- Updated Plugin class to register post types and taxonomies
|
||||
- Enhanced admin assets for post type edit screens
|
||||
- Added gallery JavaScript with media library integration
|
||||
- Updated activation hook to register CPTs before flushing rewrites
|
||||
- Updated version to 0.1.0
|
||||
|
||||
**Learnings:**
|
||||
|
||||
- Taxonomies must be registered before post types that use them
|
||||
- `show_in_menu => 'wp-bnb'` adds post types under the plugin's main menu
|
||||
- Room-building relationship uses post meta, not hierarchical post types
|
||||
- Gallery implementation uses `wp.media` frame with multiple selection
|
||||
- Admin assets need conditional loading based on both hook suffix and post type
|
||||
- Status badges use inline styles for color coding (avoiding extra CSS complexity)
|
||||
|
||||
Reference in New Issue
Block a user