@@ 143-145 (lines=3) @@ | ||
140 | } |
|
141 | ||
142 | $post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product ); |
|
143 | if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) { |
|
144 | wp_send_json_error( 'insufficient_post_permissions', 403 ); |
|
145 | } |
|
146 | ||
147 | $product_posts = get_posts( array( |
|
148 | 'numberposts' => 100, |
|
@@ 176-178 (lines=3) @@ | ||
173 | } |
|
174 | ||
175 | $post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product ); |
|
176 | if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) { |
|
177 | wp_send_json_error( 'insufficient_post_permissions', 403 ); |
|
178 | } |
|
179 | ||
180 | if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) { |
|
181 | wp_send_json_error( 'missing_params', 400 ); |