epl_button_floor_plan

This action runs when a floor plan link is present in a listing and is displayed when the epl_buttons_single_property is run.

Since EPL v1.0

add_action('epl_buttons_single_property', 'epl_button_floor_plan');

Full epl_button_floor_plan action viewable here.

If you want to replace the Floor Plan action with your own custom function you need to disable the action.

remove_action('epl_buttons_single_property', 'epl_button_floor_plan');

Now that the function is disabled you can hook your own floor plan function and modify its output and display.

function my_custom_floor_plan_button() {
	$floor_plan	= get_post_meta( get_the_ID() , 'property_floorplan' , true );
	$floor_plan_2	= get_post_meta( get_the_ID() , 'property_floorplan_2' , true );
	
	$links = array();
	if(!empty($floor_plan)) {
		$links[] = $floor_plan;
	}
	if(!empty($floor_plan_2)) {
		$links[] = $floor_plan_2;
	}
	if ( !empty($links) ) {
		foreach ( $links as $k=>$link ) {
			if(!empty($link)) {
				$number_string = '';
				if($k > 0) {
					$number_string = ' ' . $k + 1;
				}
				// Adjust the following to achieve your desired output
				?><span class="epl-floor-plan-button-wrapper<?php echo $number_string; ?>">
				<button type="button" class="epl-button epl-floor-plan" onclick="location.href='<?php echo $link; ?>'"><?php echo apply_filters( 'epl_button_label_floorplan' , __('Floor Plan', 'epl') ) . $number_string; ?></button></span><?php
			}
		}
	}
}
add_action('epl_buttons_single_property', 'my_custom_floor_plan_button');