Skip to content

Filter Hooks

Filter hooks are used to modify something and then return the modification. These are the native filter hooks found in Devflow:

/**
 * Filters the authentication cookie.
 *
 * @file App/Shared/Helpers/auth.php
 * @param array $user User data array.
 * @param string $rememberme Whether to remember the user.
 */
Filter::getInstance()->applyFilter('cms_auth_cookie', $user, $rememberme);

cms_authenticate_user

/**
 * Filters log in details.
 *
 * @file App/Shared/Helpers/auth.php
 * @param string $login User's username or email address.
 * @param string $password User's password.
 * @param string $rememberme Whether to remember the user.
 */
Filter::getInstance()->applyFilter('cms_authenticate_user', $login, $password, $rememberme);
/**
 * Ensure the browser will continue to send the cookie until it expires.
 *
 * @file App/Shared/Helpers/auth.php
 */
$expire = Filter::getInstance()->applyFilter(
    'auth_cookie_expiration',
    Options::factory()->read('cookieexpire', 172800)
);

content_datetime

/**
 * Filters the content's datetime.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $datetime  The content's datetime.
 * @param string $contentId Content id or content object.
 */
Filter::getInstance()->applyFilter('content_datetime', $datetime, $content);

content_modified

/**
 * Filters the content date.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $modified The content's modified datetime.
 * @param string $format   Format to return datetime string.
 * @param string $contentId Content id or content object.
 */
Filter::getInstance()->applyFilter('content_modified', $modified, $format, $content);

content_body

/**
 * Filters the content date.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $body    The content's body.
 * @param string $content Content object.
 */
Filter::getInstance()->applyFilter('content_body', $body, $content);

content_contenttype_name

/**
 * Filters the content content_type name.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $contentTypeName The content's content_type name.
 * @param string $content         Content object.
 */
Filter::getInstance()->applyFilter('content_contenttype_name', $contentTypeName, $content);
/**
 * Filters the content content_type link.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $link      The content's content_type link.
 * @param string $contentId Content id.
 */
Filter::getInstance()->applyFilter('content_contenttype_link', $link, $contentId);

content_title

/**
 * Filters the content title.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $title The content's title.
 * @param string $content  Content object.
 */
Filter::getInstance()->applyFilter('content_title', $title, $content);

content_slug

/**
 * Filters the content's slug.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $slug The content's slug.
 * @param string $content   Content object.
 */
Filter::getInstance()->applyFilter('content_slug', $slug, $content);

{$contentType}_relative_url

/**
 * Filters the content's relative_url.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $relativeUrl The content's relative url.
 * @param string $content   The content object.
 */
Filter::getInstance()->applyFilter(
    "{$contentType}_relative_url",
    $relativeUrl,
    $content
);
/**
 * Filters the content's link based on its content_type.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $link The content's link.
 * @param object $content Content object.
 */
Filter::getInstance()->applyFilter("{$contentType}_link", $link, $content);

content_author_id

/**
 * Filters the content author id.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $authorId The content's author id.
 * @param object $content Content object.
 */
Filter::getInstance()->applyFilter('content_author_id', $authorId, $content);

content_author

/**
 * Filters the content author.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $author The content's author.
 * @param object $content Content object.
 */
Filter::getInstance()->applyFilter('content_author', $author, $content);

content_status

/**
 * Filters the content status.
 *
 * @file App/Shared/Helpers/content.php
 * @param string  $status The content's status.
 * @param Content $content Content object.
 */
Filter::getInstance()->applyFilter('content_status', $status, $content);

get_content_created_date

/**
 * Filters the content created date.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $theDate The content's formatted date.
 * @param bool   $format Format to use for retrieving the date the content was written.
 *                       Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt    Whether to retrieve the GMT date. Default false.
 */
Filter::getInstance()->applyFilter('get_content_created_date', $theDate, $format, $gmt);

content_created_date

/**
 * Filters the date the content was written.
 *
 * @file App/Shared/Helpers/content.php
 * @param string    $theDate The formatted date.
 * @param string    $format  Format to use for retrieving the date the content was written.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'date_format' option. Default empty.
 * @param Content  $content  Content object.
 */
Filter::getInstance()->applyFilter('content_created_date', $theDate, $format, $content);

get_content_created_time

/**
 * Filters the content created time.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $theTime The content's formatted time.
 * @param bool   $format   Format to use for retrieving the time the content was written.
 *                         Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt      Whether to retrieve the GMT time. Default false.
 */
Filter::getInstance()->applyFilter('get_content_created_time', $theTime, $format, $gmt);

content_created_time

/**
 * Filters the time the content was written.
 *
 * @file App/Shared/Helpers/content.php
 * @param string    $theTime The formatted time.
 * @param string    $format  Format to use for retrieving the time the content was written.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'time_format' option. Default empty.
 * @param object    $content Content object.
 */
Filter::getInstance()->applyFilter('content_created_time', $theTime, $format, $content);

get_content_published_date

/**
 * Filters the content published date.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $theDate The content's formatted date.
 * @param bool   $format  Format to use for retrieving the date the content was published.
 *                        Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt     Whether to retrieve the GMT date. Default false.
 */
Filter::getInstance()->applyFilter('get_content_published_date', $theDate, $format, $gmt);

content_published_date

/**
 * Filters the time the content was written.
 *
 * @file App/Shared/Helpers/content.php
 * @param string    $theDate  The formatted date.
 * @param string    $format   Format to use for retrieving the date the content was published.
 *                            Accepts 'G', 'U', or php date format value specified
 *                            in 'date_format' option. Default empty.
 * @param object    $content  Content object.
 */
Filter::getInstance()->applyFilter('content_published_date', $theDate, $format, $content);

get_content_published_time

/**
 * Filters the content published time.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $theTime The content's formatted time.
 * @param bool   $format  Format to use for retrieving the time the content was written.
 *                        Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt     Whether to retrieve the GMT time. Default false.
 */
Filter::getInstance()->applyFilter('get_content_published_time', $theTime, $format, $gmt);

content_published_time

/**
 * Filters the time the content was published.
 *
 * @file App/Shared/Helpers/content.php
 * @param string    $theTime  The formatted time.
 * @param string    $format   Format to use for retrieving the time the content was published.
 *                            Accepts 'G', 'U', or php date format value specified
 *                            in 'time_format' option. Default empty.
 * @param object    $content  Content object.
 */
Filter::getInstance()->applyFilter('content_published_time', $theTime, $format, $content);

get_content_modified_date

/**
 * Filters the content modified date.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $theDate The content's formatted date.
 * @param bool   $format  Format to use for retrieving the date the content was published.
 *                        Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt     Whether to retrieve the GMT date. Default false.
 */
Filter::getInstance()->applyFilter('get_content_modified_date', $theDate, $format, $gmt);

content_modified_date

/**
 * Filters the date the content was modified.
 *
 * @file App/Shared/Helpers/content.php
 * @param string    $theDate The formatted date.
 * @param string    $format  Format to use for retrieving the date the content was modified.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'date_format' option. Default empty.
 * @param object    $content Content object.
 */
Filter::getInstance()->applyFilter('content_modified_date', $theDate, $format, $content);

get_content_modified_time

/**
 * Filters the content modified time.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $theTime The content's formatted time.
 * @param bool   $format   Format to use for retrieving the time the content was modified.
 *                         Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt      Whether to retrieve the GMT time. Default false.
 */
Filter::getInstance()->applyFilter('get_content_modified_time', $theTime, $format, $gmt);

content_modified_time

/**
 * Filters the time the content was modified.
 *
 * @file App/Shared/Helpers/content.php
 * @param string    $theTime The formatted time.
 * @param string    $format  Format to use for retrieving the time the content was modified.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'time_format' option. Default empty.
 * @param object    $content Content object.
 */
Filter::getInstance()->applyFilter('content_modified_time', $theTime, $format, $content);

content_content_type_id

/**
 * Filters the content content_type id.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $contentTypeId The content's content_type id.
 * @param string $contentId  The content ID.
 */
Filter::getInstance()->applyFilter('content_content_type_id', $contentTypeId, $contentId);

content_content_type

/**
 * Filters the content content_type.
 *
 * @file App/Shared/Helpers/content.php
 * @param string   $contenttype  The content's content_type.
 * @param string   $contentId    The content ID.
 */
Filter::getInstance()->applyFilter('content_content_type', $contenttype, $contentId);

content_parent_id

/**
 * Filters the content parent id.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $parentId  The content's parent id.
 * @param string $contentId The content ID.
 */
Filter::getInstance()->applyFilter('content_parent_id', $parentId, $contentId);

content_parent

/**
 * Filters the content parent.
 *
 * @file App/Shared/Helpers/content.php
 * @param string $parent    The content's parent.
 * @param string $contentId The content ID.
 */
Filter::getInstance()->applyFilter('content_parent', $parent, $contentId);

content_sidebar

/**
 * Filters the content sidebar.
 *
 * @file App/Shared/Helpers/content.php
 * @param int    $sidebar   The content's sidebar option.
 * @param string $contentId The content ID.
 */
Filter::getInstance()->applyFilter('content_sidebar', (int) $sidebar, $contentId);

content_show_in_menu

/**
 * Filters the content show in menu.
 *
 * @file App/Shared/Helpers/content.php
 * @param int    $menu      The content's show in menu option.
 * @param string $contentId The content ID.
 */
Filter::getInstance()->applyFilter('content_show_in_menu', (int) $menu, $contentId);
/**
 * Filters the content show in search.
 *
 * @file App/Shared/Helpers/content.php
 * @param int    $search    The content's show in search option.
 * @param string $contentId The content ID.
 */
Filter::getInstance()->applyFilter('content_show_in_search', (int) $search, $contentId);

cms_unique_content_slug

/**
 * Filters the unique content slug before returned.
 *
 * @file App/Shared/Helpers/content.php
 * @param string    $contentSlug   Unique content slug.
 * @param string    $originalSlug  The content's original slug.
 * @param string    $originalTitle The content's original title before slugified.
 * @param string    $contentId     The content's unique id.
 * @param string    $contentType   The content's content type.
 */
Filter::getInstance()->applyFilter(
    'cms_unique_content_slug',
    $contentSlug,
    $originalSlug,
    $originalTitle,
    $contentId,
    $contentType
);

pre_content_type

/**
 * Filters a content's type before the content is created or updated.
 *
 * @param string $sanitizedContentType Content type after it has been sanitized.
 * @param string $rawContentType The content's content type.
 */
Filter::getInstance()->applyFilter(
    'pre_content_type',
    $sanitizedContentType,
    $rawContentType
);

pre_content_title

/**
 * Filters a content's title before created/updated.
 *
 * @param string $sanitizedContentTitle Content title after it has been sanitized.
 * @param string $rawContentTitle The content's title.
 */
Filter::getInstance()->applyFilter(
    'pre_content_title',
    $sanitizedContentTitle,
    $rawContentTitle
);

pre_content_slug

/**
 * Filters a content's slug before created/updated.
 *
 * @param string $sanitizedContentSlug Content slug after it has been sanitized.
 * @param string $rawContentSlug The content's slug.
 */
Filter::getInstance()->applyFilter(
    'pre_content_slug',
    $sanitizedContentSlug,
    $rawContentSlug
);

pre_content_body

/**
 * Filters a content's body before created/updated.
 *
 * @param string $rawContentSlug The content's slug.
 */
Filter::getInstance()->applyFilter(
    'pre_content_body',
    $rawContentBody
);

pre_content_parent

/**
 * Filters a content's parent before the content is created or updated.
 *
 * @param string $sanitizedContentParent Content parent after it has been sanitized.
 * @param string $rawContentParent The content's parent.
 */
Filter::getInstance()->applyFilter(
    'pre_content_parent',
    $sanitizedContentParent,
    $rawContentParent
);

pre_content_sidebar

/**
 * Filters a content's sidebar before the content is created or updated.
 *
 * @param int $sanitizedContentSidebar Content sidebar after it has been sanitized.
 * @param int $rawContentSidebar The content's sidebar.
 */
Filter::getInstance()->applyFilter(
    'pre_content_sidebar',
    $sanitizedContentSidebar,
    $rawContentSidebar
);

pre_content_show_in_menu

/**
 * Filters a content's show in menu before the content is created or updated.
 *
 * @param string $sanitizedContentShowInMenu Content show in menu after it has been sanitized.
 * @param int $rawContentShowInMenu The content's show in menu.
 */
Filter::getInstance()->applyFilter(
    'pre_content_show_in_menu',
    $sanitizedContentShowInMenu,
    $rawContentShowInMenu
);
/**
 * Filters a content's show in search before the content is created or updated.
 *
 * @param int $sanitizedContentShowInSearch Content show in search after it has been sanitized.
 * @param int $rawContentShowInSearch The content's show in search.
 */
Filter::getInstance()->applyFilter(
    'pre_content_show_in_search',
    $sanitizedContentShowInSearch,
    $rawContentShowInSearch
);
/**
 * Filters a content's featured image before the content is created or updated.
 *
 * @param string $sanitizedContentFeaturedImage Content featured image after it has been sanitized.
 * @param string $rawContentFeaturedImage The content's featured image.
 */
Filter::getInstance()->applyFilter(
    'pre_content_featured_image',
    (string) $sanitizedContentFeaturedImage,
    (string) $rawContentFeaturedImage
);

pre_content_status

/**
 * Filters a content's status before the content is created or updated.
 *
 * @param string $sanitizedContentStatus Content status after it has been sanitized.
 * @param string $rawContentStatus The content's status.
 */
Filter::getInstance()->applyFilter(
    'pre_content_status',
    (string) $sanitizedContentStatus,
    (string) $rawContentStatus
);

content_class

/**
 * Filters the list of CSS class names for the current content.
 *
 * @param array $classes An array of css class names.
 * @param array $class   An array of additional css class names.
 * @param string $contentId Content id of the current content.
 */
Filter::getInstance()->applyFilter('content_class', $classes, $class, $contentId);
/**
 * Filters the display of the permalink for the current content.
 *
 * @file App/Shared/Helpers/content.php
 * @param string         $permalink The permalink for the current content.
 * @param string|Content $content   Content object or id.
 */
Filter::getInstance()->applyFilter('the_permalink', get_permalink($content), $content);

the_meta

/**
 * Filters content meta.
 *
 * @file App/Shared/Helpers/content.php
 * @param mixed  $theMeta Content meta value.
 * @param string $key     Content meta key.
 */
Filter::getInstance()->applyFilter('the_meta', $theMeta, $key);

the_title

/**
 * Filters content meta.
 *
 * @file App/Shared/Helpers/content.php
 * @param mixed  $theTitle Content title.
 */
Filter::getInstance()->applyFilter('the_title', $theTitle);

content_type_title

/**
 * Filters the content_type title.
 *
 * @file App/Shared/Helpers/content-type.php
 * @param string    $title The content_type's title.
 * @param string    $contentTypeId The content_type id.
 */
Filter::getInstance()->applyFilter('content_type_title', $title, $contentTypeId);

content_type_slug

/**
 * Filters the content_type's slug.
 *
 * @file App/Shared/Helpers/content-type.php
 * @param string    $slug The content_type's slug.
 * @param string    $contentTypeId The content_type id.
 */
Filter::getInstance()->applyFilter('content_type_slug', $slug, $contentTypeId);

content_type_description

/**
 * Filters the content_type's description.
 *
 * @file App/Shared/Helpers/content-type.php
 * @param string    $description The content_type's description.
 * @param string    $contentTypeId The content_type id.
 */
Filter::getInstance()->applyFilter('content_type_description', $description, $contentTypeId);
/**
 * Filters the content_type's link.
 *
 * @file App/Shared/Helpers/content-type.php
 * @param string    $link The content_type's permalink.
 * @param string    $contentTypeId The content_type id.
 */
Filter::getInstance()->applyFilter('content_type_permalink', $link, $contentTypeId);

cms_unique_content_type_slug

/**
 * Filters the unique content_type slug before returned.
 *
 * @file App/Shared/Helpers/content-type.php
 * @param string    $contentTypeSlug Unique content_type slug.
 * @param string    $originalSlug    The content_type's original slug.
 * @param string    $originalTitle   The content_type's original title before slugified.
 * @param string    $contentTypeId   The content_type's unique id.
 */
Filter::getInstance()->applyFilter(
    'cms_unique_content_type_slug',
    $contentTypeSlug,
    $originalSlug,
    $originalTitle,
    $contentTypeId
);

beautified_filename

/**
 * Filters a beautified filename.
 *
 * @param string $filename     Beautified filename.
 * @param string $filenameRaw The filename prior to beautification.
 */
Filter::getInstance()->applyFilter('beautified_filename', $filename, $filenameRaw);

sanitized_filename

/**
 * Filters a sanitized filename.
 *
 * @file App/Shared/Helpers/core.php
 * @param string $filename     Sanitized filename.
 * @param string $filenameRaw The filename prior to sanitization.
 */
Filter::getInstance()->applyFilter('sanitized_filename', $filename, $filenameRaw);

random_password

/**
 * Filters the system generated password.
 *
 * @file App/Shared/Helpers/core.php
 * @param string $password          The generated password.
 * @param int    $length            The length of password to generate.
 * @param bool   $specialChars      Whether to include standard special characters.
 * @param bool   $extraSpecialChars Whether to include other special characters.
 */
Filter::getInstance()->applyFilter(
    'random_password',
    $password,
    $length,
    $specialChars,
    $extraSpecialChars
);

plugin_locale

/**
 * Filter a plugin's locale.
 *
 * @file App/Shared/Helpers/domain.php
 * @param string $locale The plugin's current locale.
 * @param string $domain Text domain. Unique identifier for retrieving translated strings.
 */
Filter::getInstance()->applyFilter('plugin_locale', $locale, $domain);

sanitize_{$arrayType}meta{$metaKey}for{$arraySubtype}

/**
 * Filters the sanitization of a specific meta key of a specific meta type and subtype.
 *
 * The dynamic portions of the hook name, `$arrayType`, `$metaKey`,
 * and `$arraySubtype`, refer to the metadata object type (content, user or site),
 * the meta key value, and the object subtype respectively.
 *
 * @file App/Shared/Helpers/hook.php
 * @param mixed  $metaValue    Meta value to sanitize.
 * @param string $metaKey      Meta key.
 * @param string $arrayType    Object type.
 * @param string $arraySubtype Object subtype.
 */
Filter::getInstance()->applyFilter(
    "sanitize_{$arrayType}_meta_{$metaKey}_for_{$arraySubtype}",
    $metaValue,
    $metaKey,
    $arrayType,
    $arraySubtype
);

sanitize_{$arrayType}meta{$metaKey}

/**
 * Filters the sanitization of a specific meta key of a specific meta type.
 *
 * The dynamic portions of the hook name, `$arrayType` and `$metaKey`,
 * refer to the metadata object type (content, user or site), the meta key
 * value respectively.
 *
 * @file App/Shared/Helpers/hook.php
 * @param mixed  $metaValue Meta value to sanitize.
 * @param string $metaKey   Meta key.
 * @param string $arrayType Object type.
 */
Filter::getInstance()->applyFilter(
    "sanitize_{$arrayType}_meta_{$metaKey}",
    $metaValue,
    $metaKey,
    $arrayType
);

tiny_mce_theme

/**
 * Filters the default theme for TinyMCE.
 * @param string $theme Theme used for TinyMCE.
 */
Filter::getInstance()->applyFilter('tiny_mce_theme', 'modern');

tiny_mce_plugins

/**
 * Filters the list of default TinyMCE plugins.
 * @param array $plugins An array of default TinyMCE plugins.
 */
Filter::getInstance()->applyFilter('tiny_mce_plugins', $plugins);

tiny_mce_css

/**
 * Filters the default stylesheets.
 *
 * @param array  $css          CSS stylesheets to include.
 * @param string $mceSelector  Unique editor identifier, e.g. 'textarea'.
 */
Filter::getInstance()->applyFilter(
    'tiny_mce_css',
    [
        '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
        site_url('static/assets/css/tinymce.css')
    ],
    $mceSelector
);
/**
 * Filters the auth logo on the login page.
 *
 * @var string $logo The url of the auth logo image.
 */
Filter::getInstance()->applyFilter('auth_logo', $authLogo);

admin_submenu_{$location}_{$menuRoute}

/**
 * Filter's the admin menu.
 *
 * The dynamic parts of this filter are `location` (where menu will appear), and
 * $_menu_route with the removed slash if present.
 *
 * @param string $menu The menu to return.
 */
Filter::getInstance()->applyFilter("admin_submenu_{$location}_{$menuRoute}", $menu);

product_datetime

/**
 * Filters the product's datetime.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $datetime  The product's datetime.
 * @param string $productId Product id or product object.
 */
Filter::getInstance()->applyFilter('product_datetime', $datetime, $product);

product_modified

/**
 * Filters the product date.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $modified The product's modified datetime.
 * @param string $format   Format to return datetime string.
 * @param string $productId Product id or product object.
 */
Filter::getInstance()->applyFilter('product_modified', $modified, $format, $product);

product_body

/**
 * Filters the product date.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $body The product's body content.
 * @param string $productId Product id or product object.
 */
Filter::getInstance()->applyFilter('product_body', $body, $productId);

product_sku

/**
 * Filters the product product_sku name.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $sku The product's sku.
 * @param string $productId  Product id.
 */
Filter::getInstance()->applyFilter('product_sku', $sku, $productId);

product_titl

/**
 * Filters the product title.
 *
 * @file App/Shared/Helpers/product.php
 * @param string   $title The product's title.
 * @param string $product  Product object.
 */
Filter::getInstance()->applyFilter('product_title', $title, $product);

product_slug

/**
 * Filters the product's slug.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $slug The product's slug.
 * @param string $product   Product object.
 */
Filter::getInstance()->applyFilter('product_slug', $slug, $product);

product_author_id

/**
 * Filters the product author id.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $authorId The product's author id.
 * @param object $product Product object.
 */
Filter::getInstance()->applyFilter('product_author_id', $authorId, $product);

product_author

/**
 * Filters the product author.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $author The product's author.
 * @param object $product Product object.
 */
Filter::getInstance()->applyFilter('product_author', $author, $product);

product_status

/**
 * Filters the product status.
 *
 * @file App/Shared/Helpers/product.php
 * @param string  $status The product's status.
 * @param Product $product Product object.
 */
Filter::getInstance()->applyFilter('product_status', $status, $product);

get_product_created_date

/**
 * Filters the product created date.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $theDate The product's formatted date.
 * @param bool   $format Format to use for retrieving the date the product was written.
 *                       Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt    Whether to retrieve the GMT date. Default false.
 */
Filter::getInstance()->applyFilter('get_product_created_date', $theDate, $format, $gmt);

product_created_date

/**
 * Filters the date the product was written.
 *
 * @file App/Shared/Helpers/product.php
 * @param string    $theDate The formatted date.
 * @param string    $format  Format to use for retrieving the date the product was written.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'date_format' option. Default empty.
 * @param Product  $product  Product object.
 */
Filter::getInstance()->applyFilter('product_created_date', $theDate, $format, $product);

get_product_created_time

/**
 * Filters the product created time.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $theTime The product's formatted time.
 * @param bool   $format   Format to use for retrieving the time the product was written.
 *                         Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt      Whether to retrieve the GMT time. Default false.
 */
Filter::getInstance()->applyFilter('get_product_created_time', $theTime, $format, $gmt);

product_created_time

/**
 * Filters the time the product was written.
 *
 * @file App/Shared/Helpers/product.php
 * @param string    $theTime The formatted time.
 * @param string    $format  Format to use for retrieving the time the product was written.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'time_format' option. Default empty.
 * @param object    $product Product object.
 */
Filter::getInstance()->applyFilter('product_created_time', $theTime, $format, $product);

get_product_published_date

/**
 * Filters the product published date.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $theDate The product's formatted date.
 * @param bool $format Format to use for retrieving the date the product was published.
 *                     Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt  Whether to retrieve the GMT date. Default false.
 */
Filter::getInstance()->applyFilter('get_product_published_date', $theDate, $format, $gmt);

product_published_date

/**
 * Filters the time the product was written.
 *
 * @file App/Shared/Helpers/product.php
 * @param string    $theDate The formatted date.
 * @param string    $format   Format to use for retrieving the date the product was published.
 *                            Accepts 'G', 'U', or php date format value specified
 *                            in 'date_format' option. Default empty.
 * @param object    $product  Product object.
 */
Filter::getInstance()->applyFilter('product_published_date', $theDate, $format, $product);

get_product_published_time

/**
 * Filters the product published time.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $theTime The product's formatted time.
 * @param bool   $format   Format to use for retrieving the time the product was written.
 *                         Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt      Whether to retrieve the GMT time. Default false.
 */
Filter::getInstance()->applyFilter('get_product_published_time', $theTime, $format, $gmt);

product_published_time

/**
 * Filters the time the product was published.
 *
 * @file App/Shared/Helpers/product.php
 * @param string    $theTime  The formatted time.
 * @param string    $format   Format to use for retrieving the time the product was published.
 *                            Accepts 'G', 'U', or php date format value specified
 *                            in 'time_format' option. Default empty.
 * @param object    $product  Product object.
 */
Filter::getInstance()->applyFilter('product_published_time', $theTime, $format, $product);

get_product_modified_date

/**
 * Filters the product modified date.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $theDate The product's formatted date.
 * @param bool   $format  Format to use for retrieving the date the product was published.
 *                        Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt     Whether to retrieve the GMT date. Default false.
 */
Filter::getInstance()->applyFilter('get_product_modified_date', $theDate, $format, $gmt);

product_modified_date

/**
 * Filters the date the product was modified.
 *
 * @file App/Shared/Helpers/product.php
 * @param string    $theDate The formatted date.
 * @param string    $format  Format to use for retrieving the date the product was modified.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'date_format' option. Default empty.
 * @param object    $product Product object.
 */
Filter::getInstance()->applyFilter('product_modified_date', $theDate, $format, $product);

get_product_modified_time

/**
 * Filters the product modified time.
 *
 * @file App/Shared/Helpers/product.php
 * @param string $theTime The product's formatted time.
 * @param bool   $format   Format to use for retrieving the time the product was modified.
 *                         Accepts 'G', 'U', or php date format. Default 'U'.
 * @param bool   $gmt      Whether to retrieve the GMT time. Default false.
 */
Filter::getInstance()->applyFilter('get_product_modified_time', $theTime, $format, $gmt);

product_modified_time

/**
 * Filters the time the product was modified.
 *
 * @file App/Shared/Helpers/product.php
 * @param string    $theTime The formatted time.
 * @param string    $format  Format to use for retrieving the time the product was modified.
 *                           Accepts 'G', 'U', or php date format value specified
 *                           in 'time_format' option. Default empty.
 * @param object    $product Product object.
 */
Filter::getInstance()->applyFilter('product_modified_time', $theTime, $format, $product);

product_show_in_menu

/**
 * Filters the product show in menu.
 *
 * @file App/Shared/Helpers/product.php
 * @param int    $menu      The product's show in menu option.
 * @param string $productId The product ID.
 */
Filter::getInstance()->applyFilter('product_show_in_menu', (int) $menu, $productId);
/**
 * Filters the product show in search.
 *
 * @file App/Shared/Helpers/product.php
 * @param int    $search    The product's show in search option.
 * @param string $productId The product ID.
 */
Filter::getInstance()->applyFilter('product_show_in_search', (int) $search, $productId);

cms_unique_product_slug

/**
 * Filters the unique product slug before returned.
 *
 * @file App/Shared/Helpers/product.php
 * @param string    $productSlug   Unique product slug.
 * @param string    $originalSlug  The product's original slug.
 * @param string    $originalTitle The product's original title before slugified.
 * @param string    $productId     The product's unique id.
 */
Filter::getInstance()->applyFilter(
    'cms_unique_product_slug',
    $productSlug,
    $originalSlug,
    $originalTitle,
    $productId,
);

pre_product_sku

/**
 * Filters a product's type before the product is created or updated.
 *
 * @param string $sanitizedProductType Product type after it has been sanitized.
 * @param string $rawProductType The product's product type.
 */
Filter::getInstance()->applyFilter(
    'pre_product_sku',
    $sanitizedProductSku,
    $rawProductSku
);

pre_product_title

/**
 * Filters a product's title before created/updated.
 *
 * @param string $sanitizedProductTitle Product title after it has been sanitized.
 * @param string $rawProductTitle The product's title.
 */
Filter::getInstance()->applyFilter(
    'pre_product_title',
    (string) $sanitizedProductTitle,
    (string) $rawProductTitle
);

pre_product_slug

/**
 * Filters a product's slug before created/updated.
 *
 * @param string $sanitizedProductSlug Product slug after it has been sanitized.
 * @param string $rawProductSlug The product's slug.
 */
Filter::getInstance()->applyFilter(
    'pre_product_slug',
    (string) $sanitizedProductSlug,
    (string) $rawProductSlug
);

pre_product_body

/**
 * Filters a product's body before created/updated.
 *
 * @param string $rawProductSlug The product's slug.
 */
Filter::getInstance()->applyFilter(
    'pre_product_body',
    $rawProductBody
);

pre_product_sku

/**
 * Filters a product's sku before the product is created or updated.
 *
 * @param string $sanitizedProductSku Product sku after it has been sanitized.
 * @param string $rawProductSku The product's sku.
 */
Filter::getInstance()->applyFilter(
    'pre_product_sku',
    $sanitizedProductSku,
    $rawProductSku
);

pre_product_price

/**
 * Filters a product's price before the product is created or updated.
 *
 * @param string $sanitizedProductPrice Product price after it has been sanitized.
 * @param string $rawProductPrice The product's price.
 */
Filter::getInstance()->applyFilter(
    'pre_product_price',
    (int) $sanitizedProductPrice,
    (int) $rawProductPrice
);

pre_product_currency

/**
 * Filters a product's currency before the product is created or updated.
 *
 * @param string $sanitizedProductCurrency Product currency after it has been sanitized.
 * @param string $rawProductCurrency The product's currency.
 */
Filter::getInstance()->applyFilter(
    'pre_product_currency',
    $sanitizedProductCurrency,
    $rawProductCurrency
);

pre_product_purchase_url

/**
 * Filters a product's purchase url before the product is created or updated.
 *
 * @param string $sanitizedProductPurchaseUrl Product purchase url after it has been sanitized.
 * @param string $rawProductPurchaseUrl The product's purchase url.
 */
Filter::getInstance()->applyFilter(
    'pre_product_purchase_url',
    $sanitizedProductPurchaseUrl,
    $rawProductPurchaseUrl
);

pre_product_show_in_menu

/**
 * Filters a product's show in menu before the product is created or updated.
 *
 * @param string $sanitizedProductShowInMenu Product show in menu after it has been sanitized.
 * @param int $rawProductShowInMenu The product's show in menu.
 */
Filter::getInstance()->applyFilter(
    'pre_product_show_in_menu',
    (int) $sanitizedProductShowInMenu,
    (int) $rawProductShowInMenu
);
/**
 * Filters a product's show in search before the product is created or updated.
 *
 * @param int $sanitizedProductShowInSearch Product show in search after it has been sanitized.
 * @param int $rawProductShowInSearch The product's show in search.
 */
Filter::getInstance()->applyFilter(
    'pre_product_show_in_search',
    (int) $sanitizedProductShowInSearch,
    (int) $rawProductShowInSearch
);
/**
 * Filters a product's featured image before the product is created or updated.
 *
 * @param string $sanitizedProductFeaturedImage Product featured image url after it has been sanitized.
 * @param string $rawProductFeaturedImage The product's featured image url.
 */
Filter::getInstance()->applyFilter(
    'pre_product_featured_image',
    (string) $sanitizedProductFeaturedImage,
    (string) $rawProductFeaturedImage
);

pre_product_status

/**
 * Filters a product's status before the product is created or updated.
 *
 * @param string $sanitizedProductStatus Product status after it has been sanitized.
 * @param string $rawProductStatus The product's status.
 */
Filter::getInstance()->applyFilter(
    'pre_product_status',
    (string) $sanitizedProductStatus,
    (string) $rawProductStatus
);

product_class

/**
 * Filters the list of CSS class names for the current product.
 *
 * @param array $classes An array of css class names.
 * @param array $class   An array of additional css class names.
 * @param string $productId Product id of the current product.
 */
Filter::getInstance()->applyFilter('product_class', $classes, $class, $productId);

the_product_meta

/**
 * Filters product meta.
 *
 * @file App/Shared/Helpers/product.php
 * @param mixed  $theMeta Product meta value.
 * @param string $key     Product meta key.
 */
Filter::getInstance()->applyFilter('the_product_meta', $theMeta, $key);

site_drop_tables

/**
 * Filters the tables to drop when the site is deleted.
 *
 * @file App/Shared/Helpers/site.php
 * @param array  $tables  Name array of the site tables to be dropped.
 * @param string $siteKey The key of the site to drop tables for.
 */
Filter::getInstance()->applyFilter('site_drop_tables', $tables, $siteKey);

pre_site_domain

/**
 * Filters a site's domain before the site is created or updated.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $sanitizedSiteDomain Site domain after it has been sanitized
 * @param string $preSiteDomain The site's domain.
 */
Filter::getInstance()->applyFilter(
    'pre_site_domain',
    (string) $sanitizedSiteDomain,
    (string) $rawSiteDomain
);

pre_site_mapping

/**
 * Filters a site's mapped domain before the site is created or updated.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $sanitizedSiteMapping Mapped domain after it has been sanitized
 * @param string $rawSiteMapping The site's mapping.
 */
Filter::getInstance()->applyFilter(
    'pre_site_mapping',
    (string) $sanitizedSiteMapping,
    (string) $rawSiteMapping
);

pre_site_name

/**
 * Filters a site's name before the site is created or updated.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $sanitizedSiteName Site name after it has been sanitized
 * @param string $rawSiteName The site's name.
 */
Filter::getInstance()->applyFilter(
    'pre_site_name',
    (string) $sanitizedSiteName,
    (string) $rawSiteName
);

pre_site_slug

/**
 * Filters a site's slug before created/updated.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $sanitizedSiteSlug Site slug after it has been sanitized
 * @param string $rawSiteSlug The site's slug.
 */
Filter::getInstance()->applyFilter(
    'pre_site_slug',
    (string) $sanitizedSiteSlug,
    (string) $rawSiteSlug
);

pre_site_path

/**
 * Filters a site's path before the site is created or updated.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $sanitizedSitePath Site path after it has been sanitized
 * @param string $rawSitePath The site's path.
 */
Filter::getInstance()->applyFilter(
    'pre_site_path',
    (string) $sanitizedSitePath,
    (string) $rawSitePath
);

pre_site_status

/**
 * Filters a site's status before the site is created or updated.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $sanitizedSiteStatus Site status after it has been sanitized
 * @param string $rawSiteStatus The site's status.
 */
Filter::getInstance()->applyFilter(
    'pre_site_status',
    (string) $sanitizedSiteStatus,
    (string) $rawSiteStatus
);

reassign_sites

/**
 * Sites will be reassigned before the user is deleted.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $userId  ID of user to be deleted.
 * @param array $params   User parameters (assign_id and role).
 */
Filter::getInstance()->applyFilter('reassign_sites', $userId, $params);

new_site_usermeta

/**
 * Filters a user's meta values and keys immediately after the user is added
 * and before any user meta is inserted.
 *
 * @file App/Shared/Helpers/site.php
 * @param array $meta {
 *     Default meta values and keys for the user.
 *
 *     @type string $username       The user's username
 *     @type string $fname          The user's first name.
 *     @type string $lname          The user's last name.
 *     @type string $email          The user's email.
 *     @type string $bio            The user's bio.
 *     @type string $role           The user's role.
 *     @type string $status         The user's status.
 *     @type int    $admin_layout   The user's layout option.
 *     @type int    $admin_sidebar  The user's sidebar option.
 *     @type int    $admin_skin     The user's skin option.
 * }
 * @param object $userdata   User object.
 */
Filter::getInstance()->applyFilter('new_site_usermeta', $meta, $userdata);

site_name

/**
 * Filters the site name.
 *
 * @file App/Shared/Helpers/site.php
 * @param string    $name The site's name.
 * @param string    $siteId The site ID.
 */
Filter::getInstance()->applyFilter('site_name', $name, $siteId);

site_domain

/**
 * Filters the site domain.
 *
 * @file App/Shared/Helpers/site.php
 * @param string    $domain The site's domain.
 * @param string    $siteId The site ID.
 */
Filter::getInstance()->applyFilter('site_domain', $domain, $siteId);

site_path

/**
 * Filters the site path.
 *
 * @file App/Shared/Helpers/site.php
 * @param string    $path The site's path.
 * @param string    $siteId The site ID.
 */
Filter::getInstance()->applyFilter('site_path', $path, $siteId);

site_owner

/**
 * Filters the site owner.
 *
 * @file App/Shared/Helpers/site.php
 * @param string    $owner The site's owner.
 * @param string    $siteId The site ID.
 */
Filter::getInstance()->applyFilter('site_owner', $owner, $siteId);

site_status

/**
 * Filters the site status.
 *
 * @file App/Shared/Helpers/site.php
 * @param string    $status The site's status.
 * @param string    $siteId The site ID.
 */
Filter::getInstance()->applyFilter('site_status', $status, $siteId);

cms_unique_site_slug

/**
 * Filters the unique site slug before returned.
 *
 * @file App/Shared/Helpers/site.php
 * @param string $siteSlug      Unique site slug.
 * @param string $originalSlug  The site's original slug.
 * @param string $originalTitle The site's original title before slugified.
 * @param string $siteId        The site's unique id.
 */
Filter::getInstance()->applyFilter(
    'cms_unique_site_slug',
    $siteSlug,
    $originalSlug,
    $originalTitle,
    $siteId
);

siteinfo_url

/**
 * Filters the URL returned by get_siteinfo().
 *
 * @file App/Shared/Helpers/site.php
 * @param mixed $output The URL returned by siteinfo().
 * @param mixed $show   Type of information requested.
 */
Filter::getInstance()->applyFilter('siteinfo_url', $output, $show);

siteinfo

/**
 * Filters the site information returned by get_siteinfo().
 *
 * @file App/Shared/Helpers/site.php
 * @param mixed $output The requested non-URL site information.
 * @param mixed $show   Type of information requested.
 */
Filter::getInstance()->applyFilter('siteinfo', $output, $show);

set_url_scheme

/**
 * Filters the resulting URL after setting the scheme.
 *
 * @file App/Shared/Helpers/url.php
 * @param string      $url         The complete URL including scheme and path.
 * @param string      $scheme      Scheme applied to the URL. One of 'http', 'https', or 'relative'.
 * @param string|null $origScheme Scheme requested for the URL. One of 'http', 'https', 'login',
 *                                 'admin', 'relative', or null.
 */
Filter::getInstance()->applyFilter('set_url_scheme', $url, $scheme, $origScheme);

site_url

/**
 * Filters the site URL.
 *
 * @file App/Shared/Helpers/url.php
 * @param string $url         The site url including scheme and path.
 * @param string $path        Route relative to the site url. Blank string if no path is specified.
 * @param string|null $scheme Scheme to give the site url context. Accepts 'http', 'https', 'login',
 *                            'admin', 'relative' or null.
 */
Filter::getInstance()->applyFilter('site_url', $url, $path, $scheme);

admin_url

/**
 * Filters the admin area url.
 *
 * @file App/Shared/Helpers/url.php
 * @param string $escUrl The complete admin area url including scheme and path after escaped.
 * @param string $url    The complete admin area url including scheme and path before escaped.
 * @param string $path   Path relative to the admin area url. Blank string if no path is specified.
 */
Filter::getInstance()->applyFilter('admin_url', $escUrl, $url, $path);

home_url

/**
 * Filters the home URL.
 *
 * @file App/Shared/Helpers/url.php
 * @param string      $escUrl The escaped home url.
 * @param string      $url     The home url before it was escaped.
 * @param string      $path    Route relative to the site url. Blank string if no path is specified.
 * @param string|null $scheme  Scheme to give the site url context. Accepts 'http', 'https',
 *                             'relative' or null.
 */
Filter::getInstance()->applyFilter('home_url', $escUrl, $url, $path, $scheme);

login_url

/**
 * Filters the login URL.
 *
 * @file App/Shared/Helpers/url.php
 * @param string $loginUrl    The login URL. Not HTML-encoded.
 * @param string $redirect     The path to redirect to on login, if supplied.
 * @param string $path         Route relative to the login url. Blank string if no path is specified.
 * @param string|null $scheme  Scheme to give the login url context. Accepts 'http', 'https',
 *                             'relative' or null.
 */
Filter::getInstance()->applyFilter('login_url', $loginUrl, $redirect, $path, $scheme);

logout_url

/**
 * Filters the logout URL.
 *
 * @file App/Shared/Helpers/url.php
 * @param string $logoutUrl   The logout URL. Not HTML-encoded.
 * @param string $redirect     The path to redirect to on logout, if supplied.
 * @param string $path         Route relative to the logout url. Blank string if no path is specified.
 * @param string|null $scheme  Scheme to give the logout url context. Accepts 'http', 'https',
 *                             'relative' or null.
 */
Filter::getInstance()->applyFilter('logout_url', $logoutUrl, $redirect, $path, $scheme);

username_exists

/**
 * Filters whether the given username exists or not.
 *
 * @function App\Shared\Helpers\username_exists()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string|false $userId   The user's user_id on success or false on failure.
 * @param string       $username Username to check.
 */
Filter::getInstance()->applyFilter('username_exists', $userId, $username);

email_exists

/**
 * Filters whether the given email exists or not.
 *
 * @function App\Shared\Helpers\email_exists()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string|false $userId The user's user_id on success, and false on failure.
 * @param string       $email  Email to check.
 */
Filter::getInstance()->applyFilter('email_exists', $userId, $email);

user_status_label

/**
 * Filters the label result.
 *
 * @function App\Shared\Helpers\user_status_label()
 * 
 * @param array $label User's label.
 */
Filter::getInstance()->applyFilter('user_status_label', $label[$status], $status);

get_user_option_{$option}

/**
 * Filters a specific user option value.
 *
 * The dynamic portion of the hook name, `$option`, refers to the user option name.
 * 
 * @function App\Shared\Helpers\get_user_option()
 *
 * @file App/Shared/Helpers/user.php
 * @param string|false  $result Value for the user's option.
 * @param string $option Name of the option being retrieved.
 * @param string $user   ID of the user whose option is being retrieved.
 */
Filter::getInstance()->applyFilter("get_user_option_{$option}", $result, $option, $user);

pre_user_login

/**
 * Filters a username after it has been sanitized.
 *
 * This filter is called before the user is created or updated.
 * 
 * @function App\Shared\Helpers\cms_insert_user()
 *
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserLogin Username after it has been sanitized.
 * @param string $rawUserLogin The user's login.
 */
Filter::getInstance()->applyFilter(
    'pre_user_login',
    (string) $sanitizedUserLogin,
    (string) $rawUserLogin
);

illegal_user_logins

/**
 * Filters the list of blacklisted usernames.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param array $usernames Array of blacklisted usernames.
 */
(array) Filter::getInstance()->applyFilter('illegal_user_logins', blacklisted_usernames());

pre_user_email

/**
 * Filters a user's email before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserEmail User email after it has been sanitized
 * @param string $rawUserEmail The user's email.
 */
Filter::getInstance()->applyFilter(
    'pre_user_email',
    (string) $sanitizedUserEmail,
    (string) $rawUserEmail
);

pre_user_fname

/**
 * Filters a user's first name before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserFname User first name after it has been sanitized.
 * @param string $rawUserFname The user's first name.
 */
Filter::getInstance()->applyFilter(
    'pre_user_fname',
    (string) $sanitizedUserFname,
    (string) $rawUserFname
);

pre_user_mname

/**
 * Filters a user's middle name before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserMname User middlename after it has been sanitized.
 * @param string $rawUserMname The user's middle name.
 */
Filter::getInstance()->applyFilter(
    'pre_user_mname',
    (string) $sanitizedUserMname,
    (string) $rawUserMname
);

pre_user_lname

/**
 * Filters a user's last name before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserLname User last name after it has been sanitized.
 * @param string $rawUserLname The user's last name.
 */
Filter::getInstance()->applyFilter(
    'pre_user_lname',
    (string) $sanitizedUserLname,
    (string) $rawUserLname
);

pre_user_bio

/**
 * Filters a user's bio before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserBio User bio after it has been sanitized.
 * @param string $rawUserBio The user's bio.
 */
Filter::getInstance()->applyFilter(
    'pre_user_bio',
    (string) $sanitizedUserBio,
    (string) $rawUserBio
);

pre_user_timezone

/**
 * Filters a user's timezone before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserTimezone User timezone after it has been sanitized.
 * @param string $rawUserTimezone The user's timezone.
 */
Filter::getInstance()->applyFilter(
    'pre_user_timezone',
    (string) $sanitizedUserTimezone,
    (string) $rawUserTimezone
);

pre_user_date_format

/**
 * Filters a user's date format before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserDateFormat User date format after it has been sanitized.
 * @param string $rawUserDateFormat The user's date format.
 */
Filter::getInstance()->applyFilter(
    'pre_user_date_format',
    (string) $sanitizedUserDateFormat,
    (string) $rawUserDateFormat
);

pre_user_time_format

/**
 * Filters a user's time format before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserTimeFormat User time format after it has been sanitized.
 * @param string $rawUserTimeFormat The user's time format.
 */
Filter::getInstance()->applyFilter(
    'pre_user_time_format',
    (string) $sanitizedUserTimeFormat,
    (string) $rawUserTimeFormat
);

pre_user_locale

/**
 * Filters a user's locale before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserLocale User locale after it has been sanitized.
 * @param string $rawUserLocale       The user's locale.
 */
Filter::getInstance()->applyFilter(
    'pre_user_locale',
    (string) $sanitizedUserLocale,
    (string) $rawUserLocale
);

pre_user_status

/**
 * Filters a user's status before the user is created or updated.
 *
 * @function App\Shared\Helpers\cms_insert_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @param string $sanitizedUserStatus User status after it has been sanitized.
 * @param string $rawUserStatus The user's status.
 */
Filter::getInstance()->applyFilter(
    'pre_user_status',
    (string) $sanitizedUserStatus,
    (string) $rawUserStatus
);

insert_usermeta

/**
 * Filters a user's meta values and keys immediately after the user is created or updated
 * and before any user meta is inserted or updated.
 * 
 * @function App\Shared\Helpers\cms_insert_user()
 *
 * @file App/Shared/Helpers/user.php
 * @param array $meta {
 *     Default meta values and keys for the user.
 *
 *     @type string $username       The user's username
 *     @type string $fname          The user's first name.
 *     @type string $lname          The user's last name.
 *     @type string $email          The user's email.
 *     @type string $timezone       The user's timezone.
 *     @type string $dateFormat    The user's date format.
 *     @type string $timeFormat    The user's time format.
 *     @type string $bio            The user's bio.
 *     @type string $timezone       The user's timezone.
 *     @type string $dateFormat    The user's date format.
 *     @type string $timeFormat    The user's time_format.
 *     @type string $locale         The user's locale.
 *     @type string $status         The user's status.
 *     @type int    $admin_layout   The user's layout option.
 *     @type int    $admin_sidebar  The user's sidebar option.
 *     @type int    $admin_skin     The user's skin option.
 * }
 * @param object $user  User object.
 * @param bool $update  Whether the user is being updated rather than created.
 */
Filter::getInstance()->applyFilter('insert_usermeta', $meta, $user, $update);

send_password_change_email

/**
 * Filters whether to send the password change email.
 *
 * @function App\Shared\Helpers\cms_update_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @see cms_insert_user() For `$user` and `$userdata` fields.
 *
 * @param bool  $send     Whether to send the email.
 * @param array $user     The original user array before changes.
 * @param array $userdata The updated user array.
 *
 */
Filter::getInstance()->applyFilter(
    'send_password_change_email',
    true,
    $user,
    $userdata
);

send_email_change_email

/**
 * Filters whether to send the email change email.
 *
 * @function App\Shared\Helpers\cms_update_user()
 * 
 * @file App/Shared/Helpers/user.php
 * @see cms_insert_user() For `$user` and `$userdata` fields.
 *
 * @param bool  $send     Whether to send the email.
 * @param array $user     The original user array before changes.
 * @param array $userdata The updated user array.
 *
 */
Filter::getInstance()->applyFilter(
    'send_email_change_email',
    true,
    $user,
    $userdata
);

reassign_posts

/**
 * Filter hook is triggered when assign_id is greater than zero.
 *
 * Posts will be reassigned before the user is deleted.
 * 
 * @function App\Shared\Helpers\cms_delete_user()
 *
 * @file App/Shared/Helpers/user.php
 * @param string $userId   ID of user to be deleted.
 * @param string $assignId ID of user to reassign posts to.
 *                         Default: NULL.
 */
Filter::getInstance()->applyFilter('reassign_posts', $userId, $assignId);

get_{$metaType}_metadata

/**
 * Filters whether to retrieve metadata of a specific type.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * array type (content or user). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method read()
 *
 * @param null|string   $value      The value getMetaData() should return - a single metadata value.
 * @param string        $metaTypeId Array ID.
 * @param string        $metaKey    Optional. Meta key.
 * @param bool          $single     Whether to return only the first value of the specified $metaKey.
 */
Filter::getInstance()->applyFilter("get_{$metaType}_metadata", null, $metaTypeId, $metaKey, $single);

update_{$metaType}_metadata

/**
 * Filters whether to update metadata of a specific type.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * array type (content or user). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method update()
 *
 * @param null|bool $check       Whether to allow updating metadata for the given type.
 * @param string    $metaTypeId  Array ID.
 * @param string    $metaKey     Meta key.
 * @param mixed     $metaValue   Meta value. Must be serializable if non-scalar.
 * @param mixed     $prevValue   Optional. If specified, only update existing
 *                               metadata entries with the specified value.
 *                               Otherwise, update all entries.
 */
Filter::getInstance()->applyFilter(
    "update_{$metaType}_metadata",
    null,
    $metaTypeId,
    $metaKey,
    $metaValue,
    $prevValue
);

add_{$metaType}_metadata

/**
 * Filters whether to add metadata of a specific type.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * array type (content or user). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method create()
 *
 * @param null|bool $check     Whether to allow adding metadata for the given type.
 * @param string    $metaTypeId   Array ID.
 * @param string    $metaKey   Meta key.
 * @param mixed     $metaValue Meta value. Must be serializable if non-scalar.
 * @param bool      $unique    Whether the specified meta key should be unique
 *                             for the array. Optional. Default false.
 */
Filter::getInstance()->applyFilter(
    "add_{$metaType}_metadata",
    null,
    $metaTypeId,
    $metaKey,
    $metaValue,
    $unique
);

delete_{$metaType}_metadata

/**
 * Filters whether to delete metadata of a specific type.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * array type (content or user). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method delete()
 *
 * @param null|bool $delete     Whether to allow metadata deletion of the given type.
 * @param string    $metaTypeId  Array ID.
 * @param string    $metaKey   Meta key.
 * @param mixed     $metaValue Meta value. Must be serializable if non-scalar.
 * @param bool      $deleteAll Whether to delete the matching metadata entries
 *                              for all arrays, ignoring the specified $metaTypeId.
 *                              Default false.
 */
Filter::getInstance()->applyFilter(
    "delete_{$metaType}_metadata",
    null,
    $metaTypeId,
    $metaKey,
    $metaValue,
    $deleteAll
);

get_{$metaType}_metadata_by_mid

/**
 * Filters whether to retrieve metadata of a specific type by meta ID.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * object type (content, user, or site). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method readByMid()
 *
 * @param mixed  $value   The value get_{$metaType}_metadata_by_mid() should return.
 * @param string $metaId  Meta ID.
 */
Filter::getInstance()->applyFilter("get_{$metaType}_metadata_by_mid", null, $metaId);

update_{$metaType}_metadata_by_mid

/**
 * Filters whether to update metadata of a specific type by meta ID.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * object type (content, user, or site). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method updateByMid()
 *
 * @param null|bool   $check      Whether to allow updating metadata for the given type.
 * @param string      $metaId    Meta ID.
 * @param mixed       $metaValue Meta value. Must be serializable if non-scalar.
 * @param string|bool $metaKey   Meta key, if provided.
 */
Filter::getInstance()->applyFilter(
    "update_{$metaType}_metadata_by_mid",
    null,
    $metaId,
    $metaValue,
    $metaKey
);

delete_{$metaType}_metadata_by_mid

/**
 * Filters whether to delete metadata of a specific type by meta ID.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * object type (content, user, or site). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method deleteByMid()
 *
 * @param null|bool $delete  Whether to allow metadata deletion of the given type.
 * @param string    $metaId  Meta ID.
 */
Filter::getInstance()->applyFilter("delete_{$metaType}_metadata_by_mid", null, $metaId);

update_{$metaType}_metadata_cache

/**
 * Filters whether to update metadata cache of a specific type.
 *
 * The dynamic portion of the hook, `$metaType`, refers to the meta
 * object type (content or user). Returning a non-null value
 * will effectively short-circuit the function.
 * 
 * @class App\Shared\Services\MetaData
 * @method updateMetaDataCache()
 *
 * @param mixed $check    Whether to allow updating the meta cache of the given type.
 * @param array $metaTypeIds Array of object IDs to update the meta cache for.
 */
Filter::getInstance()->applyFilter("update_{$metaType}_metadata_cache", null, $metaTypeIds);

atts_{$parsecode}

/**
 * Filters a parsecode's default attributes.
 *
 * If the third parameter of the $this->atts() method is present then this filter is available.
 * The third parameter, $parsecode, is the name of the parsecode.
 * 
 * @class App\Shared\Services\Parsecode
 * @method atts()
 *
 * @param array  $out       The output array of parsecode attributes.
 * @param array  $pairs     The supported attributes and their defaults.
 * @param array  $atts      The user defined parsecode attributes.
 * @param string $parsecode The parsecode name.
 */
Filter::getInstance()->applyFilter("atts_{$parsecode}", $out, $pairs, $atts, $parsecode);

sanitize_items

/**
 * Filters sanitized items.
 * 
 * @class App\Shared\Services\Sanitizer
 * @method Sanitizer::items()
 *
 * @param string $items  Sanitized items.
 * @param string $rawItems The items prior to sanitization.
 * @param string $context The context for which the string is being sanitized.
 */
Filter::getInstance()->applyFilter('sanitize_items', $items, $rawItems, $context);

sanitize_item

/**
 * Filters a sanitized item.
 * 
 * @class App\Shared\Services\Sanitizer
 * @method Sanitizer::item()
 *
 * @param string $output  Sanitized item.
 * @param string $rawItem The item prior to sanitization.
 * @param string $context The context for which the string is being sanitized.
 */
Filter::getInstance()->applyFilter('sanitize_item', $output, $rawItem, $context);

sanitize_key

/**
 * Filters a sanitized key string.
 * 
 * @class App\Shared\Services\Sanitizer
 * @method Sanitizer::key()
 *
 * @param string $key     Sanitized key.
 * @param string $rawKey The key prior to sanitization.
 */
Filter::getInstance()->applyFilter('sanitize_key', $key, $rawKey);

sanitize_user

/**
 * Filters a sanitized username string.
 * 
 * @class App\Shared\Services\Sanitizer
 * @method Sanitizer::username()
 *
 * @param string $username    Sanitized username.
 * @param string $rawUsername The username prior to sanitization.
 * @param bool   $strict      Whether to limit the sanitization to specific characters. Default false.
 */
Filter::getInstance()->applyFilter('sanitize_user', $username, $rawUsername, $strict);

pre_option_{$optionKey}

/**
 * Filter the value of an existing option before it is retrieved.
 * 
 * @class App\Infrastructure\Services\Options
 * @method read()
 *
 * The dynamic portion of the hook name, `$optionKey`, refers to the option_key name.
 *
 * Passing a truthy value to the filter will short-circuit retrieving
 * the option value, returning the passed value instead.
 *
 * @param bool|mixed pre_option_{$optionKey} Value to return instead of the option value.
 *                                           Default false to skip it.
 * @param string $optionKey Meta key name.
 */
Filter::getInstance()->applyFilter("pre_option_{$optionKey}", false);

get_option_{$optionKey}

/**
 * Filter the value of an existing option.
 * 
 * @class App\Infrastructure\Services\Options
 * @method read()
 *
 * The dynamic portion of the hook name, `$optionKey`, refers to the option name.
 *
 * @param mixed $value Value of the option. If stored serialized, it will be
 *                     unserialized prior to being returned.
 * @param string $optionKey Option name.
 */
Filter::getInstance()->applyFilter(
    "get_option_{$optionKey}",
    maybe_unserialize($value),
    $optionKey
);