Guest User

Untitled

a guest
May 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. if ( ! empty( $items['create'] ) ) {
  2. $total += count( $items['create'] );
  3. }
  4.  
  5. if ( ! empty( $items['update'] ) ) {
  6. $total += count( $items['update'] );
  7. }
  8.  
  9. if ( ! empty( $items['delete'] ) ) {
  10. $total += count( $items['delete'] );
  11. }
  12.  
  13. if ( $total > $limit ) {
  14. /* translators: %s: items limit */
  15. return new WP_Error( 'woocommerce_rest_request_entity_too_large', sprintf( __( 'Unable to accept more than %s items for this request.', 'woocommerce' ), $limit ), array( 'status' => 413 ) );
  16. }
  17.  
  18. return true;
Add Comment
Please, Sign In to add comment