MP_BaseLeadSettings::register_leads( string $lead, array $labels_array = array(), string $label = 'Lead', string $labels = 'Leads', int $position = 100 )

Register Post Type Leads.


Parameters Parameters

$lead

(string) (Required) post type key

$labels_array

(array) (Optional)

Default value: array()

$label

(string) (Optional) label

Default value: 'Lead'

$labels

(string) (Optional) labels

Default value: 'Leads'

$position

(int) (Optional) position

Default value: 100


Top ↑

Return Return

(WP_Error|WP_Post_Type)


Top ↑

Source Source

File: mortgage-platform/Inc/Base/MP_BaseLeadSettings.php

	protected function register_leads( $lead, $labels_array = array(), $label = 'Lead', $labels = 'Leads', $position = 100 ) {

		if ( ! empty( $labels_array ) ) {
			$array = $labels_array;
		} else {
			$array = array(
				'name'               => $labels,
				'singular_name'      => $label,
				'add_new'            => __( 'Add ', 'mortgage_platform' ) . $label,
				'add_new_item'       => __( 'Add new ', 'mortgage_platform' ) . $label,
				'edit_item'          => __( 'Edit ', 'mortgage_platform' ) . $label,
				'new_item'           => __( 'New ', 'mortgage_platform' ) . $label,
				'view_item'          => __( 'Look ', 'mortgage_platform' ) . $label,
				'search_items'       => __( 'Find ', 'mortgage_platform' ) . $label,
				'not_found'          => $labels . __( ' not found', 'mortgage_platform' ),
				'not_found_in_trash' => __( 'At cart ', 'mortgage_platform' ) . $labels . __( ' not found', 'mortgage_platform' ),
				'parent_item_colon'  => '',
				'menu_name'          => $labels,

			);
		}

		$post_type = register_post_type(
			$lead,
			array(
				'labels'              => $array,
				'public'              => false,
				'publicly_queryable'  => false,
				'show_ui'             => true,
				'show_in_menu'        => MortgagePlatform::$domain,
				'query_var'           => true,
				'show_in_rest'        => false,
				'exclude_from_search' => false,
				'rewrite'             => false,
				'show_in_nav_menus'   => false,
				'show_in_admin_bar'   => false,
				'capability_type'     => 'post',
				'has_archive'         => false,
				'hierarchical'        => false,
				'menu_position'       => $position,
				'supports'            => array( 'title' ),
			)
		);

		return $post_type;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.