title: Create custom post type with parameters
body: <p>I have a lot of custom post types and i want to create them all with in the same function, so is there any way to send parameters to the function when i'm creating the custom post type.</p>
  
  <p>I thinking of something like this:</p>
  
  <pre><code>function custom_poster($pluralName, $singularName) {
     // Create custom post type
  }
  
  add_action( 'init', 'custom_poster' );
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>function create($pluralName, $singularName)
  {
    function custom_poster() {
       // Create custom post type and use $pluralName, $singularName)
    }
  
    add_action( 'init', 'custom_poster' );
  }
  
  create("myposts","mypost");
  </code></pre>