Skip to content

Commit 177e016

Browse files
authored
Merge pull request #28
Added check for post type while displaying
2 parents 580b2b1 + d213a72 commit 177e016

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

hookpress/includes.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,15 @@ function hookpress_print_webhook_row( $id ) {
183183
$activeornot = $desc['enabled'] ? 'active' : 'inactive';
184184

185185
$html_safe['hook'] = esc_html( $desc['hook'] );
186-
if( count( $desc['post_type'] ) > 1 ) {
187-
$desc['post_type'] = array_map( 'esc_html', $desc['post_type'] );
188-
$html_safe['post_type'] = implode(',', $desc['post_type'] );
189-
} else{
190-
$html_safe['post_type'] = esc_html( $desc['post_type'][0] );
186+
if( isset($desc['post_type'])) {
187+
if( count( $desc['post_type'] ) > 1 ) {
188+
$desc['post_type'] = array_map( 'esc_html', $desc['post_type'] );
189+
$post_type = implode(',', $desc['post_type'] );
190+
} else{
191+
$post_type = esc_html( $desc['post_type'][0] );
192+
}
193+
}else{
194+
$post_type = '';
191195
}
192196

193197
$html_safe['url'] = esc_html( $desc['url'] );
@@ -196,7 +200,7 @@ function hookpress_print_webhook_row( $id ) {
196200
<tr id='$id' class='$activeornot'>
197201
<td class='webhook-title'><strong>{$html_safe['hook']}</strong>
198202
<div class='row-actions'>$nonce_action $nonce_delete<span class='edit'>$edit | <span class='delete'>$delete | </span><span class='action'>$action</span></div></td>
199-
<td class='desc'><p>{$html_safe['post_type']}</p></td>
203+
<td class='desc'><p>{$post_type}</p></td>
200204
<td class='desc'><p>{$html_safe['url']}</p></td>
201205
<td class='desc'><code ".($desc['type'] == 'filter' ? " style='background-color:#ECEC9D' title='".__('The data in the highlighted field is expected to be returned from the webhook, with modification.','hookpress')."'":"").">$fields</code></td>
202206
</tr>\n";

0 commit comments

Comments
 (0)