Astra_SureCart::customize_surecart_title_area( string $title, string $post_type, boolean $singular = false )

Method to customize SureCart single title area.


Description


Parameters

$title

(string) (Required) Title Area label.

$post_type

(string) (Required) Current post type.

$singular

(boolean) (Optional) Whether singular or plural.

Default value: false


Return

(string) Returns customized label for title area.


Source

File: inc/compatibility/surecart/class-astra-surecart.php

	public function customize_surecart_title_area( $title, $post_type, $singular = false ) {
		$surecart_titles = array(
			'sc_product'  => array(
				'single'  =>  __( 'Product', 'astra' ),
				'archive' => __( 'Products', 'astra' ),
			),
			'sc_collection' => array(
				'single'  =>  __( 'Collection', 'astra' ),
				'archive' => __( 'Collections', 'astra' ),
			),
			'sc_upsell'   => array(
				'single'  =>  __( 'Upsell', 'astra' ),
				'archive' => __( 'Upsells', 'astra' ),
			),
		);

		$type = $singular ? 'single' : 'archive';
		// Check for SureCart's post types and customize the title.
		if ( isset( $surecart_titles[ $post_type ][ $type ] ) ) {
			$title_area_suffix = ' ' . __( 'Title Area', 'astra' );
			return $surecart_titles[ $post_type ][ $type ] . $title_area_suffix;
		}

		return $title;
	}

Changelog

Changelog
Version Description
4.7.3 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.