Post_Type::__construct()

Constructor.

Contents


Source

File: src/Events_Pro/Custom_Tables/V1/Series/Post_Type.php

	public function __construct() {
		$this->singular_label           = $this->get_label_singular();
		$this->singular_label_lowercase = $this->get_label_singular_lowercase();
		$this->plural_label             = $this->get_label_plural();
		$this->plural_label_lowercase   = $this->get_label_plural_lowercase();

		$this->post_type_args['rewrite']['slug'] = tribe( 'events.rewrite' )->prepare_slug( $this->singular_label, static::POSTTYPE, false );
		$this->post_type_args['label']           = $this->plural_label;
		$this->post_type_args['show_in_menu']    = sprintf( 'edit.php?post_type=%s', TEC::POSTTYPE );

		/**
		 * Provides an opportunity to modify the labels used for the series post type.
		 *
		 * @since 6.0.0
		 *
		 * @param array $args Array of arguments for register_post_type labels
		 */
		$this->post_type_args['labels'] = apply_filters( 'tribe_events_register_series_post_type_labels', [
			'name'                     => $this->plural_label,
			'singular_name'            => $this->singular_label,
			'singular_name_lowercase'  => $this->singular_label_lowercase,
			'plural_name_lowercase'    => $this->plural_label_lowercase,
			'add_new'                  => esc_html__( 'Add New', 'tribe-events-calendar-pro' ),
			'add_new_item'             => sprintf( esc_html__( 'Add New %s', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'edit_item'                => sprintf( esc_html__( 'Edit %s', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'new_item'                 => sprintf( esc_html__( 'New %s', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'view_item'                => sprintf( esc_html__( 'View %s', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'search_items'             => sprintf( esc_html__( 'Search %s', 'tribe-events-calendar-pro' ), $this->plural_label ),
			'not_found'                => sprintf( esc_html__( 'No %s found', 'tribe-events-calendar-pro' ), $this->plural_label_lowercase ),
			'not_found_in_trash'       => sprintf( esc_html__( 'No %s found in Trash', 'tribe-events-calendar-pro' ), $this->plural_label_lowercase ),
			'item_published'           => sprintf( esc_html__( '%s published.', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'item_published_privately' => sprintf( esc_html__( '%s published privately.', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'item_reverted_to_draft'   => sprintf( esc_html__( '%s reverted to draft.', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'item_scheduled'           => sprintf( esc_html__( '%s scheduled.', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'item_updated'             => sprintf( esc_html__( '%s updated.', 'tribe-events-calendar-pro' ), $this->singular_label ),
			'item_link'                => sprintf(
			// Translators: %s: Series singular.
				esc_html__( '%s Link', 'tribe-events-calendar-pro' ), $this->singular_label
			),
			'item_link_description'    => sprintf(
			// Translators: %s: Series singular.
				esc_html__( 'A link to a particular %s.', 'tribe-events-calendar-pro' ), $this->singular_label
			),
		] );
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.