Skip to content

Instantly share code, notes, and snippets.

@robertuniqid
robertuniqid / short-code-example-2.txt
Last active September 14, 2017 17:24
WPEP - Profile Page Shortcode
[wpep_profile layout-max-width="1600px"]
@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 / 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 / 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 / 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 / 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 / example.php
Created August 14, 2017 17:54
WPEP PlaceHolder Image
<?php
if( !defined( 'WPEP_PLACEHOLDER_IMAGE' ) )
define( "WPEP_PLACEHOLDER_IMAGE", "your-image-link-goes-here" );
?>
@robertuniqid
robertuniqid / example.php
Last active August 8, 2017 19:59
Formidable WPEP Verification
<?php
$user_entries = FrmEntry::getAll( [
'form_id' => $required_form_id_any,
'user_id' => get_current_user_id(),
'parent_item_id' => 0
] );
if( empty( $user_entries ) )
@robertuniqid
robertuniqid / main.js
Created June 14, 2017 14:17
jQuery Function to Serialize Object, like in a PHP $_POST request from HTML, the main issue came with combining checkboxes & hidden inputs, and I've made this adaptation to handle this..
$.fn.wpepSerializeObject = function () {
"use strict";
var result = {},
objectInstance = this;
var extend = function (i, element) {
var node = result[element.name];
if ('undefined' !== typeof node && node !== null) {
@robertuniqid
robertuniqid / query.sql
Created May 28, 2017 11:55
EDD Child & Parent License Expiration.
SELECT p.ID as license_id,
c_exp.meta_value as child_expiration,
p_exp.meta_value as parent_expiration
FROM `wp_posts` p
LEFT JOIN `wp_postmeta` c_exp ON c_exp.post_id = p.ID AND c_exp.meta_key = "_edd_sl_expiration"
LEFT JOIN `wp_postmeta` p_exp ON p_exp.post_id = p.post_parent AND p_exp.meta_key = "_edd_sl_expiration"
WHERE p.`post_type` = 'edd_license'
AND p.post_parent != 0