Skip to content

Instantly share code, notes, and snippets.

View pippinsplugins's full-sized avatar

Pippin Williamson pippinsplugins

View GitHub Profile
@pippinsplugins
pippinsplugins / paypal-standard.php
Created May 31, 2012 15:31
New PayPal Standard for EDD
<?php
/**
* PayPal Standard Gateway
*
* @package Easy Digital Downloads
* @subpackage PayPal Standard Gateway
* @copyright Copyright (c) 2012, Pippin Williamson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/
@pippinsplugins
pippinsplugins / edd_labels.php
Created June 15, 2012 02:03
Change EDD Download Labels Globally
<?php
function pw_edd_global_labels($labels) {
$labels = array(
'singular' => __('Singular Label','edd'),
'plural' => __('Plural Label','edd')
);
return $labels;
}
add_filter('edd_default_downloads_name', 'pw_edd_global_labels');
@pippinsplugins
pippinsplugins / edd_discount_label.php
Created June 15, 2012 02:16
Change the Discount Code label in Easy Digital Downloads
<?php
function pw_edd_discount_label( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'Enter discount':
$translated_text = 'Enter Discount Code Here';
break;
}
@pippinsplugins
pippinsplugins / edd_email_conf.php
Last active December 5, 2021 15:59
Add email confirmation to EDD
<?php
function pw_edd_add_email_confirmation() {
?>
<p>
<label class="edd-label" for="edd-email-confirm">
<?php _e('Confirm Your Email Address', 'easy-digital-downloads'); ?>
<span class="edd-required-indicator">*</span>
</label>
<span class="edd-description" id="edd-email-description"><?php esc_html_e( 'Please confirm your email address.', 'easy-digital-downloads' ); ?></span>
@pippinsplugins
pippinsplugins / Filter Events
Created June 29, 2012 14:40 — forked from stompweb/filter-events.php
Filter events pre_get_posts
// Function to display only upcoming events for Sugar Events Calendar on the main Events archive.
function sc_filter_events( $query ) {
if( is_post_type_archive('sc_event') && (!is_admin()) ) {
$meta = array(
array(
'key' => 'sc_event_date_time',
'value' => time(),
@pippinsplugins
pippinsplugins / edd_statuses.php
Created July 5, 2012 22:30
Register Custom EDD payment Statuses
<?php
function pippin_edd_extra_statuses( $statuses ) {
$statues['your_status_id'] => 'Your Status Label';
$statues['your_second_status_id'] => 'Your Second Status Label';
return $statuses
}
add_filter('edd_payment_statuses', 'pippin_edd_extra_statuses');
@pippinsplugins
pippinsplugins / wrapper.php
Created July 17, 2012 00:02 — forked from anointed/finished.php
Filter to apply a div before menu output
<?php
function tumble_menu( $args = array() ) {
/* Default arguments */
$defaults = array(
'container' => 'ul',
'menu_class' => 'nav',
'menu_id' => 'top_nav',
'theme_location' => 'top-menu',
'echo' => false,
'before' => '',
@pippinsplugins
pippinsplugins / edd_emails.php
Created July 19, 2012 12:56
Remove list indention
<?php
function edd_remove_list_indention( $email_body ) {
$email_body = str_replace('<ul>', '<ul style="margin:0 0 10px;padding:0;">', $email_body);
$email_body = str_replace('<li>', '<li style="margin:0 0 8px;padding:0;">', $email_body);
return $email_body;
}
add_filter('edd_purchase_receipt_default', 'edd_remove_list_indention');
<?php
function ecpt_include_post_types_in_search($query) {
if( $query->is_main_query() && is_search() && $query->query_vars['post_type'] != 'nav_menu_item' ) {
$post_types = get_post_types(array('exclude_from_search' => false), 'objects');
$searchable_types = array();
if($post_types) {
foreach( $post_types as $type) {
$searchable_types[] = $type->name;
}
/**
* Retrieve current sidebar ID for a location.
*
* @since 2.0.0
*
* @param string $location the location for the sidebar
* @return string $id the id of the sidebar that should be shown
*/
if( ! function_exists( 'themeblvd_get_sidebar_id' ) ) {