Skip to content

Instantly share code, notes, and snippets.

@robertuniqid
robertuniqid / functions.php
Last active August 20, 2017 11:17
WPEP - Force Assets Refresh in the Admin by JS.
<?php
add_action( 'admin_footer', function() {
echo '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery( "#wpep-admin-style-css" ).each( function() {
var hrefAttribute = jQuery(this).attr("href");
hrefAttribute += ( hrefAttribute.indexOf("?") === -1 ? "?" : "&" ) + "wpep-forced-refresh=" + "' . date("Y-m-d" ) . '";
jQuery(this).attr( "href", hrefAttribute );
});
@robertuniqid
robertuniqid / functions.php
Created August 21, 2017 16:23
WPEP Sales Engine - Enforce Stripe to be available as a Payment Method
<?php
add_filter( 'wpep_addon_sales_engine_payment_processing_methods', function( $processing_options ) {
$processing_options['stripe'] = __( "Stripe" );
}, 20 );
?>
@robertuniqid
robertuniqid / first.css
Last active September 2, 2017 00:34
WPEP Execution Plan - Lesson Bars CSS
.wpep-wrapper .wpep-container #course-single #course-primary #course-content .wpep-course-form .section-accordion-group .lesson-accordion .lesson-accordion-group .ui-accordion-header {
background: rgba(0, 0, 0, 0) url("https://codestore.codeiscode.com/wp-content/uploads/2016/09/codeiscode-header-logo-red.png") repeat scroll 0 0;
}
@robertuniqid
robertuniqid / buddy-boss-theme.css
Last active October 21, 2019 15:26
WPEP Common CSS Snippets
.wpep-wrapper .wpep-container .course-primary-container .course-primary-content .wpep-course-form .section-accordion-group > h2 .checkbox > strong,
.wpep-wrapper .wpep-container .course-primary-container .course-primary-content .wpep-course-form .section-accordion-group .lesson-accordion .lesson-accordion-group .ui-accordion-header .checkbox > strong {
display: none !important;
}
@robertuniqid
robertuniqid / example.php
Created September 11, 2017 14:08
wpep-user-profile-test-tabs.php
<?php
add_filter( 'wpep_content_user_profile_tab_list', function( $tab_list ) {
for( $i = 1; $i <= 10 ; $i++ )
$tab_list['demo_tab_' . $i ] = [
'title' => 'Demo Tab ' . $i,
'content' => 'Demo Tab Content - ' . $i,
];
return $tab_list;
@robertuniqid
robertuniqid / short-code-example-2.txt
Last active September 14, 2017 17:24
WPEP - Profile Page Shortcode
[wpep_profile layout-max-width="1600px"]
[wpep_course_not_completed id="1"]
[wpep_course id="1"]
[/wpep_courses_not_completed]
[wpep_course_is_completed id="1"]
[wpep_index]
[/wpep_courses_is_completed]
@robertuniqid
robertuniqid / example.php
Last active August 5, 2022 14:11
EDD - Bundle License to emulate the normal licenses.
<?php
add_action( 'init', function() {
if( !isset( $_GET['edd_action'] ) && !isset( $_POST['edd_action'] ) )
return;
if( !isset( $_GET[ 'license' ] ) || !isset( $_GET[ 'item_id' ] ) )
if( !isset( $_POST[ 'license' ] ) || !isset( $_POST[ 'item_id' ] ) )
return;
@robertuniqid
robertuniqid / counter-party-find-wallet.php
Last active January 13, 2018 19:59
PHP - Detect your CounterParty Wallet
<?php
//$information = file_get_contents( 'information.txt' );
// or
$information = "
public-key-address
public-key-address
public-key-address
public-key-address
@robertuniqid
robertuniqid / example.html
Created February 13, 2018 12:20
ThriveCart Hide Credit Cards if Price is 0
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
var myCustomPriceActions = function() {
var price = parseInt( document.querySelector("ul.order-details .order-details-total em[data-currency]").innerHTML.replace( "$", "" ) );
var credit_card_element = document.querySelector("#form-order > .credit-cards" );
if( price === 0 ) {
credit_card_element.style.display = "none";
} else {
credit_card_element.style.display = "block";