mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 10:25:45 +03:00
Plugin: Add a system for logging events related to pledges and contributors (#54)
Uses action hooks to capture relevant events as log entries on a per-pledge basis. This provides a running history of a pledge and can be used as an audit log if questions arise about changes to a pledge or there are weird bugs. Fixes #39
This commit is contained in:
parent
6209060eb2
commit
5c5ae83287
6 changed files with 424 additions and 18 deletions
|
@ -28,9 +28,11 @@ add_action( 'added_post_meta', __NAMESPACE__ . '\update_generated_meta', 10, 4
|
|||
/**
|
||||
* Define pledge meta fields and their properties.
|
||||
*
|
||||
* @param string $context Optional. The part of the config to return. 'user_input', 'generated', or 'all'.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_pledge_meta_config( $context = '' ) {
|
||||
function get_pledge_meta_config( $context = 'all' ) {
|
||||
$user_input = array(
|
||||
'org-description' => array(
|
||||
'single' => true,
|
||||
|
@ -283,6 +285,7 @@ function update_generated_meta( $meta_id, $object_id, $meta_key, $_meta_value )
|
|||
case META_PREFIX . 'org-name':
|
||||
if ( 'updated_postmeta' === current_action() ) {
|
||||
wp_update_post( array(
|
||||
'ID' => $object_id,
|
||||
'post_title' => $_meta_value,
|
||||
) );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue