@@ 135-137 (lines=3) @@ | ||
132 | } |
|
133 | ||
134 | $post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product ); |
|
135 | if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) { |
|
136 | wp_send_json_error( 'insufficient_post_permissions', 403 ); |
|
137 | } |
|
138 | ||
139 | $product_posts = get_posts( array( |
|
140 | 'numberposts' => 100, |
|
@@ 168-170 (lines=3) @@ | ||
165 | } |
|
166 | ||
167 | $post_type_object = get_post_type_object( Jetpack_Simple_Payments::$post_type_product ); |
|
168 | if ( ! current_user_can( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) { |
|
169 | wp_send_json_error( 'insufficient_post_permissions', 403 ); |
|
170 | } |
|
171 | ||
172 | if ( empty( $_POST['params'] ) || ! is_array( $_POST['params'] ) ) { |
|
173 | wp_send_json_error( 'missing_params', 400 ); |