Appointment+ - Hiding the visibility of certain aspects of the backend

Hi,

I have a few questions with regards to hiding some elements of the appointment+ dashboard. I want the customer to have access to some of the fields but not all of them.

In the area: "Appointments > Settings", I wondered if it's possible to hide the following:

1 - "Google Calendar" tab, "Add ons" tab and the "Logs" tab entirely.

2 - Change the name Services Providers to something else

3 - XLS Export - remove fields that are not being used by the system, so this looks simpler

4 - When editing an appointment that has been made, is it possible to hide the visibility of default fields not being used within the form, such as price etc.

That's about it - any feedback would be greatly appreciated.

Many Thanks

  • Ivan Shulev

    Hey Nathan ,

    I hope you are having a nice day so far!

    Please add the following suggestions either as a must use plugin or any code snippet plugin.

    1 - "Google Calendar" tab, "Add ons" tab and the "Logs" tab entirely.

    add_action( 'admin_head', 'wpmu_5433_custom_admin_css' );
    function wpmu_5433_custom_admin_css(){ ?>
    	<style>
    		a#app_tab_gcal, a#app_tab_addons, a#app_tab_log {
    			display: none;
    		}
    	</style>
    <?php
    }

    2 - Change the name Services Providers to something else

    add_action('admin_footer', 'wpmu_5433_custom_admin_script');
    function wpmu_5433_custom_admin_script() { ?>
    	<script>
    		(function() {
    			var tabWorkers = document.getElementById('app_tab_workers');
    			if(null !== tabWorkers) {
    				tabWorkers.innerHTML="WHATEVER YOU WANT";
    			}
    		})();
    	</script>
    <?php }

    3 and 4 will be a bit trickier. If you want specific fields to be hidden every time, please point them out so we can provide the code.

    I hope this helps and I wish you an awesome day ahead!

    Ivan

  • Nathan

    Wow! That's incredibly helpful! Thank you! With regards to the other points:

    Point 3 - (XLS Export ) fields to be hidden, we need the following fields hidden:

    id
    created
    user
    city
    location
    price
    sent
    sent_worker
    note
    gcal_id
    gcal_updated

    For point 4 - When editing an appointment that has been made, we would like to hide the following:

    City
    Comments
    Price

    Again - thank you very much for your helpful support, it's very much appreciated.

  • Ivan Shulev

    Hey Nathan ,

    I hope you are having a nice day so far!

    For 3, please use the following code:

    function wpmu_5433_remove_export_columns($default_columns) {
    	$columns_to_remove = array('ID', 'created', 'user', 'city', 'location', 'price', 'sent', 'sent_worker', 'note', 'gcal_ID', 'gcal_updated');
    
    	$filtered_columns = array_diff($default_columns,$columns_to_remove);
    	return $filtered_columns;
    }
    add_filter('app-export-columns', 'wpmu_5433_remove_export_columns');
    
    function wpmu_5433_remove_export_columndata($app) {
    	$columns_to_remove = array('ID', 'created', 'user', 'city', 'location', 'price', 'sent', 'sent_worker', 'note', 'gcal_ID', 'gcal_updated');
    	$flipped_columns = array_flip($columns_to_remove);
    	$filtered_data = array_diff_key($app, $flipped_columns);
    	return $filtered_data;
    }
    add_filter('app-export-appointment', 'wpmu_5433_remove_export_columndata');

    For 4, please add the following code, which should replace the one I gave you above for question 1:

    add_action( 'admin_head', 'wpmu_5433_custom_admin_css' );
    function wpmu_5433_custom_admin_css(){ ?>
    	<style>
    		a#app_tab_gcal, a#app_tab_addons, a#app_tab_log {
    			display: none;
    		}
    		body.toplevel_page_appointments table.appointments #the-list .inline-edit-col-left .inline-edit-col > label:last-child, body.toplevel_page_appointments table.appointments #the-list .inline-edit-col-center .inline-edit-col > label:last-child {
    			display: none;
    		}
    	</style>
    <?php
    }

    I am just having trouble finding the Comments section for the appointments. Please make a screenshot so I am certain what you are referring to.

    I hope this helps and I wish you an awesome day ahead!

    Ivan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.