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
public class DataDisplayController { | |
public String PDFData {get; set;} | |
public DataDisplayController(){ | |
PDFData = ''; | |
} | |
public PageReference downloadPDF(){ | |
System.PageReference pageRef = new System.PageReference('/apex/PDFGenerator'); | |
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
<script> | |
function printDiv(divName){ | |
var printContents = document.getElementById(divName).innerHTML; | |
var originalContents = document.body.innerHTML; | |
document.body.innerHTML = printContents; | |
window.print(); | |
document.body.innerHTML = originalContents; |
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
// We are using the WooCommerce Checkout Field Editor plugin in addition to WooCommerce. The Checkout Field Editor | |
// does a nice job at providing a UI for manage additional fields. But doesn't provide any method to do validations. | |
// So this code helps with that on a very specific implemention where we have a Gender select and a DoB date selector. | |
// On the Gender we want to ensure the selected value is 'Male' or 'Female' only. We don't want the | |
default option 'Choose Option' to be valid. On the DoB we want to enforce the user is 18 or older. | |
add_action( 'woocommerce_after_checkout_validation', 'woo_checkout_additional_field_validation' ); | |
function woo_checkout_additional_field_validation() { | |
if (!defined('WOOCOMMERCE_CHECKOUT')) { | |
return; |
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 // DON'T COPY THIS LINE | |
if ( class_exists( 'EDD_Front_End_Submissions' ) ) { | |
function custom_vendor_dashboard_menu() { | |
$menu_items = array(); | |
// Dashboard tab | |
$menu_items['home'] = array( | |
"icon" => "home", | |
"task" => array( 'dashboard', '' ), |
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
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |