Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott Bolinger scottopolis

View GitHub Profile
@scottopolis
scottopolis / apppresser-iap-pmp.php
Created Aug 6, 2020
AppPresser In App Purchase integration for Paid Memberships Pro
View apppresser-iap-pmp.php
<?php
/*
Plugin Name: AppPresser In App Purchases for Paid Memberships Pro
Plugin URI: https://apppresser.com
Description: This plugin listens for in app purchases or cancellations and adds/removes members from a membership level.
Version: 2.0.0
Author: Scott Bolinger
Author URI: https://apppresser.com
License: GPLv2
*/
@scottopolis
scottopolis / apppresser-featured-images.php
Created Jun 22, 2020
AppPresser add Featured Images to Post Detail View
View apppresser-featured-images.php
@scottopolis
scottopolis / iap-learndash-2020.php
Last active May 30, 2020
LearnDash In App Purchases plugin for AppPresser
View iap-learndash-2020.php
<?php
/*
Plugin Name: AppPresser In App Purchases for LearnDash
Plugin URI: https://apppresser.com
Description: This plugin listens for in app purchases or cancellations and adds/removes members from a LearnDash course.
Version: 1.0.0
Author: Scott Bolinger
Author URI: https://apppresser.com
License: GPLv2
*/
@scottopolis
scottopolis / zip-clean-alias.sh
Last active May 28, 2020
ZSH alias to zip current folder, remove git and DS Store files, and show in finder
View zip-clean-alias.sh
# put this in your .zshrc file, change path to store zip, restart terminal
# run command `releasezip my-files-1.0`, which would create a zip at ../my-files-1.0.zip
# change output path (../) to whatever you want, for example Users/Me/Plugins/Releases/$1.zip
releasezip() {
zip -r ../$1.zip . -x '*.git*' --exclude=\*.DS_Store\*
open ../
}
@scottopolis
scottopolis / ap4-iap-page.html
Created May 22, 2020
AppPresser 4 In App Purchase Form
View ap4-iap-page.html
<div class="ion-padding">
<h2>Purchase</h2>
<p>For $9 per month, get access to analysis and commentary. Your subscription will automatically renew, cancel any time.</p>
<p>Enter your information below and click subscribe. By subscribing, you agree to the <a href="https://mysite.com/terms/" target="_blank" rel="noopener noreferrer">terms of service.</a></p>
<p>If you already have an account, please login. If you do not have an account, enter your email before clicking purchase, and one will be created for you.</p>
<in-app-purchase isSubscription="true" productId="my-product"></in-app-purchase>
@scottopolis
scottopolis / appp-media-images.php
Last active Dec 11, 2019
Add an image for the AppPresser media player
View appp-media-images.php
<?php
/*
Plugin Name: AppPresser Media Images
Plugin URI: https://apppresser.com
Description: Automatically add media images on when a post is saved for posts that have a media url.
Version: 1.0
Author: AppPresser Team
Author URI: http://apppresser.com
License: GPLv2
@scottopolis
scottopolis / gatsby-dynamic.js
Created Nov 26, 2019
Dynamic Content in Gatsby with Apollo and WPGraphQL
View gatsby-dynamic.js
// This is just for example purposes, copy/pasting this won't work out of context. It is from the Gatsby Publisher theme by Static Fuse.
import React from 'react'
import { Box } from '@chakra-ui/core'
import Layout from '../../components/Layout'
import PostEntry from '../../components/PostEntry'
import Pagination from '../../components/Pagination'
import HeaderArchive from '../../components/HeaderArchive'
import SEO from '../../components/SEO'
import { useQuery } from '@apollo/react-hooks'
import gql from 'graphql-tag'
@scottopolis
scottopolis / woo-iap.php
Last active Jun 16, 2020
WooCommerce Memberships In App Purchases for AppPresser
View woo-iap.php
<?php
/*
Plugin Name: In App Purchases for WooCommerce Memberships
Plugin URI: https://apppresser.com
Description: This plugin listens for in app purchases or cancellations and adds/removes members from a membership level.
Version: 2.0.0
Author: Scott Bolinger
Author URI: https://apppresser.com
License: GPLv2
*/
@scottopolis
scottopolis / woo-product-api-filter.php
Last active Jun 18, 2020
Modify WooCommerce REST API Product Response
View woo-product-api-filter.php
<?php
// add this code to a custom plugin
add_filter( 'woocommerce_rest_prepare_product_object', 'wc_app_add_custom_data_to_product', 10, 3 );
// filter the product response here
function wc_app_add_custom_data_to_product( $response, $post, $request ) {
// in this case we want to display the short description, so we copy it over to the description, which shows up in the app
$response->data['description'] = $response->data['short_description'];
return $response;
@scottopolis
scottopolis / apppresser-filter-welcome-message.php
Last active Oct 15, 2019
Filter AppPresser Welcome Message
View apppresser-filter-welcome-message.php
<?php
// put this code in a plugin
add_filter( 'appp_login_success', 'appp_filter_welcome_message' );
function appp_filter_welcome_message( $user_id ) {
$data["message"] = "Welcome to our app user " . $user_id . "!"; // must be a string, no HTML
You can’t perform that action at this time.