WordLift Theme Development

Who should read this

This document is intended for Web Developers that would like to extend their themes to support WordLift’s data model and features.

In the first paragraph we describe the WordLift data model, i.e. how additional properties for entities are stored in WordPress.

WordLift Data Model

  1. WordLift Entities are custom posts;
  2. Entity properties are managed as standard posts’ metadata;
  3. Entity types are managed through a custom taxonomy;
  4. When a property references another entity:
    • Its value is the entity ID (if the entity is inside the same WordPress site),
    • Its value is the entity URI (if the entity is outside the WordPress site).
  5. The 4Ws classification, i.e. the relationships among posts and entities, are stored in a custom table called wl_relation_instances.
  6. WordLift’s Topics are a custom taxonomy

Content Filtering - Available APIs

  1. Standard WordPress methods (such as get_posts and get_post_meta) can be used on entities;
  2. get_post_terms can be used to extract topics from posts see the example below;
wp_get_post_terms( <post_id>, Wordlift_Topic_Taxonomy_Service::TAXONOMY_NAME, <args> )
  1. WordLift’s Properties API can be used to read/write entity properties using schema.org property names. See here;
  2. WordLift’s Relations API can be used to access 4W relationships. See here.