Registers the custom post type in Wordpress. A Custom post type
must trigger this during the 'init' state for it to be recognized
automatically by Wordpress.
176465
public function register()
    {
        $registrars = array(
            new CustomPostTypeRegistrar($this),
            new TaxonomyRegistrar($this)
        );

        foreach ($registrars as $registrar) {
            $registrar->register();
        }
    }
968226
public function add_meta_boxes( $post_type )
    {    
        if ( in_array( $post_type, $this->settings['post_types'] )) {
            add_meta_box(
                $this->settings['id'],
                $this->settings['title'],
                array( $this, 'render' ),
                $post_type,
                $this->settings['context'],
                $this->settings['priority']
            );
        }
    }
1281786
private function createPostTypes()
    {
        if(!$this->option('posts') && ($this->option('post_types') || $this->option('all'))) {
            $this->comment('Creating dummy Post Types...');
            $output = (new \PostTypeSeeder())
                ->setCommand($this)
                ->run($this->getDefaultOption('post_types'));
            $this->info($output);
        }
        return $this;
    }
547542
public function _add_meta_boxes( $post_type, $post ) {
		$post_type_object = get_post_type_object( $post_type );
		if ( empty( $post_type_object ) || empty( $post_type_object->public ) ) {
			return;
		}

		add_meta_box(
			'wp-seo',
			__( 'SEO', 'inc2734-wp-seo' ),
			array( $this, '_wp_seo_meta_box' ),
			$post_type,
			'normal'
		);
	}
419133
public function init() {
		global $wp_customize;
		if ( ! $wp_customize ) {
			return;
		}
		// Allow disabling the custom loader using the kirki_config filter.
		$config = apply_filters( 'kirki_config', [] );
		if ( isset( $config['disable_loader'] ) && true === $config['disable_loader'] ) {
			return;
		}
		// Add the "loading" icon.
		add_action( 'wp_footer', [ $this, 'add_loader_to_footer' ] );
		add_action( 'wp_head', [ $this, 'add_loader_styles_to_header' ], 99 );
		$this->remove_default_loading_styles();
	}
243880
public function register_taxonomy() {

		if ( true === $this->args['query_var'] ) {
			$query_var = $this->taxonomy;
		} else {
			$query_var = $this->args['query_var'];
		}

		$post_types = get_post_types( [
			'query_var' => $query_var,
		] );

		if ( $query_var && count( $post_types ) ) {
			trigger_error( esc_html( sprintf(
				/* translators: %s: Taxonomy query variable name */
				__( 'Taxonomy query var "%s" clashes with a post type query var of the same name', 'extended-cpts' ),
				$query_var
			) ), E_USER_ERROR );
		} elseif ( in_array( $query_var, [ 'type', 'tab' ], true ) ) {
			trigger_error( esc_html( sprintf(
				/* translators: %s: Taxonomy query variable name */
				__( 'Taxonomy query var "%s" is not allowed', 'extended-cpts' ),
				$query_var
			) ), E_USER_ERROR );
		} else {
			register_taxonomy( $this->taxonomy, $this->object_type, $this->args );
		}

	}
51538
public function register()
    {
        foreach ($this->postTypes as $postType) {
            $this->app['posts.types']->register($postType);
            $this->app['filters']->listen(
                'theme_' . strtolower(class_basename($postType)) . '_templates',
                function ($page_templates) use ($postType) {
                    $laraPressTemplates = [];

                    foreach ($postType::getAvailableTemplates() as $key => $template) {
                        if (is_int($key)) {
                            $key = $template;
                            $template = ucwords(str_replace('-', ' ', $template));
                        }
                        $laraPressTemplates[$key] = $template;
                    }

                    return array_merge($page_templates, $laraPressTemplates);
                }
            );
        }
    }
220385
public function register_post_type_rules( $post_type, $args ) {

		/**
		 * WP_Rewrite.
		 *
		 * @var WP_Rewrite $wp_rewrite
		 */
		global $wp_rewrite;

		if ( $args->_builtin ) {
			return;
		}

		if ( false === $args->rewrite ) {
			return;
		}

		if ( ! in_array( $post_type, CPTP_Util::get_post_types(), true ) ) {
			return;
		}

		$permalink = CPTP_Util::get_permalink_structure( $post_type );

		if ( ! $permalink ) {
			$permalink = CPTP_DEFAULT_PERMALINK;
		}

		$permalink = '%' . $post_type . '_slug%' . $permalink;
		$permalink = str_replace( '%postname%', '%' . $post_type . '%', $permalink );

		add_rewrite_tag( '%' . $post_type . '_slug%', '(' . $args->rewrite['slug'] . ')', 'post_type=' . $post_type . '&slug=' );

		$taxonomies = CPTP_Util::get_taxonomies( true );
		foreach ( $taxonomies as $taxonomy => $objects ) :
			$wp_rewrite->add_rewrite_tag( "%$taxonomy%", '(.+?)', "$taxonomy=" );
		endforeach;

		$rewrite_args = $args->rewrite;
		if ( ! is_array( $rewrite_args ) ) {
			$rewrite_args = array(
				'with_front' => $args->rewrite,
			);
		}

		$slug = $args->rewrite['slug'];
		if ( $args->has_archive ) {
			if ( is_string( $args->has_archive ) ) {
				$slug = $args->has_archive;
			};

			if ( $args->rewrite['with_front'] ) {
				$slug = substr( $wp_rewrite->front, 1 ) . $slug;
			}

			if ( CPTP_Util::get_post_type_date_archive_support( $post_type ) ) {
				$date_front = CPTP_Util::get_date_front( $post_type );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&paged=$matches[2]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type=' . $post_type, 'top' );
			}

			if ( CPTP_Util::get_post_type_author_archive_support( $post_type ) ) {

				add_rewrite_rule( $slug . '/author/([^/]+)/page/?([0-9]{1,})/?$', 'index.php?author_name=$matches[1]&paged=$matches[2]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . '/author/([^/]+)/?$', 'index.php?author_name=$matches[1]&post_type=' . $post_type, 'top' );
			}

			if ( in_array( 'category', $args->taxonomies, true ) ) {

				$category_base = get_option( 'category_base', 'category' );

				add_rewrite_rule( $slug . '/' . $category_base . '/([^/]+)/page/?([0-9]{1,})/?$', 'index.php?category_name=$matches[1]&paged=$matches[2]&post_type=' . $post_type, 'top' );
				add_rewrite_rule( $slug . '/' . $category_base . '/([^/]+)/?$', 'index.php?category_name=$matches[1]&post_type=' . $post_type, 'top' );

			}

			do_action( 'CPTP_registered_' . $post_type . '_rules', $args, $slug );
		}

		$rewrite_args['walk_dirs'] = false;
		add_permastruct( $post_type, $permalink, $rewrite_args );

	}
969147
public function register()
    {
        $this->app['actions']->listen('wp', function()
        {
            if (get_post() !== null && $post = Model::resolveWordpressPostToModel(get_post()))
            {
                $this->app->instance('post', $post);
            }
        });

        $this->registerLoopAndQuery();
        $this->registerPostManager();
        $this->registerPostTypeManager();
        $this->registerPostTypes();
    }
841455
public function register()
    {
        // Store details
        $args = $this->getModel()->getArgs();
        $fields = $this->getModel()->getFields();
        $posttype = $this->getModel()->getPosttype();
        $slug = $this->getModel()->getSlug();

        $is_single = 'single' === $args['choice'] ? true : false;

        // Register post type if not post or page
        if (!in_array($slug, $this->reserved_slugs)) {
            register_taxonomy($slug, $posttype, $args);
        }

        // Works on hook
        $hook = new TermHook($slug, $posttype, $fields, $is_single);
        $this->getModel()->setHook($hook);
    }
624805
public function init() {
		// Registration class runs Filter::add($this) in __construct.
		$registration = new \Boldgrid\Library\Library\Registration();

		// Update class runs Filter::add($this) in __construct.
		$update = new \Boldgrid\Library\Library\Update();

		// PostNewKey class runs Filter::add($this) in __construct.
		$postNewKey = new \Boldgrid\Library\Library\Key\PostNewKey();

		$pluginChecker = new \Boldgrid\Library\Library\Plugin\Checker();
		$pluginChecker->run();

		Configs::setItem( 'menu-external', new Menu\External() );
		Configs::setItem( 'menu-reseller', new Menu\Reseller() );
		Configs::setItem( 'page-connect', new Page\Connect() );
		Configs::setItem( 'assets', new Asset() );
		new Editor();
	}
1229177
public function register()
    {
        register_post_type($this->slug, [
            'labels'      => $this->labels,
            'public'      => $this->public,
            'has_archive' => $this->has_archive,
            'menu_icon'   => 'dashicons-' . $this->icon,
            'supports'    => $this->supports,
            'rewrite'     => [
                'slug' => $this->rewrite->slug,
                'with_front'  => $this->rewrite->with_front
            ]
        ]);
    }
319260
function registerPlugin(type, Plugin) {
    if (!plugins[type]) {
      throw new Error('Attempting to register "' + Plugin + '" as "' + type + '" which is not a valid HTMLBars plugin type.');
    }

    plugins[type].push(Plugin);
  }
794083
public function init()
    {
        // Get services
        $services = $this->getServices();

        // Register all
        foreach ($services as $alias => $service) {
            $this->add($service, $alias);
        }

        // Register configurations
        $this->initConfigs();

        // Register post types / terms / widgets / admin pages and more
        $this->registerComponents();
    }
1069264
final protected function initPostTypesTrait() {
		add_action("init", function () {
			$postTypes = $this->getPostTypes();
			foreach ($postTypes as $postType) {
				$this->registerPostType($postType);
			}
		});
	}
1135290
protected function registerPostProvider()
    {
        $this->app->bindShared('postprovider', function ($app) {
            $model = $app['config']['graham-campbell/cms-core::post'];
            $post = new $model();

            return new Providers\PostProvider($post);
        });
    }
362656
def register(cls, name, type_):
        

        if not issubclass(type_, Entry):
            raise exceptions.InvalidEntryType("%s is not a subclass of Entry" % str(type_))
        cls._registry[name.lower()] = type_