Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve conflict with AIOSEO stomping on CiviCRM Shortcode #263

Merged
merged 1 commit into from
Dec 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions includes/civicrm.compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public function register_hooks() {
// Support Clean URLs when Polylang is active.
add_action('civicrm_after_rewrite_rules', [$this, 'rewrite_rules_polylang'], 10, 2);

// Prevent AIOSEO from stomping on CiviCRM Shortcodes.
add_filter('aioseo_conflicting_shortcodes', [$this, 'aioseo_resolve_conflict']);

}

/**
Expand Down Expand Up @@ -147,4 +150,19 @@ public function rewrite_rules_polylang($flush_rewrite_rules, $basepage) {

}

/**
* Fixes AIOSEO's attempt to modify Shortcodes.
*
* @see https://civicrm.stackexchange.com/questions/40765/wp-all-in-one-seo-plugin-conflict
*
* @since 5.45
*
* @param array $conflicting_shortcodes The existing AIOSEO Conflicting Shortcodes array.
* @return array $conflicting_shortcodes The modified AIOSEO Conflicting Shortcodes array.
*/
public function aioseo_resolve_conflict($conflicting_shortcodes) {
$conflicting_shortcodes['CiviCRM'] = 'civicrm';
return $conflicting_shortcodes;
}

}