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 | |
| /** | |
| * PDF Included With Form Submission | |
| * | |
| * @author Patrick Rauland | |
| * @version 1.0.0 | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
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
| html { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| header { | |
| background-color: #ef4748; | |
| margin-bottom: 20px; | |
| padding: 20px 20px 0 20px; | |
| } | |
| #main { |
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 | |
| /** | |
| * PDF Included With Form Submission | |
| * | |
| * @author Patrick Rauland | |
| * @version 1.0.0 | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
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: WooCommerce Demo Plugin | |
| * Plugin URI: https://gist.github.com/BFTrick/3ab411e7cec43eff9769 | |
| * Description: A WooCommerce demo plugin | |
| * Author: Patrick Rauland | |
| * Author URI: http://speakinginbytes.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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: WooCommerce Add CSS to Emails | |
| * Plugin URI: https://gist.github.com/BFTrick/01cc414ee56ce93715ec | |
| * Description: Add CSS styles to WooCommerce emails | |
| * Author: Patrick Rauland | |
| * Author URI: http://speakinginbytes.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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: WooCommerce Send Email | |
| * Plugin URI: https://gist.github.com/BFTrick/9bd089bc53b11f7ac3fb | |
| * Description: Send an email when a page loads. Useful for testing email functionality. | |
| * Author: Patrick Rauland | |
| * Author URI: http://speakinginbytes.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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
| /** | |
| * Validate the API key | |
| * @see validate_settings_fields() | |
| */ | |
| public function validate_api_key_field( $key ) { | |
| // get the posted value | |
| $value = $_POST[ $this->plugin_id . $this->id . '_' . $key ]; | |
| // check if the API key is longer than 20 characters. Our imaginary API doesn't create keys that large so something must be wrong. Throw an error which will prevent the user from saving. | |
| if ( isset( $value ) && |
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
| /** | |
| * Init and hook in the integration. | |
| */ | |
| public function __construct() { | |
| // do other constructor stuff first | |
| // Filters. | |
| add_filter( 'woocommerce_settings_api_sanitized_fields_' . $this->id, array( $this, 'sanitize_settings' ) ); |
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
| /** | |
| * Initialize integration settings form fields. | |
| * | |
| * @return void | |
| */ | |
| public function init_form_fields() { | |
| $this->form_fields = array( | |
| // don't forget to put your other settings here | |
| 'customize_button' => array( |