-
-
Save octaedro/3b8c4921b0657bd5063bac5ad68b1ffa to your computer and use it in GitHub Desktop.
Modify RIM rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Modify RIM rules | |
* Description: This plugin modifies the RIM rules. | |
* Version: 0.1 | |
* | |
*/ | |
function modify_rim_rules( $specs ) { | |
foreach ( $specs as $rim ) { | |
if ( isset( $rim->rules ) && strpos( $rim->slug, 'woopay-beta-merchantrecruitment-short-06MAY23-TEST' ) !== false ) { | |
foreach ( $rim->rules as $rule ) { | |
if ( isset( $rule->option_name ) && $rule->option_name === 'siteurl' ) { | |
$rule->operation = 'contains'; | |
$transformer = new stdClass(); | |
$transformer->use = 'prepare_url'; | |
$rule->value = get_site_url(); | |
$rule->transformers = array( $transformer ); | |
} | |
} | |
} | |
} | |
return $specs; | |
} | |
add_filter( 'data_source_poller_specs', 'modify_rim_rules', 2, 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment