コード例 #1
0
 /**
  * Return an instance of this class.
  *
  * @since 1.0.0
  *
  * @return object A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
 function setUp()
 {
     parent::setUp();
     $this->main_class = Builtin_Taxos_CPT::get_instance();
     $args = array('public' => true, 'label' => 'Books', 'taxonomies' => array('post_tag'));
     register_post_type('book', $args);
     $args = array('public' => true, 'label' => 'Paper');
     register_post_type('paper', $args);
     $args = array('public' => false, 'label' => 'Pen', 'taxonomies' => array('post_tag'));
     register_post_type('pen', $args);
 }