[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog
  • #
  • &
  • A
  • B
  • C
  • D
  • E
  • F
  • G
  • H
  • I
  • J
  • L
  • M
  • N
  • O
  • P
  • Q
  • R
  • S
  • T
  • U
  • V
  • W
  • [

Requirements for Post Meta plugins

There’s a new post on Make WordPress Core announcing a meeting to gather the requirements for a new plugin that will provide APIs for developers to define and manage post meta data.  I’ve tried to reply to this post three times. Each time my response seems to have disappeared into the bit bucket. So here we go again…

Background

  • WordPress provides some basic APIs that allow programmers to manage meta data related to a post.
  • There are a number of plugins that provide generic solutions enabling developers to provide “fields” of specific “types” which can be associated with any WordPress post type.
  • Other plugins use meta data to store information that is required in one part of the system but not necessarily displayed to end users.
  • There are also plugins that allow manipulation of fields through the UI.
  • But there is not a common solution.

Functional Requirements

In my opinion the functional requirements for a core post meta plugin are:
  • Provide APIs to register fields and associate them to post types
  • Provide APIs to display and save post meta data
  • Provide APIs for custom column display, filtering and sorting
  • Deliver an extensible architecture – allowing any number of different field types to be created
  • Provide the ability to extend or alter post types and fields created by other plugins
  • Allow fields to be displayed in multiple contexts e.g. as input fields on forms (admin and front-end), as read only output on a website, in the contents of an email, etcetera
  • Support fields associated with post types including attachments, users, taxonomies and possibly even comments
  • Support grouping of fields, using multiple meta boxes, if required
  • Support repeatable fields

oik-plugins approach

The oik base plugin provides
  • Simple generic APIs for registering fields and associating them to post types.
  • Generic APIs to display and save post meta data ( admin )
The oik-fields plugin, dependent upon oik, provides
  • APIs and shortcodes to display fields in the front-end
  • APIs and shortcodes to display and process front-end forms
  • A basic set of field “types”
The oik-types plugin, dependent upon oik-fields, provides a UI to allow an admin user to
  • define new post types
  • alter the definition of existing post types
  • define fields
  • define taxonomies
  • define field and taxonomy relationships to post types
Other plugins, e.g. oik user, implement the oik-fields APIs and hooks to extend the field types; oik-user provides the “userref” field type.

Non functional requirements

Include, but not limited to.
  • Easy to use, generic APIs, with well defined, sensible defaults
  • Highly performant:
    • do not waste time doing work that is not required. e.g. Leave l10n until the translated text is actually required.
    • minimum database access
  • Secure: nonce checking, validation and sanitization
  • Any user defined definitions to be exportable and importable
  • Support WordPress Multisite
  • Use serialized data when necessary

Further reading

APIs

  • bw_register_field() – Register a field named $field_name of type $field_type with title $field_title and additional values $args
  • bw_register_field_for_object_type() – Register a field named $field_name for object type $object_type
  • bw_effort_box() – Create fields in the meta box to accept data for the fields
  • bw_effort_save_postdata() – Saves the custom fields for this post when called for the ‘save_post’ action
  • bw_form_field() – Display a field in a form for the user to enter/choose a value
  • bw_theme_field() – Theme a custom field

Shortcodes

  • [bw_fields]
  • [bw_new]
  • [bw_table]
  • [bw_pages]

Plugins

  • oik-fields – custom post type field APIs
  • oik-types
  • oik user
  • oik-mshot
  • oik-rating

Original post and comments

http://make.wordpress.org/core/2013/11/25/post-meta-team-introductory-meeting/ Google docs: Post Meta Project Overiew

Published: November 25, 2013 | Last updated: December 4, 2020

Filed Under: News, oik, oik-fields, oik-types, plugins Tagged With: fields, metadata, post meta

Information

Component:

Recent plugin updates

oik-weight-zone-shipping v0.2.6 oik-weight-zone-shipping v0.2.6 has been tested with WooCommerce 7.4.0. ...
sb-chart-block v1.2.3 SB Chart Block v1.2.3 contains a fix for an Uncaught Error: Call to undefined function bw_trace2()  ...
SB Chart Block v1.2.1 Update to SB Chart Block v1.2.0 for custom colors, font size options and multiple y-axis charts.  ...
oik-css v2.1.0 Update to oik-css v2.1.0 for the ability to style CSS and GeSHi output in documentation. ...
oik-types v2.3.0 Update to oik-types v2.3.0 for improved control over sort order on archives ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: oikplug@oik-plugins.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.2. PHP: 7.4.33. Memory limit: 768M