This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies | |
import _ from 'lodash' | |
// React | |
import React from 'react' | |
import PropTypes from 'prop-types' | |
// TinyMCE | |
import tinymce from 'tinymce/tinymce' | |
import 'tinymce/themes/modern/theme' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do not include in Customizations plugin if copying and pasting | |
/** | |
* Plugin Name: Add a Currency to global | |
* | |
* This code gist illustrates a way to customize the format of how your currency displays. | |
* | |
* In this example, we will change the PMPro Danish Krone currency | |
* | |
* from DKK 1,495.00 | |
* to DKK 1 495,00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tell PMPro to look in the pages directory of this plugin for PMPro page templates. | |
* | |
* Add this code to your Customizations plugin. | |
* | |
* Make sure that there is a /paid-memberships-pro/pages/ directory in the plugin directory with your templates in it. | |
*/ | |
function my_pmpro_pages_custom_template_path( $default_templates ) { | |
$default_templates[] = dirname( __FILE__ ) . '/paid-memberships-pro/pages/checkout.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BACKUP FIRST | |
# You generally do not want to setup PMPro levels | |
# with both a recurring billing amount AND | |
# an expiration date. | |
# This SQL query will clear the expiration date | |
# for active recurring memberships. | |
# BACKUP FIRST | |
UPDATE wp_pmpro_memberships_users | |
SET enddate = '0000-00-00 00:00:00' | |
WHERE status = 'active' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do not include in Customizations plugin | |
/** | |
* Redirect to the levels page when users try to access protected files in PMPro. | |
* | |
* Add this code to your customizations plugin file. | |
* | |
* Learn about protecting files with PMPro here: | |
* https://www.paidmembershipspro.com/locking-down-protecting-files-with-pmpro/ | |
*/ | |
function my_pmpro_getfile_before_error( $filename ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This example is to show you the 'niche' options each Paid Memberships Pro - Register Helper Add-on field can take and how to use it. | |
* | |
* Add this to a Customizations Plugin and customize to suit your needs | |
*/ | |
function initialize_pmprorh_fields() { | |
// don't break if Register Helper is not loaded | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Perform an action on PMPro recurring orders only. | |
A recurring order here is one that | |
(1) Has an earlier order with the same subscription_transaction_id. | |
(2) Is not created at PMPro checkout. | |
Note that we are checking if function_exists for pmpro_isOrderRecurring incase | |
we add this to PMPro core. Also note that the $test_checkout param there is used | |
here to avoid #2 above. So this parameter will check if the currently running PHP | |
script is being fired at checkout, not necessarily if the order was created at checkout, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function($){ | |
/* | |
Script Name: WP Auto Installer | |
Author: Mohan Dere | |
Version: 1.0 | |
Description : This script install new wordpress setup, create database with tables with content & run search replace database for new urls. | |
Last Update: 13 Mar 15 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not include this line in your Customizations plugin | |
/** | |
* Require specific category user meta to view posts in designated categories. | |
* Custom price-adjusting fields are added via PMPro Register Helper add on (required). | |
* Add all of this code to your active theme's functions.php or a custom plugin. | |
*/ | |
add_filter( 'pmpro_has_membership_access_filter', 'my_pmpro_additional_categories', 10, 4 ); | |
function my_pmpro_additional_categories( $hasaccess, $thepost, $theuser, $post_membership_levels ) { | |
global $wpdb; |