INVP::translate_custom_field_names( string $nice_name )

translate_custom_field_names


Description Description

Prefixes our post meta field keys so 'make' becomes 'inventory_presser_make'. Careful to not prefix a key that has already been prefixed.


Top ↑

Parameters Parameters

$nice_name

(string) (Required) The unprefixed meta key.


Top ↑

Return Return

(string) The prefixed meta key.


Top ↑

Source Source

File: includes/class-invp.php

	public static function translate_custom_field_names( $nice_name )
	{
		$nice_name = strtolower( $nice_name );
		$prefix = INVP::meta_prefix();

		if( $prefix == substr( $nice_name, 0, strlen( $prefix ) ) )
		{
			return $nice_name;
		}
		return $prefix . $nice_name;
	}