All Projects → sc0ttkclark → ghost-meta

sc0ttkclark / ghost-meta

Licence: GPL-2.0 license
Ghost meta allows you to store multiple meta values in a single meta record, with an API that mirrors the Metadata API. It integrates with ElasticPress to expand all ghost meta so Elasticsearch can query as normal meta too.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to ghost-meta

metadata-xml-tool
CLI tool for processing Salesforce Metadata XML files
Stars: ✭ 14 (-22.22%)
Mutual labels:  metadata
react-native-xaml
A React Native Windows library to use XAML / WinUI controls
Stars: ✭ 55 (+205.56%)
Mutual labels:  metadata
metamapper
Metamapper is a data discovery and documentation platform for improving how teams understand and interact with their data.
Stars: ✭ 60 (+233.33%)
Mutual labels:  metadata
nts
NTS Radio downloader and metadata parser
Stars: ✭ 58 (+222.22%)
Mutual labels:  metadata
Crema
Meta data server & client tools for game development
Stars: ✭ 61 (+238.89%)
Mutual labels:  metadata
Islandora-Metadata-Interest-Group
The purpose of the Islandora Metadata Interest Group (IMIG) is to investigate and provide metadata solutions that help improve metadata creation, maintenance and enhancement in Islandora.
Stars: ✭ 29 (+61.11%)
Mutual labels:  metadata
pyexiv2
Read/Write metadata(including EXIF, IPTC, XMP), comment and ICC Profile embedded in digital images.
Stars: ✭ 120 (+566.67%)
Mutual labels:  metadata
thoth
Metadata management and dissemination system for Open Access books
Stars: ✭ 25 (+38.89%)
Mutual labels:  metadata
graphql-ts
Graphql implementation in Typescript using decorator
Stars: ✭ 63 (+250%)
Mutual labels:  metadata
wheelfile
🔪🧀 API for creating and inspecting Python .whl files (wheels).
Stars: ✭ 22 (+22.22%)
Mutual labels:  metadata
ome-types
native Python dataclasses for the OME data model
Stars: ✭ 28 (+55.56%)
Mutual labels:  metadata
oge
Page metadata as a service
Stars: ✭ 22 (+22.22%)
Mutual labels:  metadata
oblivion
The Oblivion masterlist.
Stars: ✭ 16 (-11.11%)
Mutual labels:  metadata
icc
JavaScript module to parse International Color Consortium (ICC) profiles
Stars: ✭ 37 (+105.56%)
Mutual labels:  metadata
processwire-imageextra
This module allows you to add additional informations to an image (for example: title, description, link, orientation and any field you may need).
Stars: ✭ 20 (+11.11%)
Mutual labels:  metadata
dirdf
R package: dirdf - Extracts Metadata from Directory and File Names
Stars: ✭ 57 (+216.67%)
Mutual labels:  metadata
sqllineage
SQL Lineage Analysis Tool powered by Python
Stars: ✭ 348 (+1833.33%)
Mutual labels:  metadata
seomate
SEO, mate! It's important. That's why SEOMate provides the tools you need to craft all the meta tags, sitemaps and JSON-LD microdata you need - in one highly configurable, open and friendly package - with a super-light footprint.
Stars: ✭ 31 (+72.22%)
Mutual labels:  metadata
MP4Parse
C++ library for MP4 file parsing.
Stars: ✭ 55 (+205.56%)
Mutual labels:  metadata
metadata-standards-description-language
Service Design & Assurance Metadata Standards: A language to describe spreadsheets and an implementation that extracts and validates the data.
Stars: ✭ 13 (-27.78%)
Mutual labels:  metadata

Ghost Meta 1.0

Summary

This plugin provides functionality to work with a _ghost_meta custom field value and be able to function with it as if it were the same as get_post_meta() using get_ghost_meta().

It can hold a ton of extra data which you may not want to clutter up the wp_postmeta table with. It also integrates with the core WordPress Metadata API to make it easy for other plugins to interact with it.

It stores all ghost meta values into one meta key, which saves the number of meta records you may otherwise unnecessarily need to store.

Example use-case

If you have millions of posts to import into your app or site, but you don't need to reference the custom fields in filtering or searches -- this can really save you in terms of speed and efficiency.

If you're using ElasticPress, this can really help you ensure that your ghost meta values will be indexable by Elasticsearch like regular custom fields.

So what could have easily been 15 million postmeta rows for 15 custom fields on 1 million posts -- is now just 1 million postmeta rows with serialized data stored in each.

ElasticPress Integration

Ghost Meta comes with built-in integration with ElasticPress, so when it indexes your posts it will index your ghost meta just like it would regular custom fields.

Try it out, use 'ep_integrate' => true with your WP_Query calls and you'll still get to use 'meta_query' as you would expect it to work, and it'll be glorious without the mess in your database.

API

Get ghost meta

$meta_value = get_ghost_meta( $object_id, $meta_key, $single );

Add ghost meta

add_ghost_meta( $object_id, $meta_key, $meta_value, $unique );

Update ghost meta

update_ghost_meta( $object_id, $meta_key, $meta_value, $prev_value );

Delete ghost meta

delete_ghost_meta( $object_id, $meta_key, $meta_value, $delete_all );

Specifying meta type

By default, ghost meta uses post as the meta type. However, this can be changed using dot-syntax in $meta_key.

For example, you can use user.my_custom_field to interact with the my_custom_field meta key on the user meta type.

Create custom ghost meta-like functionality

Extend Ghost_Meta and define your own meta type and meta key to store the data in, the code will do the rest. It may help you further separate multiple data stores as needed.

// Load My Custom Ghost Meta
add_action( 'plugins_loaded', array( 'My_Custom_Ghost_Meta', 'get_instance' ), 11 );

class My_Custom_Ghost_Meta extends Ghost_Meta {

	/**
	 * Custom meta type for Ghost meta.
	 *
	 * @param string
	 */
	public $meta_type = 'my_custom_ghost';

	/**
	 * Custom meta key for Ghost meta storage.
	 *
	 * @param string
	 */
	public $meta_key = '_my_custom_ghost_meta';

}

Example usage: $meta_value = get_metadata( 'my_custom_ghost', $object_id, $meta_key, $single );

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].