diff --git a/includes/admin/class-wc-admin-webhooks.php b/includes/admin/class-wc-admin-webhooks.php index 695993c651f..46842982cfe 100644 --- a/includes/admin/class-wc-admin-webhooks.php +++ b/includes/admin/class-wc-admin-webhooks.php @@ -214,7 +214,7 @@ class WC_Admin_Webhooks { /* translators: %s: date */ 'post_title' => sprintf( __( 'Webhook created on %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Webhook created on date parsed by strftime', 'woocommerce' ) ) ), // @codingStandardsIgnoreEnd - 'comment_status' => 'open', + 'comment_status' => 'closed', ) ); if ( is_wp_error( $webhook_id ) ) { @@ -457,30 +457,8 @@ class WC_Admin_Webhooks { * * @param WC_Webhook $webhook */ - public static function logs_output( $webhook ) { - $current = isset( $_GET['log_page'] ) ? absint( $_GET['log_page'] ) : 1; - $args = array( - 'post_id' => $webhook->id, - 'status' => 'approve', - 'type' => 'webhook_delivery', - 'number' => 10, - ); - - if ( 1 < $current ) { - $args['offset'] = ( $current - 1 ) * 10; - } - - remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 ); - - $logs = get_comments( $args ); - - add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 ); - - if ( $logs ) { - include_once( dirname( __FILE__ ) . '/settings/views/html-webhook-logs.php' ); - } else { - echo '

' . __( 'This Webhook has no log yet.', 'woocommerce' ) . '

'; - } + public static function logs_output( $webhook = 'deprecated' ) { + echo '

' . sprintf( __( 'View Webhook Delivery Logs', 'woocommerce' ), esc_url( '' ) ) . '

'; } /** @@ -521,40 +499,7 @@ class WC_Admin_Webhooks { * @return string */ public static function get_logs_navigation( $total, $webhook ) { - $pages = ceil( $total / 10 ); - $current = isset( $_GET['log_page'] ) ? absint( $_GET['log_page'] ) : 1; - - $html = '
'; - - $html .= '

'; - /* translators: 1: items count (i.e. 8 items) 2: current page 3: total pages */ - $html .= sprintf( - __( '%1$s – Page %2$d of %3$d', 'woocommerce' ), - sprintf( _n( '%d item', '%d items', $total, 'woocommerce' ), $total ), - $current, - $pages - ); - $html .= '

'; - - if ( 1 < $pages ) { - $html .= '

'; - if ( 1 == $current ) { - $html .= ' '; - } else { - $html .= '' . __( '‹ Previous', 'woocommerce' ) . ' '; - } - - if ( $pages == $current ) { - $html .= ''; - } else { - $html .= '' . __( 'Next ›', 'woocommerce' ) . ''; - } - $html .= '

'; - } - - $html .= '
'; - - return $html; + wc_deprecated_function( 'WC_Admin_Webhooks::get_logs_navigation', '3.3' ); } } diff --git a/includes/admin/settings/views/html-webhook-log.php b/includes/admin/settings/views/html-webhook-log.php deleted file mode 100644 index 3c3be152c43..00000000000 --- a/includes/admin/settings/views/html-webhook-log.php +++ /dev/null @@ -1,38 +0,0 @@ - - - - comment_date_gmt ), true ); ?> - - -

:

-

:

-

:

- -

:

-
- - -

:

-

:

- - -

:

-

- - - diff --git a/includes/admin/settings/views/html-webhook-logs.php b/includes/admin/settings/views/html-webhook-logs.php deleted file mode 100644 index c11824efacd..00000000000 --- a/includes/admin/settings/views/html-webhook-logs.php +++ /dev/null @@ -1,42 +0,0 @@ -id ); -$total = $count_comments->approved; - -?> - - - - - - - - - - - - - - - - - - - - - - get_delivery_log( $log->comment_ID ); - - include( 'html-webhook-log.php' ); - } - ?> - -
- -