Changeset 12999 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-blueprint.php
- Timestamp:
- 12/04/2023 04:42:52 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-blueprint.php
r12998 r12999 37 37 $blueprints = get_post_meta( $plugin->ID, 'assets_blueprints', true ); 38 38 // Note: for now, only use a file called `blueprint.json`. 39 if ( !isset( $blueprints['blueprint.json'] ) ) {40 return false;39 if ( !isset( $blueprints['blueprint.json'] ) ) { 40 return new \WP_Error( 'no_blueprint', 'File not found', array( 'status' => 404 ) ); 41 41 } 42 42 $blueprint = $blueprints['blueprint.json']; 43 43 if ( !$blueprint || !isset( $blueprint['contents'] ) || !is_string( $blueprint['contents'] ) ) { 44 return false;44 return new \WP_Error( 'invalid_blueprint', 'Invalid file', array( 'status' => 500 ) ); 45 45 } 46 46
Note: See TracChangeset
for help on using the changeset viewer.