Created
January 31, 2018 11:50
-
-
Save wpmudev-sls/10d72500494c5b5808b5288cddafc55e to your computer and use it in GitHub Desktop.
Modify/Remove Appointment details fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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