Skip to content

Commit

Permalink
act only on created and edited relese (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Delwing authored Mar 29, 2023
1 parent 1dcd265 commit 11e36f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mudlet-release.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class MudletRelease
const RELEASE_CATEGORY = 173;
const USER_ID = 2; //Vadi

const ACTIONS = array('created', 'edited');

private $parsedown;
private $version;

Expand Down Expand Up @@ -75,7 +77,7 @@ function mudlet_post_release()
{
if (isset($_POST['payload'])) {
$payload = json_decode(stripslashes($_POST['payload']));
if (isset($payload->release)) {
if (isset($payload->release) && in_array($payload->action, self::ACTIONS)) {
$result = $payload->release;
} else {
wp_die('Releasse hook not applicable.');
Expand Down Expand Up @@ -124,8 +126,6 @@ function mudlet_post_release()
));
echo "Post ID: $post_in_lang updated.\n";
}
foreach ($release_posts as $post) {
}
}
wp_die();
}
Expand All @@ -137,6 +137,7 @@ class MudletUpdateCheck

private $version;
private $cache_key;
private $slug;

function __construct($version)
{
Expand Down

0 comments on commit 11e36f4

Please sign in to comment.