feat(2meet-data-optimizer-hivepress-addon): provide HivePress defaults to core via filters
- TMDO_HivePress_Entity_Groups hooks tmdo_rest_default_post_type so GET /wpdo/v1/listings keeps defaulting to hp_listing now that core defaults to 'post' (PR-020e) - Test: TMDO_Post_Group_Reconciler::plan() over the AddOn's groups yields the 8 misrouted HivePress keys (coverage moved out of core in PR-020b) - Verify: HP unit 148 / integration 49 OK, bootstrap smoke OK - PR: PR-020f
This commit is contained in:
@@ -32,12 +32,22 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
final class TMDO_HivePress_Entity_Groups {
|
||||
|
||||
/**
|
||||
* Hook into WPDO entity field registration.
|
||||
* Hook into WPDO entity field registration and the REST default post type.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function register(): void {
|
||||
add_action( 'wpdo_register_entity_fields', array( __CLASS__, 'register_entity_fields' ) );
|
||||
add_filter( 'tmdo_rest_default_post_type', array( __CLASS__, 'rest_default_post_type' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /wpdo/v1/listings serves HivePress listings when no post type is given.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function rest_default_post_type(): string {
|
||||
return 'hp_listing';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user