Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.