Skip to content

Commit f794aac

Browse files
Add post type is hookpress
1 parent 384942a commit f794aac

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

hookpress/includes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ function hookpress_generic_action($id,$args) {
285285
$newobj = array();
286286
switch($arg_names[$i]) {
287287
case 'POST':
288+
289+
if(in_array($args[1]->post_type,$desc['post_type']) != 1){
290+
return;
291+
}
288292
case 'ATTACHMENT':
289293
$newobj = get_post($arg,ARRAY_A);
290294

hookpress/options.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@
107107
tb.find('#editindicator').html('<small><?php _e("Please enter a valid URL.","hookpress");?></small>');
108108
return;
109109
}
110+
if (tb.find('#post_type').val() == '') {
111+
tb.find('#editindicator').html('<small><?php _e("You must select at least one post type.","hookpress");?></small>');
112+
return;
113+
}
110114

111115
tb.find('#editindicator').html('<div class="webhooks-spinner">&nbsp;</div>');
112116

@@ -165,6 +169,10 @@
165169
tb.find('#newindicator').html('<small><?php _e("Please enter a valid URL.","hookpress");?></small>');
166170
return;
167171
}
172+
if (tb.find('#post_type').val() == '') {
173+
tb.find('#newindicator').html('<small><?php _e("You must select at least one post type.","hookpress");?></small>');
174+
return;
175+
}
168176

169177
tb.find('#newindicator').html('<div class="webhooks-spinner">&nbsp;</div>');
170178

0 commit comments

Comments
 (0)