Function Reference: geodir_payments_description_field_desc_limit_msg


Filter the listing description limit message.

Global Values

(object) (required) The current post object.

Default: None


(string) (required) The limit message string if any.

Default: None
(int) (required) The character limit number if any.

Default: None

Return Values

  • limit message if any.

Change Log

Since: 1.0.0

Source Code

function geodir_payments_description_field_desc_limit_msg($desc_msg, $desc_count) {
	global $post;
	$package_info = geodir_post_package_info(array(), $post);
	$desc_limit_enabled = geodir_payments_desc_limit_enabled($package_info);
	if ($desc_limit_enabled) {
		if ((int)$desc_count>0) {
			$desc_msg = __('For description you can use up to %d characters only for this package.', 'geodir_payments');
			if (strpos($desc_msg, '%d')!==false) {
				$desc_msg = sprintf($desc_msg, $desc_count);
		} else {
			$desc_msg = __('You can not add description for this package.', 'geodir_payments');
		add_filter( 'tiny_mce_before_init', 'geodir_payments_add_idle_function_to_tinymce' );
	return $desc_msg;