Skip to content

Instantly share code, notes, and snippets.

View lubyagin's full-sized avatar

Лубягин Александр lubyagin

View GitHub Profile
@andrewlimaza
andrewlimaza / custom_styles.css
Created May 17, 2017 08:29
Custom CSS to style levels page PMPro
.entry-header{
background:#0a4296;
}
.entry-header h2{
color:white;
padding-top:2%;
}
.pmpro_level-select a{
@andrewlimaza
andrewlimaza / caldera_forms_css_field_label_class_example.css
Last active February 19, 2019 23:24
Simple CSS example to change color and font-size of Caldera Form Label field
.control-label {
color: lightblue;
font-size: 20px;
}
@roblabs
roblabs / generateLaunchScreen.sh
Created April 11, 2017 16:51
Generate iOS Launch or splash screen from a single image
#!/bin/bash -e
# --------------------------------------------------------
# Generate iOS Launch items from a single image
# (c) 2017 ePi Rational, Inc.
#
# Modified from original script which generated app icons for iOS,
# originally written by
# Ben Clayton, Calvium Ltd.
# https://gist.github.com/benvium/2be6d673aa9ac284bb8a
@andrewlimaza
andrewlimaza / hide_level_if_user_has_level
Last active February 22, 2021 08:58
Hide a level from the levels page in PMPro if a user already has an active level.
/**
* Hide a membership level from the levels array if the user currently has a membership level. This is great to hide trial levels if the user has an active level.
* Add this code to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function remove_free_trial_if_user_has_level( $level ){
if( pmpro_hasMembershipLevel() ){
unset( $level['1'] ); //change the level ID to the level you would like to hide.
@andrewlimaza
andrewlimaza / change_choose_your_payment_method_txt_pmpro.php
Last active May 16, 2022 07:19
Change 'Choose your Payment Method' in Paid Memberships Pro
<?php
/**
* This code is used to change 'Choose your Payment Method' text in Paid Memberships Pro.
* Add the function into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function change_choose_your_payment( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Choose your Payment Method' :
@andrewlimaza
andrewlimaza / my_redirect_pmpro.php
Created March 16, 2017 07:21
Redirect users away from a page in PMPro according to membership
<?php
/**
* Add the following code to your PMPro Customization - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Description: Redirect users with certain levels away from certain pages in Paid Memberships Pro
*/
// Redirect free members away from chat.
function my_pmpro_template_redirect() {
//Don't break if PMPro isn't active.
@andrewlimaza
andrewlimaza / customize_checkout.css
Created February 27, 2017 07:42
Custom CSS code for credit card fields w/ media query
@media screen and (min-width:769px){
.sbHolder {
width: 200px;
left: 15em;
top: -2em;
}
}
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@andrewlimaza
andrewlimaza / change_pmpro_not_logged_in_msg.php
Created February 16, 2017 09:34
Change the PMPro not logged in text for a specific page.
<?php
// Add the code below to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function not_logged_in_pmpro_user_msg( $text ){
if( is_page('page-slug') ){ //change page slug to your own
$text = 'My own message goes here'; // Change this text to display your own message
@andrewlimaza
andrewlimaza / disable_double_checkout.php
Created February 9, 2017 16:29
Don't allow users to checkout for the same level in PMPro if date is more than 3 months
<?php
/*
Don't allow early renewals for certain levels.
(Don't allow users to checkout for the same level in PMPro if date is more than 3 months)
Change the level IDs in the $pmpro_non_renewal_levels global array, then
add this code to your active theme's functions.php or a custom plugins.
Add the following code to your PMPro Customizations plugin -> http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/