Skip to content

Add variable returned value [string or array] #18

@ramvyr

Description

@ramvyr

In order to use the image selection only in the admin panel, and use the selected value in the template, and not the image link

	function format_value($value, $post_id, $field)
	{
		// bail early if no value
		if( empty($value) ) {
			return $value;	
		}
		// get value
		$retvalue['value'] = $value;
		$retvalue['image'] = $field['image_path'] . esc_attr($value) . '.'.$field['image_extension'];

		// format value

		// return value
		return $retvalue;
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions