Skip to content

Instantly share code, notes, and snippets.

View scottopolis's full-sized avatar

Scott Bolinger scottopolis

View GitHub Profile
@scottopolis
scottopolis / hwp-display-filter.php
Last active March 9, 2020 05:01
Holler Box Display Filter
<?php
add_filter( 'hwp_display_notification', function( $show_it, $box_id, $post_id ) {
if( $post_id == '12' && $box_id == '234' )
$show_it = true;
// you should not return false unless you want to override all other filters. It's best to either return true, or just return $show_it
return $show_it;
@scottopolis
scottopolis / ap3-homepage.html
Created May 18, 2017 21:10
AP3 Custom Homepage Code
<!-- This will display side menu links. If you are using a tab menu, change pages.menus.items on line 4 to pages.tab_menu.items -->
<ion-grid>
<ion-row>
<ion-col col-6 *ngFor="let p of pages.menus.items" [ngClass]="p.extra_classes">
<ion-card (click)="pushPage(p)" class="menu-card">
<div class="card-title"><ion-icon *ngIf="p.class" name="{{p.class}}"></ion-icon></div>
<div class="card-subtitle">{{p.title}}</div>
</ion-card>
</ion-col>
</ion-row>
<!-- upload an image to your offline assets -->
<img src="assets/my-image.png" />
<ion-list>
<button ion-item icon-right (click)="pushPage(pages.menus.items[0])">What's New <ion-icon name="arrow-forward"></ion-icon></button>
<button ion-item icon-right (click)="pushPage(pages.menus.items[1])">Edinburgh <ion-icon name="arrow-forward"></ion-icon></button>
@scottopolis
scottopolis / ap3-custom.html
Last active June 26, 2017 22:00
Custom HTML example code for AppPresser 3
<!-- A bunch of random sample code you can use in custom HTML pages -->
<!-- Just a normal card -->
<ion-card>
<ion-card-header>
Card Header
</ion-card-header>
<ion-card-content>
<p>My Custom demo page</p>
@scottopolis
scottopolis / api-list-comments.php
Last active December 23, 2017 22:30
Add comments to an API list in AppPresser 3
<?php
/*
* This code goes in a WordPress plugin or child theme functions.php file
* Customize the HTML tags on line 43 if you want, then add custom CSS in the app customizer, for example:
.comment {
clear:both;
overflow:hidden;
width: 100%;
@scottopolis
scottopolis / bp-redirect.php
Last active September 23, 2022 18:50
BuddyPress Profile redirect
<?php
function appp_redirect() {
global $wp;
$current_url = home_url( $wp->request );
$string = apply_filters( 'ap3_bp_me_url', '/me/' );
$me = stripos( $current_url, $string );
@scottopolis
scottopolis / splice-object-array.js
Last active July 4, 2025 13:21
Remove object from array of objects in Javascript
// we have an array of objects, we want to remove one object using only the id property
const apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}];
// get index of object with id of 37
const removeIndex = apps.findIndex( item => item.id === 37 );
// remove object
apps.splice( removeIndex, 1 );
@scottopolis
scottopolis / reactor-notification.php
Created January 10, 2017 18:21
Send Custom Reactor Notification
<?php
// This code would go in a custom plugin or theme functions.php file
add_action( 'publish_post', 'send_my_push', 10, 2 );
function send_my_push( $post_id, $post ) {
// Put conditions here to only send notification for the posts you want
if( $post->post_author != 'Scott' )
return;
@scottopolis
scottopolis / custom-page-links.html
Created December 9, 2016 22:35
Links in custom pages in AppPresser 3
@scottopolis
scottopolis / config.xml
Created December 9, 2016 22:28
Add NSPhotoLibraryUsageDescription permission for iOS10 using PhoneGap Build
<!-- This is the proper formatting -->
<gap:plugin name="cordova-plugin-camera" source="npm">
<param name="CAMERA_USAGE_DESCRIPTION" value="This app allows you to upload photos." />
<param name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="This app allows you to upload photos." />
</gap:plugin>