Files
Bookshelf/docs/bd-books-spec.md
bdm 38cdebd0c6 Track Bookshelf WordPress theme, plugins and specs
Initial import of the bdmurphy Bookshelf work: the bd-bookshelf theme,
bd-bookshelf-plugin, bd-bookshelfhelper and bd-simpleemail plugins, plus
the specification documents, mockups and release archives.
2026-09-28 06:24:25 -07:00

1.9 KiB

BD Books Plugin - Specification

Source: /var/www/html/wordpress/wp-content/plugins/bd-book-listing/bd-book-listing.php
Version: 1.0.0

Overview

Simple book listing plugin with admin UI and shortcodes for displaying books.

Database Schema

Table: {$wpdb->prefix}bd_books

Column Type Description
id mediumint(9) Primary key, auto-increment
title varchar(255) Book title
author varchar(255) Author name
description text Book description (HTML)
cover_image_id mediumint(9) WordPress attachment ID
cover_image_url varchar(500) External cover image URL
purchase_links text JSON array of purchase links
created_at datetime Creation timestamp
updated_at datetime Last update timestamp
[
  {
    "label": "Buy on Amazon",
    "url": "https://amazon.com/...",
    "color": "#FF9900",
    "text_color": "#000000"
  }
]

Shortcodes

[bd-book]

Display single book by ID or title

  • Attributes: book (ID or title string)

[bd-books]

Display all books in a list

Admin Interface

  • Menu: "BD Books" (top-level, manage_options)
  • Add/Edit book form with:
    • Title, Author fields
    • Rich text editor for description
    • Cover image uploader (WordPress media)
    • Dynamic purchase links (add/remove)
  • Book list with edit/delete actions

Security

  • Nonces: bd_book_save_nonce, bd_book_delete_nonce
  • Sanitization: sanitize_text_field, wp_kses_post, esc_url_raw, sanitize_hex_color

Migration to BD-BookShelfHelper

Goal: Import existing books into the BookHelper CPT + meta system

BD Books Field BookHelper Target
title Post title
author Pen name (lookup or create)
description blurb_{lang} meta
cover_image_id _thumbnail_id (featured image)
purchase_links Retailer URL metas
created_at Post date