Title: Filter-Hook Request
Last modified: November 9, 2020

---

# Filter-Hook Request

 *  [markusreis](https://wordpress.org/support/users/markusreis/)
 * (@markusreis)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/filter-hook-request/)
 * Hi mate,
 * I am facing an issue regarding different custom post types in different blogs.
   Here is my stackoverflow question regarding the issue itself: [https://stackoverflow.com/questions/64753068/how-to-correctly-determine-whether-a-post-type-is-active-in-a-given-blog-in-a-wo?noredirect=1#comment114489656_64753068](https://stackoverflow.com/questions/64753068/how-to-correctly-determine-whether-a-post-type-is-active-in-a-given-blog-in-a-wo?noredirect=1#comment114489656_64753068)
 * Now, as it doesn’t seem to be possible to safely determine whether post-types
   are active in other blogs, I was wondering if you could add an option for us 
   developers to filter the hreflang output, so we can check whether a tag should
   be printed or not depending on our own setup.
 * Specifically, a filter in `MslsOutput.php` in method `get_alternate_links` would
   we great. Maybe just after `$url = $blog->get_url($options);` in the foreach 
   loop, something like:
 * `$url = apply_filters('mlsl_output_url', $url, $blog);`
 * And – or maybe event better – also in the `MslsBlog::get_permalink($options)`
   method as the blog id is actually set to the respective blog there, just after
 * `$url = $options->get_permalink($this->get_language());`
    also add a filter so
   you can return null for the URL if desired
 *     ```
       $url = apply_filters('mlsl_blog_permalink', $url, $this, $this->obj->userblog_id);
       ```
   
 * Then we can simply return null if I don’t want a specific hreflang tag to be 
   printed. At the current point, we only can
 * `remove_action('wp_head', ['lloc\Msls\MslsPlugin', 'print_alternate_links']);`
 * But this will avoid any tags from being printed, also the x-default.
 * If there is another way you would approach this issue feel free to point it out.
 * Thanks for your support!
    Markus.
    -  This topic was modified 5 years, 6 months ago by [markusreis](https://wordpress.org/support/users/markusreis/).
    -  This topic was modified 5 years, 6 months ago by [markusreis](https://wordpress.org/support/users/markusreis/).
    -  This topic was modified 5 years, 6 months ago by [markusreis](https://wordpress.org/support/users/markusreis/).
    -  This topic was modified 5 years, 6 months ago by [markusreis](https://wordpress.org/support/users/markusreis/).
    -  This topic was modified 5 years, 6 months ago by [markusreis](https://wordpress.org/support/users/markusreis/).
    -  This topic was modified 5 years, 6 months ago by [markusreis](https://wordpress.org/support/users/markusreis/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/filter-hook-request/#post-13640055)
 * Interesting! Do you mind to make a pull-request at [https://github.com/lloc/Multisite-Language-Switcher/](https://github.com/lloc/Multisite-Language-Switcher/)?
 *  Thread Starter [markusreis](https://wordpress.org/support/users/markusreis/)
 * (@markusreis)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/filter-hook-request/#post-13640141)
 * Sure thing, done!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filter-Hook Request’ is closed to new replies.

 * ![](https://ps.w.org/multisite-language-switcher/assets/icon-256x256.png?rev=
   2793358)
 * [Multisite Language Switcher](https://wordpress.org/plugins/multisite-language-switcher/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multisite-language-switcher/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multisite-language-switcher/)
 * [Active Topics](https://wordpress.org/support/plugin/multisite-language-switcher/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multisite-language-switcher/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multisite-language-switcher/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [markusreis](https://wordpress.org/support/users/markusreis/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/filter-hook-request/#post-13640141)
 * Status: not resolved