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( 'PAYPAL_PAYMENT_LIVE_URL' ) ) | |
define( 'PAYPAL_PAYMENT_LIVE_URL', 'https://www.paypal.com/cgi-bin/webscr' ); | |
if ( !defined( 'PAYPAL_PAYMENT_SANDBOX_URL' ) ) | |
define( 'PAYPAL_PAYMENT_SANDBOX_URL', 'https://www.sandbox.paypal.com/cgi-bin/webscr' ); | |
/* Insecure */ | |
function insecure_paypal_payment_url() { | |
$paypal_email = '[email protected]'; |
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 | |
$email = $_POST['email']; | |
$phone = $_POST['phone']; | |
$first_name = $_POST['fname']; | |
$last_name = $_POST['lname']; | |
try { | |
require_once('Stripe/init.php'); | |
// Use Stripe's library to make requests... |
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 | |
/** | |
* Class PostContentAppender | |
*/ | |
class PostContentAppender { | |
protected $append = ''; | |
public function __construct( $append ) { |
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 | |
/** | |
* Insert a value or key/value pair before a specific key in an array. If key doesn't exist, value is prepended | |
* to the beginning of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
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 | |
/** | |
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended | |
* to the end of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
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 | |
/** | |
* Drop this code into your main plugin file to hide plugin deactivation from the WordPress admin. | |
*/ | |
add_filter( 'plugin_action_links', function ( $actions, $plugin_file ) { | |
if ( plugin_basename( __FILE__ ) === $plugin_file ) { | |
unset( $actions['deactivate'] ); | |
} |
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
/** | |
* Forces all PDF links to download automatically, if the browser supports it. | |
* Otherwise, open the link in a new browser window or tab. | |
*/ | |
jQuery(document).ready(function($) { | |
$('a[href$=".pdf"]') | |
.attr('download', '') | |
.attr('target', '_blank'); | |
}); |