This file contains hidden or 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 | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; | |
| } | |
| /** | |
| * Sample instance based method. | |
| */ | |
| class WC_Shipping_Test_Method extends WC_Shipping_Method { |
This file contains hidden or 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
| add_action("wplc_hook_push_js_to_front", "my_function"); //Our Hook | |
| function my_function(){ //Our Function | |
| $post_id = url_to_postid($url); //Get Post ID | |
| if($post_id === 3){ //Post ID matches '3' | |
| //More complicated logic could be added | |
| $user_id = 5; //Set the new user ID - You would need your own logic here | |
| change_active_agent($user_id); //Set the active agent to '$user_id' | |
| } |
This file contains hidden or 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
| /** | |
| * Opens the chat window (both online/offline) instead of having to click on the hover card's 'Send Message' or 'Start Chat' button. | |
| */ | |
| jQuery(document).ready(function(){ | |
| jQuery("body").on("click", "#wp-live-chat-header", function(){ | |
| setTimeout(function(){ | |
| jQuery("#wplc_start_chat_btn").click(); | |
| jQuery("#speeching_button").click(); | |
| }, 300); |
This file contains hidden or 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
| add_filter( 'wplc_ma_filter_menu_control', 'wplc_custom_settings_permission_plug', 11, 1 ); | |
| function wplc_custom_settings_permission_plug( $array ){ | |
| $array[1] = 'manage_options'; | |
| $array[3] = 'manage_options'; | |
| return $array; | |
| } |
This file contains hidden or 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
| add_action( 'init', 'wplc_remove_non_agent_menu_items' ); | |
| function wplc_remove_non_agent_menu_items(){ | |
| if( !current_user_can( 'manage_options' ) ){ | |
| remove_action('admin_menu', 'wplc_admin_menu_pro'); | |
| remove_action('admin_menu', 'wplc_admin_menu', 4); | |
| add_action('admin_menu', 'wplc_new_agent_dashboard' ); |
This file contains hidden or 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
| jQuery(document).on('wplc_animation_done', function(){ | |
| var should_hide = Cookies.get('wplc_prevent_popup'); | |
| if( should_hide == '1' && typeof should_hide != 'undefined' ){ | |
| jQuery("#wplc_hovercard").hide(); | |
| } else { | |
| jQuery("#wplc_hovercard").fadeIn(); | |
| jQuery("#wp-live-chat-header").addClass('active'); | |
| } | |
| jQuery("#wp-live-chat-header").on("click", function(){ | |
| if( jQuery(this).hasClass('active' ) ){ |
This file contains hidden or 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
| /** | |
| * Creates the endpoint /get_tickets to return tickets from a specific number of days ago, or between two dates. | |
| * Pagination is supported. | |
| * Dates are required to be in a formatted string | |
| */ | |
| add_action( 'nifty_desk_api_route_hook', 'nifty_desk_api_route_get_all_tickets' ); | |
| function nifty_desk_api_route_get_all_tickets(){ |
This file contains hidden or 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
| add_shortcode( 'wpgmza_total_markers', 'wpgmza_total_marker_count' ); | |
| function wpgmza_total_marker_count( $atts ){ | |
| $atts = shortcode_atts( array( | |
| 'id' => 1, | |
| ), $atts, 'wpgmza_total_markers' ); | |
| $map_id = intval( $atts['id'] ); |
This file contains hidden or 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
| .wpgmza_map * { | |
| transition-timing-function: initial !important; | |
| -moz-transition-timing-function: initial !important; | |
| -webkit-transition-timing-function: initial !important; | |
| -o-transition-timing-function: initial !important; | |
| transition-duration: initial !important; | |
| -moz-transition-duration: initial !important; | |
| -webkit-transition-duration: initial !important; | |
| -o-transition-duration: initial !important; | |
| } |
This file contains hidden or 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
| jQuery(document).ready(function(){ | |
| var popup_string = "<div class='wplc_custom_popup'>"; | |
| popup_string = popup_string + "<p>Can we help you?</p>"; | |
| popup_string = popup_string + "<button class='custom_popup_open_chat'>Yes</button>"; | |
| popup_string = popup_string + "<button class='custom_popup_close_chat'>No</button>"; | |
| popup_string = popup_string + "</div>"; | |
| var show_popup = Cookies.get( 'wplc_chat_popup_window' ); |
OlderNewer