Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate data liberation via hook #126

Open
wants to merge 1 commit into
base: docs/extend
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/plugin/class-subject-repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ class Subject_Repo {

public static function init( string $post_type ): void {
static::$post_type = $post_type;

add_action( 'do_data_liberation', array( __CLASS__, 'simulate_data_liberation' ) );
}

public static function simulate_data_liberation( $subject_type ): void {
foreach ( self::loop( $subject_type ) as $subject ) {
do_action(
'data_liberated_' . $subject_type,
$subject,
'simulate'
);
}
}

/**
Expand Down
Loading