title: How to correctly determine whether a post-type is active in a given blog in a wordpress multisite
body: <p>If I register a post type for example like this:</p>
  <pre class="lang-php prettyprint-override"><code>function setup_post_type() {
      $args = array(
          'public'    =&gt; true,
          'label'     =&gt; __( 'Recipe', 'textdomain' ),
          'menu_icon' =&gt; 'dashicons-book',
      );
     
      // Should only be active in a given blog
      if( get_current_blog_id() === 14 ) {
          register_post_type( 'recipe', $args );
      }
  }
  add_action( 'init', 'setup_post_type' );
  </code></pre>
  <p>it will only be available in the backend of the given blog with ID 14. However, when trying to determine whether the post-type is active in another blog - for example for building hreflang links for post archives - you get the following:</p>
  <p>So let's say you visit blog with ID 14:</p>
  <pre class="lang-php prettyprint-override"><code>    var_dump(get_current_blog_id()); // 14
      var_dump(post_type_exists('recipe')); // true
      switch_to_blog(15);
      var_dump(post_type_exists('recipe')); // true
      restore_current_blog();
  </code></pre>
  <p>But if you visit the blog with ID 15 you will get the following:</p>
  <pre class="lang-php prettyprint-override"><code>    var_dump(get_current_blog_id()); // 15
      var_dump(post_type_exists('recipe')); // false
      switch_to_blog(14);
      var_dump(post_type_exists('recipe')); // false
      restore_current_blog();
  </code></pre>
  <p>As the posts are registered in wordpress' <code>init</code> hook they're now available depending on where you started loading the site and the dependency will not be re-evaluated.</p>
  <p>Is there a way to correctly determine post-type existence on other blogs?</p>