Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

llms_engagement_handle_deprecated_meta_keys( string $val, int $obj_id, string $key )

Handle earned engagement deprecated meta keys.

Description Description

Throws a deprecation warning and replaces the default value with the new value.

This public function is intentionally marked as private to denote it’s temporary lifespan. This function will be removed in the next major release when the associated meta key is also fully removed.

Top ↑

Parameters Parameters


(string) (Required) Meta value.


(int) (Required) Object ID.


(string) (Required) Meta key.

Top ↑

Return Return


Top ↑

Source Source

File: includes/functions/llms-functions-deprecated.php

function llms_engagement_handle_deprecated_meta_keys( $val, $obj_id, $key ) {

	$deprecated = array(
		'_llms_certificate_content' => 'llms_earned_engagement_deprecated_content',
		'_llms_achievement_content' => 'llms_earned_engagement_deprecated_content',

		'_llms_certificate_title' => 'llms_earned_engagement_deprecated_title',
		'_llms_achievement_title' => 'llms_earned_engagement_deprecated_title',

		'_llms_certificate_image' => 'llms_earned_engagement_deprecated_image',
		'_llms_achievement_image' => 'llms_earned_engagement_deprecated_image',

		'_llms_certificate_template' => 'llms_earned_engagement_deprecated_template',
		'_llms_achievement_template' => 'llms_earned_engagement_deprecated_template',

	if ( array_key_exists( $key, $deprecated ) ) {

		$post_type = get_post_type( $obj_id );
		if ( in_array( $post_type, array( 'llms_my_achievement', 'llms_my_certificate' ), true ) ) {

			$class = 'LLMS_User_' . strtoupper( str_replace( 'llms_my_', '', $post_type ) );
			return $deprecated[ $key ]( $val, new $class( $obj_id ) );


	return $val;

Top ↑

Changelog Changelog

Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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