Constants

datasync_PHP_MINIMUM_VERSION

datasync_PHP_MINIMUM_VERSION

The minimum version of PHP that the plugin will work with.

datasync_PLUGIN_PUBLIC_NAME

datasync_PLUGIN_PUBLIC_NAME

The public name to show users when referring to the plugin. Populated using Grunt values extracted from package.json

datasync_PLUGIN_PRIVATE_NAME

datasync_PLUGIN_PRIVATE_NAME

The short name of the plugin that is code compatible. Populated using Grunt values extracted from package.json

datasync_PLUGIN_TEXTDOMAIN

datasync_PLUGIN_TEXTDOMAIN

The domain name to use for the i18n translations. Populated using Grunt values extracted from package.json

datasync_PLUGIN_VERSION

datasync_PLUGIN_VERSION

The plugin's current version number. Populated using Grunt values extracted from package.json

datasync_APPLY_REDACTIONS_TO_WHOLE_WORDS

datasync_APPLY_REDACTIONS_TO_WHOLE_WORDS

The plugin's current version number. Populated using Grunt values extracted from package.json

datasync_REGEX_NOT_IN_HTML_TAG

datasync_REGEX_NOT_IN_HTML_TAG

datasync_DATABASE_REDACT_TABLENAME

datasync_DATABASE_REDACT_TABLENAME

The name of the table to create and use for storing redactions.

datasync_FULL_BLOCK

datasync_FULL_BLOCK

Redacted character

Functions

datasync_pluckAttribute()

datasync_pluckAttribute(string $key,  $arrSource) : array

Takes an array of objects and returns an array of $key from each object.

Parameters

string $key

The attribute to pluck from the array of objects

$arrSource

Returns

array —

The array of $keys from each object.

datasync_pluckColumn()

datasync_pluckColumn(string $key,  $arrSource) : array

Takes a multi dimensional array and returns an array of $key from each row.

Similar to array_column in later versions of PHP

Parameters

string $key

The column to pluck from the rows

$arrSource

Returns

array —

The array of $keys from each row.

datasync_redactResultSort()

datasync_redactResultSort( $a,  $b)

Parameters

$a
$b

datasync_getMostRestrictive()

datasync_getMostRestrictive( $a,  $b)

Parameters

$a
$b

datasync_isPositiveInteger()

datasync_isPositiveInteger( $value)

Parameters

$value

datasync_escapeRegexString()

datasync_escapeRegexString( $content)

Parameters

$content

datasync_init()

datasync_init(string $file) : object

Used to initialize the plugin. It is another layer of abstraction so that the plugin will work with early versions of PHP and warn admins of compatibility issues.

Parameters

string $file

The file's full path used to access the plugin.

Returns

object —

An instance of the plugin's controller class.

datasync_notifyWrongPhpVersion()

datasync_notifyWrongPhpVersion()

datasync_isCompatiblePhp()

datasync_isCompatiblePhp()

datasync_i18n_init()

datasync_i18n_init()

_manually_load_plugin()

_manually_load_plugin()

Manually load the plugin being tested.

ajax_getRoles()

ajax_getRoles()

Return the roles available for selection in the redaction dialog box.

Do not include adminstrator or editor because they always have access to the content.

ajax_getCurrentUserNameAndDate()

ajax_getCurrentUserNameAndDate()

Return general info about the user and today's date so that it can be added to a tooltip for the redaction.

ajax_updateRules()

ajax_updateRules()

An AJAX endpoint for updating a rule in the database.

ajax_deleteRules()

ajax_deleteRules()

An AJAX endpoint for deleting rules from the database by id.

ajax_addRules()

ajax_addRules()

AJAX function to add rules to the database.

ajax_getRules()

ajax_getRules()

AJAX function to retrieve rules from the database using limits and offsets