@@ 1554-1568 (lines=15) @@ | ||
1551 | } |
|
1552 | } |
|
1553 | ||
1554 | function is_post_type_allowed( $post_type ) { |
|
1555 | // if the post type is empty, that's fine, WordPress will default to post |
|
1556 | if ( empty( $post_type ) ) |
|
1557 | return true; |
|
1558 | ||
1559 | // allow special 'any' type |
|
1560 | if ( 'any' == $post_type ) |
|
1561 | return true; |
|
1562 | ||
1563 | // check for allowed types |
|
1564 | if ( in_array( $post_type, $this->_get_whitelisted_post_types() ) ) |
|
1565 | return true; |
|
1566 | ||
1567 | return false; |
|
1568 | } |
|
1569 | ||
1570 | /** |
|
1571 | * Gets the whitelisted post types that JP should allow access to. |
@@ 148-162 (lines=15) @@ | ||
145 | } |
|
146 | ||
147 | // copied from class.json-api-endpoints.php |
|
148 | private function is_post_type_allowed( $post_type ) { |
|
149 | // if the post type is empty, that's fine, WordPress will default to post |
|
150 | if ( empty( $post_type ) ) |
|
151 | return true; |
|
152 | ||
153 | // allow special 'any' type |
|
154 | if ( 'any' == $post_type ) |
|
155 | return true; |
|
156 | ||
157 | // check for allowed types |
|
158 | if ( in_array( $post_type, $this->_get_whitelisted_post_types() ) ) |
|
159 | return true; |
|
160 | ||
161 | return false; |
|
162 | } |
|
163 | ||
164 | // copied from class.json-api-endpoints.php |
|
165 | /** |