{"action":"created","issue":{"url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/96","labels_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/96/comments","events_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/96/events","html_url":"https://github.com/inpsyde/multilingual-press/issues/96","id":63241373,"number":96,"title":"Callbacks on `save_post` with priority lower than 10 were ignored for the source blog","user":{"login":"dnaber-de","id":1133205,"avatar_url":"https://avatars.githubusercontent.com/u/1133205?v=3","gravatar_id":"","url":"https://api.github.com/users/dnaber-de","html_url":"https://github.com/dnaber-de","followers_url":"https://api.github.com/users/dnaber-de/followers","following_url":"https://api.github.com/users/dnaber-de/following{/other_user}","gists_url":"https://api.github.com/users/dnaber-de/gists{/gist_id}","starred_url":"https://api.github.com/users/dnaber-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnaber-de/subscriptions","organizations_url":"https://api.github.com/users/dnaber-de/orgs","repos_url":"https://api.github.com/users/dnaber-de/repos","events_url":"https://api.github.com/users/dnaber-de/events{/privacy}","received_events_url":"https://api.github.com/users/dnaber-de/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-20T14:45:46Z","updated_at":"2015-03-20T18:26:56Z","closed_at":null,"body":"Here's the situation:\r\n\r\nWordPress 4.1.1 (virtual localhost, recently updated from 3.8.5) with MLP 2.1.2 (pro, recently checked out the 2.1.2 tag coming from an outdated master branch). Two sites are set up (English and German) and are related to each other.\r\n\r\nThe English site has the ID 1, the German site has the ID 2.\r\n\r\nWhen I create a post on the English site (`/wp-admin/post-new.php`) and save it, everything works as expected. As soon as I have a related translation (draft or publish) any callback on the action `save_post` with the priority 11 or lower (means number 11 or higher) never gets called in the context of the English (ID 1) site.\r\n\r\nHere's a simple plugin which shows the behaviour (activated network wide):\r\n```php\r\n<?php\r\n\r\n/**\r\n * Plugin Name: MLP Debug\r\n * Version: 2015.03.20\r\n */\r\n\r\nnamespace MLPDebug;\r\n\r\nadd_action( 'wp_loaded', __NAMESPACE__ . '\\init' );\r\nfunction init() {\r\n\r\n\tadd_action( 'save_post', __NAMESPACE__ . '\\on_save_post_10', 10 );\r\n\tadd_action( 'save_post', __NAMESPACE__ . '\\on_save_post_11', 11 );\r\n\r\n\tadd_action( 'mlp_before_post_synchronization', __NAMESPACE__ . '\\on_mlp_before_post_synchronization' );\r\n\tadd_action( 'mlp_after_post_synchronization', __NAMESPACE__ . '\\on_mlp_after_post_synchronization' );\r\n}\r\n\r\nfunction on_save_post_11() {\r\n\r\n\t$msg = 'save_post_callback_11/blog/' . get_current_blog_id();\r\n\ttrigger_error( $msg, E_USER_NOTICE );\r\n}\r\n\r\nfunction on_save_post_10() {\r\n\r\n\t$msg = 'save_post_callback_10/blog/' . get_current_blog_id();\r\n\ttrigger_error( $msg, E_USER_NOTICE );\r\n}\r\n\r\nfunction on_mlp_before_post_synchronization() {\r\n\r\n\t$msg = 'mlp_before_post_synchronization_callback_10/blog/' . get_current_blog_id();\r\n\ttrigger_error( $msg, E_USER_NOTICE );\r\n}\r\n\r\nfunction on_mlp_after_post_synchronization() {\r\n\r\n\t$msg = 'mlp_after_post_synchronization_callback_10/blog/' . get_current_blog_id();\r\n\ttrigger_error( $msg, E_USER_NOTICE );\r\n}\r\n\r\n```\r\nThe following error message order I would expect (remember Site 1 is the »current« one):\r\n\r\n * `mlp_before_post_synchronization_callback_10/blog/1` because the MLP `save_post` callback is registered before `MLPDebug\\save_post_callback_10`. \r\n * `save_post_callback_10/blog/2` because mlp has switched the blog context already\r\n * `save_post_callback_11/blog/2` of course\r\n * `mlp_after_post_synchronization_callback_10/blog/` MLPs `save_post` callback is done\r\n * `save_post_callback_10/blog/1` which is on the same priority stack as MLP but runs later\r\n * `save_post_callback_11/blog/1` because it's the next lower priority in the list of filters\r\n\r\nWhat I actually see is:\r\n```\r\n[Fri Mar 20 15:42:56.079963 2015] [:error] [pid 1532] [client 127.0.0.1:60890] PHP Notice:  mlp_before_post_synchronization_callback_10/blog/1 in wp-content/plugins/mlp-debug/mlp-debug.php on line 35\r\n[Fri Mar 20 15:42:56.100159 2015] [:error] [pid 1532] [client 127.0.0.1:60890] PHP Notice:  save_post_callback_10/blog/2 in wp-content/plugins/mlp-debug/mlp-debug.php on line 29\r\n[Fri Mar 20 15:42:56.100276 2015] [:error] [pid 1532] [client 127.0.0.1:60890] PHP Notice:  save_post_callback_11/blog/2 in wp-content/plugins/mlp-debug/mlp-debug.php on line 23\r\n[Fri Mar 20 15:42:56.103903 2015] [:error] [pid 1532] [client 127.0.0.1:60890] PHP Notice:  mlp_after_post_synchronization_callback_10/blog/1 in wp-content/plugins/mlp-debug/mlp-debug.php on line 41\r\n[Fri Mar 20 15:42:56.107458 2015] [:error] [pid 1532] [client 127.0.0.1:60890] PHP Notice:  save_post_callback_10/blog/1 in wp-content/plugins/mlp-debug/mlp-debug.php on line 29\r\n```\r\nIn other words: `MLPDebug\\on_save_post_11` never gets called in a context of site 1.\r\n \r\n\r\n  "},"comment":{"url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/comments/84094604","html_url":"https://github.com/inpsyde/multilingual-press/issues/96#issuecomment-84094604","issue_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/96","id":84094604,"user":{"login":"dnaber-de","id":1133205,"avatar_url":"https://avatars.githubusercontent.com/u/1133205?v=3","gravatar_id":"","url":"https://api.github.com/users/dnaber-de","html_url":"https://github.com/dnaber-de","followers_url":"https://api.github.com/users/dnaber-de/followers","following_url":"https://api.github.com/users/dnaber-de/following{/other_user}","gists_url":"https://api.github.com/users/dnaber-de/gists{/gist_id}","starred_url":"https://api.github.com/users/dnaber-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnaber-de/subscriptions","organizations_url":"https://api.github.com/users/dnaber-de/orgs","repos_url":"https://api.github.com/users/dnaber-de/repos","events_url":"https://api.github.com/users/dnaber-de/events{/privacy}","received_events_url":"https://api.github.com/users/dnaber-de/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T18:26:55Z","updated_at":"2015-03-20T18:26:55Z","body":"Maybe we should consider to move to the `wp_insert_post` action instead of `save_post` because `save_post` is much more common out there. "}}