1. Home
  2. Docs
  3. Developer Guide
  4. Miscellaneous and Snippet...
  5. Remove Multiple Floorplan Buttons

Remove Multiple Floorplan Buttons

add_filter( 'propertyhive_single_property_actions', 'remove_multiple_floorplan_buttons' );
function remove_multiple_floorplan_buttons($actions)
{
    $new_actions = array();
    $floorplan_i = 0;
    foreach ( $actions as $action )
    {
        if ( $action['class'] == 'action-floorplans' )
        {
            if ( $floorplan_i > 0 )
            {
                $action['attributes']['style'] = 'display:none';
            }
            ++$floorplan_i;
        }
        $new_actions[] = $action;
    }
    return $new_actions;
}
Was this article helpful to you? No Yes

How can we help?