dm_handle_action_primary
-
Hello. I’m putting together a lightweight analytics plugin and hope to integrate with domain mapping.
Overall, my goal is to update the analytics platform with the new url automatically when a new primary is set it domain mapping.
I’m trying to use the ‘dm_handle_action_primary’ hook, but it doesn’t seem to be firing at all, even when adding a new primary domain. As a work around, I’ve tried ‘dm_handle_action_add’. That’s firing correctly, however my attempt to retrieve the primary domain from the database at that time is retrieving the domain which is being replaced as the primary, so it seems to be firing before that gets written to the database.
Here’s the relevant code:
function piwik_inline_update_blog($domain) { //get the primary domain global $wpdb; $domain = $wpdb-> get_results( "SELECT * FROM {$wpdb->base_prefix}domain_mapping WHERE blog_id = '".get_current_blog_id()."' and active=1"); echo $domain; // outputs the domain being replaced; new is not yet saved to database. } add_action('dm_handle_actions_primary', 'piwik_inline_update_blog'); // function is never called through this hook add_action('dm_handle_actions_add', 'piwik_inline_update_blog');Do you have any advice on how to better approach this? Any help or advice at all would be greatly appreciated!
The topic ‘dm_handle_action_primary’ is closed to new replies.