Skip to content

Instantly share code, notes, and snippets.

Enterprise Branding EnterpriseBranding

Block or report user

Report or block EnterpriseBranding

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View personalize-woocommerce-thank-you-page.php
<?php
add_filter( 'the_title', 'woo_personalize_order_received_title', 10, 2 );
function woo_personalize_order_received_title( $title, $id ) {
if ( is_order_received_page() && get_the_ID() === $id ) {
global $wp;
// Get the order. Line 9 to 17 are present in order_received() in includes/shortcodes/class-wc-shortcode-checkout.php file
$order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) );
$order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) );
@EnterpriseBranding
EnterpriseBranding / woocommerce-change-order-received-text2.php
Created May 28, 2019 — forked from vishalck/woocommerce-change-order-received-text2.php
Change Text & Add External Link on Order Received Page in WooCommerce
View woocommerce-change-order-received-text2.php
<?php
add_filter('woocommerce_thankyou_order_received_text', 'woo_change_order_received_text', 10, 2 );
function woo_change_order_received_text( $str, $order ) {
$new_str = 'We have emailed the purchase receipt to you. Please make sure to fill <a href="http://localhost:8888/some-form.pdf">this form</a> before attending the event';
return $new_str;
}
View woocommerce-custom-thank-you-page-redirect.php
<?php
add_action( 'template_redirect', 'woo_custom_redirect_after_purchase' );
function woo_custom_redirect_after_purchase() {
global $wp;
if ( is_checkout() && !empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( 'http://localhost:8888/woocommerce/custom-thank-you/' );
exit;
}
}
View Oxygen Woocommerce Products Listing code block
<?php
/**
* Hook: woocommerce_before_main_content.
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
* @hooked WC_Structured_Data::generate_website_data() - 30
*/
View per-product-redirect.php
<?php /* <--------Careful! */
/**
* Plugin Name: Per product Redirect
* Description: Empowers WooCommerce Store owners to add a custom redirect page on add-to-cart for EVERY product
* Version: 1.0.0
* Author: Brad Griffin
* Author URI: https://bradgriffin.me/
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@EnterpriseBranding
EnterpriseBranding / functions.php
Created May 12, 2019 — forked from bgardner/functions.php
Enqueue Google Fonts.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Load Lato and Merriweather Google fonts
add_action( 'wp_enqueue_scripts', 'bg_load_google_fonts' );
function bg_load_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:300,700|Merriweather:300,700', array(), CHILD_THEME_VERSION );
}
@EnterpriseBranding
EnterpriseBranding / layouts-beaver-workaround.php
Created May 12, 2019 — forked from adrianosferreira/layouts-beaver-workaround.php
This will let Layouts work with Beaver page builder
View layouts-beaver-workaround.php
/*
* This will let Layouts work with Beaver page builder
* This will let you add Beaver elements in cell that contains post body
* Without this workaround it will display the Beaver elements on every cell because of the_content()
*/
add_action( 'init', 'fix_beaver' );
function fix_beaver(){
$has_been_removed = false;
@EnterpriseBranding
EnterpriseBranding / a.md
Created Apr 27, 2019 — forked from ericandrewlewis/a.md
The WordPress Customizer
View a.md

The WordPress Customizer

The WordPress Customizer is an interface for drafting changes to content while previewing the changes before they are saved. This is an alternative to the "save and suprise" model of changing settings without knowing what exactly will happen.

The customizer can be accessed in the admin interface under Appearance > Customize.

A screenshot of the customizer

#19909 is the trac ticket that introduced the Customizer during the 3.4 release cycle.

@EnterpriseBranding
EnterpriseBranding / a.md
Created Apr 27, 2019 — forked from ericandrewlewis/a.md
The WordPress Customizer
View a.md

The WordPress Customizer

The WordPress Customizer is an interface for drafting changes to content while previewing the changes before they are saved. This is an alternative to the "save and suprise" model of changing settings without knowing what exactly will happen.

The customizer can be accessed in the admin interface under Appearance > Customize.

A screenshot of the customizer

#19909 is the trac ticket that introduced the Customizer during the 3.4 release cycle.

@EnterpriseBranding
EnterpriseBranding / functions.php
Created Mar 25, 2019 — forked from maddisondesigns/functions.php
Remove the annoying Wordfence Notifications on plugin updates and plugin activation
View functions.php
<?php
/*
* Remove the annoying Wordfence Notifications. Tested with Wordfence v6.3.2
*/
class ahRWN_Remove_Wordfence_Notification {
private $wordfencePluginFile;
public function __construct() {
$this->wordfencePluginFile = "wordfence/wordfence.php";
register_activation_hook( $this->wordfencePluginFile, array( $this, 'rwn_remove_wordfence_notifications_on_activation' ) );
You can’t perform that action at this time.