LLMS_Post_Relationships::delete_product_with_active_subscriptions_error_message( int $post_id )

Returns the error message to display when deleting a product with active subscriptions.


Parameters Parameters

$post_id

(int) (Required) The WP_Post ID of the product.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class.llms.post.relationships.php

	public static function delete_product_with_active_subscriptions_error_message( $post_id ) {

		$post_type = get_post_type( $post_id );

		if ( ! in_array( $post_type, array( 'course', 'llms_membership' ), true ) ) {
			return '';
		}

		$post_type_object = get_post_type_object( $post_type );
		$post_type_name   = $post_type_object->labels->name;
		return sprintf(
			// Translators: %s = The post type plural name.
			__( 'Sorry, you are not allowed to delete %s with active subscriptions.', 'lifterlms' ),
			$post_type_name
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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