wpDiscuz 7 API Documentation

  1. Home
  2. Docs
  3. wpDiscuz 7 API Documentation
  4. Actions
  5. wpdiscuz_before_save_commentmeta
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

wpdiscuz_before_save_commentmeta

This hook can be used for doing some action before saving the values of the fields.

Changelog

since 7.0.0 version

Parameters

1. $comment (type: WP_Comment object) – the object of the comment
2. $fieldsBeforeSave (type: array) – the fields’ values before saving

Usage

add_action("wpdiscuz_before_save_commentmeta", function ($comment, $fieldsBeforeSave) {
    if (!empty($fieldsBeforeSave["custom_field_5d2300b6413ef"])) {
        $value = $fieldsBeforeSave["custom_field_5d2300b6413ef"];
    }
}, 10, 2);

Was this article helpful to you? Yes No