You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of RRM Phase 2, the WordPress taxonomy term screens will allow users to override the snippet configuration at the taxonomy term level. To facilitate this, a term meta setting should be added to store the term-level configuration.
A Modules\Reader_Revenue_Manager\Term_Product_ID class extending the Core\Storage\Term_Meta_Setting class should be created to register a term meta setting to store the taxonomy term-level snippet options. It should hold an empty string as the value by default. The meta key can be googlesitekit_rrm_{Publication ID}:productID.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
When the rrmModuleV2 feature flag is enabled:
A new term meta setting should be registered using the new term meta infrastructure that will store the per-term-level snippet configuration for Reader Revenue Manager.
The meta key should include the publication ID so that it can be uniquely identified when the connected publication changes.
The meta value by default should be an empty string, and it should only accept a string as the value.
Implementation Brief
Create a class Term_Product_ID inside includes/Modules/Reader_Revenue_Manager.
It should accept the instance of Core\Storage\Term_Meta and the publication ID in it's constructor. The publication ID can be assigned to a private class property which would then be utilised to form the meta key.
Override the get_meta_key which should return googlesitekit_rrm_{publication_id}:productID. Taking publication_id from the value passed to the contructor.
In includes/Modules/Reader_Revenue_Manager.php
In register method, check if rrmModuleV2 feature is enabled using Feature_Flags::enabled( 'rrmModuleV2' ). If feature is enabled and module is connected, do the following.
Instantiate Core\Storage\Term_Meta class.
Instantiate Term_Product_ID and pass instance of Core\Storage\Post_Meta and the publication ID to it's constructor.
Call register method of the Term_Product_ID class.
TODO: Complete based on the implementation of the Term_Meta class in #9949 and its methods.
Test Coverage
Write tests for Test_Product_ID class.
Fix any failing tests.
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered:
Feature Description
As part of RRM Phase 2, the WordPress taxonomy term screens will allow users to override the snippet configuration at the taxonomy term level. To facilitate this, a term meta setting should be added to store the term-level configuration.
A
Modules\Reader_Revenue_Manager\Term_Product_ID
class extending theCore\Storage\Term_Meta_Setting
class should be created to register a term meta setting to store the taxonomy term-level snippet options. It should hold an empty string as the value by default. The meta key can begooglesitekit_rrm_{Publication ID}:productID
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
rrmModuleV2
feature flag is enabled:Implementation Brief
Create a class
Term_Product_ID
insideincludes/Modules/Reader_Revenue_Manager
.Core\Storage\Term_Meta
and the publication ID in it's constructor. The publication ID can be assigned to a private class property which would then be utilised to form the meta key.Google\Site_Kit\Core\Storage\Term_Meta_Setting
class (added in Add term meta infrastructure #9949).get_meta_key
which should returngooglesitekit_rrm_{publication_id}:productID
. Takingpublication_id
from the value passed to the contructor.In
includes/Modules/Reader_Revenue_Manager.php
register
method, check ifrrmModuleV2
feature is enabled usingFeature_Flags::enabled( 'rrmModuleV2' )
. If feature is enabled and module is connected, do the following.Core\Storage\Term_Meta
class.Term_Product_ID
and pass instance ofCore\Storage\Post_Meta
and the publication ID to it's constructor.register
method of theTerm_Product_ID
class.TODO: Complete based on the implementation of the Term_Meta class in #9949 and its methods.
Test Coverage
Test_Product_ID
class.QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: