Skip to content

Instantly share code, notes, and snippets.

@wpmudev-sls
Created January 31, 2018 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmudev-sls/10d72500494c5b5808b5288cddafc55e to your computer and use it in GitHub Desktop.
Save wpmudev-sls/10d72500494c5b5808b5288cddafc55e to your computer and use it in GitHub Desktop.
Modify/Remove Appointment details fields
<?php
/**
* Plugin Name: Modify Appointment Details Fields
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin will help to modify/Remove Appointment details fields
* Author: Ariful Islam @ WPMUDEV
* Author URI: https://premium.wpmudev.org/profile/itsarifulislam
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Appointment_Details_Modify' ) ) {
class Appointment_Details_Modify {
private static $_instance = null;
public static function get_instance() {
if( is_null( self::$_instance ) ) {
self::$_instance = new Appointment_Details_Modify();
}
return self::$_instance;
}
private function __construct() {
add_filter('app_additional_fields', array( $this, 'app_additional_fields' ), 10, 1);
}
public function app_additional_fields( $fields ) {
// Remove Service Name
$fields = str_replace('<div class="appointments-confirmation-service"></div>', "", $fields);
// Remove Provider Name
$fields = str_replace('<div class="appointments-confirmation-worker" style="display:none"></div>', "", $fields);
return $fields;
}
}
function render_appointment_details_modify(){
$GLOBALS['Appointment_Details_Modify'] = Appointment_Details_Modify::get_instance();
}
add_action( 'plugins_loaded', 'render_appointment_details_modify' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment