Skip to content

Commit 5c34ab6

Browse files
Add post type is hookpress
1 parent f794aac commit 5c34ab6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

hookpress/includes.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,20 @@ 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] );
191+
}
192+
186193
$html_safe['url'] = esc_html( $desc['url'] );
187194

188195
echo "
189196
<tr id='$id' class='$activeornot'>
190197
<td class='webhook-title'><strong>{$html_safe['hook']}</strong>
191198
<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>
192200
<td class='desc'><p>{$html_safe['url']}</p></td>
193201
<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>
194202
</tr>\n";
@@ -205,6 +213,7 @@ function hookpress_print_webhooks_table() {
205213
<thead>
206214
<tr>
207215
<th scope="col" class="manage-column" style="width:15%"><?php _e("Hook","hookpress");?></th>
216+
<th scope="col" class="manage-column" style="width:25%"><?php _e("Post Type","hookpress");?></th>
208217
<th scope="col" class="manage-column" style="width:25%"><?php _e("URL","hookpress");?></th>
209218
<th scope="col" class="manage-column"><?php _e("Fields","hookpress");?></th>
210219
</tr>
@@ -213,6 +222,7 @@ function hookpress_print_webhooks_table() {
213222
<tfoot>
214223
<tr>
215224
<th scope="col" class="manage-column"><?php _e("Hook","hookpress");?></th>
225+
<th scope="col" class="manage-column"><?php _e("Post Type","hookpress");?></th>
216226
<th scope="col" class="manage-column"><?php _e("URL","hookpress");?></th>
217227
<th scope="col" class="manage-column"><?php _e("Fields","hookpress");?></th>
218228
</tr>

0 commit comments

Comments
 (0)