1. Docs
  2. Developer Guide
  3. Miscellaneous and Snippets
  4. 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? Yes No