Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variable returned value [string or array] #18

Open
ramvyr opened this issue Jun 27, 2020 · 0 comments
Open

Add variable returned value [string or array] #18

ramvyr opened this issue Jun 27, 2020 · 0 comments

Comments

@ramvyr
Copy link

ramvyr commented Jun 27, 2020

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;
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant