Skip to content

Instantly share code, notes, and snippets.

View lkoudal's full-sized avatar

Lars Koudal lkoudal

View GitHub Profile
@lkoudal
lkoudal / freemius-checkout-button.markdown
Last active April 11, 2022 20:28
Freemius checkout button

Freemius checkout button

Inspired by James Kemp's interface - This example has tabs for monthly, annual and lifetime billing cycles.

You can choose between 1, 10 and 50 sites - each with different pricing.

There is a place to enter coupon code + user can choose between big buy button or a 7-day trial.

A Pen by Lars Koudal on CodePen.

@lkoudal
lkoudal / plugin.php
Created August 10, 2019 14:57
Simple Freemius register reminder nag
<?php
// Use in plugin with Freemius - Place where to remind people to please give permissions.
// Remember to change secnin_fs() to whatever your class is named.
if ((!secnin_fs()->is_registered()) && (!secnin_fs()->is_pending_activation()) ) {
?>
<div class="sidebarsection feature">
<h3><span class="dashicons dashicons-warning"></span> <?php _e('Never miss an important update', WF_SN_TEXT_DOMAIN); ?></h3>
<p><?php
_e('Opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking.', WF_SN_TEXT_DOMAIN );
@lkoudal
lkoudal / gist:a63a14ebfe89e27ec311651a72b143fb
Created May 18, 2019 19:14
Rules from WordPress group on LinkedIN https://www.linkedin.com/groups/154024/ per May 18th 2019
About this group
For users, lovers, developers, and consultants on the WordPress platform, be it .org or .com, to connect and share ideas, questions, and contacts.
Group rules
To help us keep this group WordPress related and SPAM-free, we ask that you please read the following guidelines.
Discussions, Promotions, Jobs and any other matter posted which is not related to WordPress will be removed and members posting such matter will be blocked or banned. There will be no tolerance or grace period for SPAM posters.
By requesting group membership you acknowledge that you have read and understand the group rules and agree to adhere to them. Violations of rules may result in deletion of offending post(s) and banning or blocking of member access without prior notice.
@lkoudal
lkoudal / functions.php
Created January 20, 2019 23:02
Reorder WooCommerce product page with Astra theme - using filter and ACF - Advanced Custom Fields
<?php
add_filter( 'astra_woo_single_product_structure', 'filter_astra_woo_single_product_structure',99 );
function filter_astra_woo_single_product_structure($single_structure) {
global $post;
$id = $post->ID;
if (!$id) return $single_structure;
@lkoudal
lkoudal / class-woothemes-sensei-list-table.php
Created May 2, 2018 16:22 — forked from dwainm/class-woothemes-sensei-list-table.php
Updated Sensei WP_List_Table class implementation
<?php
/**
* Base class for displaying a list of items in an ajaxified HTML table.
*
* @since 3.1.0
* @access private
*
* @package WordPress
* @subpackage List_Table
*/
@lkoudal
lkoudal / gist:3c15c19ce10cb0435ca6eb8d171ce9ad
Created April 18, 2018 14:38
show images with no alt with a red border - logged in only.css
body.logged-in img[alt=""],
body.logged-in img:not([alt]) {
border: 5px dashed #c00;
}
@lkoudal
lkoudal / emails.php
Created March 7, 2018 23:07 — forked from tameemsafi/emails.php
Send an email programmatically in wordpress with wp_mail using the woocommerce transaction emails template.
<?php
// Define a constant to use with html emails
define("HTML_EMAIL_HEADERS", array('Content-Type: text/html; charset=UTF-8'));
// @email - Email address of the reciever
// @subject - Subject of the email
// @heading - Heading to place inside of the woocommerce template
// @message - Body content (can be HTML)
function send_email_woocommerce_style($email, $subject, $heading, $message) {
@lkoudal
lkoudal / config
Created May 27, 2017 19:59 — forked from peterpme/config
SSH Config Taken From Paul Irish. Thanks Paul!
# symlink to ~/.ssh/config
Host github.com
ControlMaster auto
ControlPersist 120
Host *
# Always use SSH2.
Protocol 2
@lkoudal
lkoudal / vc-custom-element.php
Created January 21, 2017 02:26
WP: Visual composer custom element
<?php
// Before VC Init
add_action( 'vc_before_init', 'vc_before_init_actions' );
function vc_before_init_actions() {
//.. Code from other Tutorials ..//
// Require new custom Element
@lkoudal
lkoudal / .htaccess
Created January 20, 2017 01:29 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/