Skip to content

Loader to handle GDPR compliant data exporting in WordPress

Notifications You must be signed in to change notification settings

Underpin-WP/underpin-exporter-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Underpin Exporter Loader

Loader That assists with adding GDPR-compliant exporters to a WordPress website.

Installation

Using Composer

composer require underpin/exporter-loader

Manually

This plugin uses a built-in autoloader, so as long as it is required before Underpin, it should work as-expected.

require_once(__DIR__ . '/underpin-exporters/exporters.php');

Setup

  1. Install Underpin. See Underpin Docs
  2. Register new exporters menus as-needed.

Example

A very basic example could look something like this.

// Register exporter
underpin()->exporters()->add( 'exporter', [
	'id'                  => 'example-exporter',                    // required
	'name'                => __( 'translate-able name', 'domain' ), // required
	'get_data_callback'   => '__return_empty_array',                // Required. See Exporter::get_data
	'get_items_callback'  => '__return_true',                       // Required. See Exporter::get_items
] );

Alternatively, you can extend Exporter and reference the extended class directly, like so:

underpin()->exporters()->add('exporter-key','Namespace\To\Class');