admin_services as $service ) { $hook = $service[0]; $class = $service[1]; add_action( $hook, array( $class, 'register' ) ); } } foreach ( $this->services as $service ) { if ( method_exists( $service, 'register' ) ) { $service::register(); } } } /** * Declare the schema for v2.0.0 Catalog Data Sync meta keys. * * `register_post_meta` / `register_term_meta` document the expected type, * cardinality, and REST visibility so WordPress is aware of the schema * before v2.0.0 starts writing the keys. The keys are never read or written * by 1.x code; this declaration is forward-compatibility bookkeeping only. * * Note: registration does NOT prevent other plugins from reading or writing * these keys — it only formalises the schema within WordPress's meta registry. */ public function register_reserved_meta(): void { $meta_args = array( 'type' => 'string', 'single' => true, 'show_in_rest' => false, ); register_post_meta( 'product', '_parallax_id', $meta_args ); register_term_meta( 'product_cat', '_parallax_id', $meta_args ); register_term_meta( 'product_tag', '_parallax_id', $meta_args ); } }