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("gform_address_types", "us_address", 10, 2); | |
function us_address($address_types, $form_id){ | |
$address_types["us"] = array( | |
"label" => "United States", | |
"country" => "USAB", | |
"zip_label" => "Zip Code", | |
"state_label" => "State", | |
"states" => array( | |
"" => "", | |
"AL" => "Alabama", |
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 | |
add_action( 'issue_to_pdf_after_pdf_init', 'my_func_show_watermark', 10 ); | |
function my_func_show_watermark( $mpdf ) { | |
$mpdf->SetWatermarkText('DRAFT'); | |
$mpdf->showWatermarkText = true; | |
} |
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
<form method="post" action=""> | |
<input id="first-name" type="text" name="emma_first_name" placeholder="First Name"> | |
<input id="last-name" type="text" name="emma_last_name" placeholder="Last Name"> | |
<input id="email-address" type="text" name="emma_email" placeholder="Email Address"> | |
<input id="submit" type="submit" value="Submit"> | |
</form> |
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 | |
function add_user_to_emma( $data ) { | |
// http://api.myemma.com/ | |
// Emma Authentication Variables | |
$account_id = "#"; // add your account id | |
$public_api_key = "#"; // add your public api key | |
$private_api_key = "#"; // add your private api key |
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 | |
add_action('admin_init', 'endo_stock_report_admin_init'); | |
function endo_stock_report_admin_init() { | |
global $plugin_page; | |
if ( isset($_POST['download_csv']) && $plugin_page == 'endo_stock_report' ) { | |
generate_stock_report_csv(); |
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 | |
function generate_stock_report_csv() { | |
// output headers so that the file is downloaded rather than displayed | |
header('Content-Type: text/csv; charset=utf-8'); | |
// set file name with current date | |
header('Content-Disposition: attachment; filename=endo-stock-report-' . date('Y-m-d') . '.csv'); |
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 | |
/** | |
* Plugin Name: Endo Stock Report Exporter | |
* Plugin URI: http://www.endocreative.com | |
* Description: A custom stock report exporter plugin for WooCommerce | |
* Version: 1.0.0 | |
* Author: Endo Creative | |
* Author URI: http://www.endocreative.com | |
* License: GPL2 | |
*/ |
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 | |
// don't allow users to access WordPress admin | |
add_action('admin_init', 'endo_hide_dashboard'); | |
function endo_hide_dashboard() { | |
if ( ! current_user_can( 'manage_options' ) && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
wp_redirect(home_url()); exit; | |
} | |
} |