Skip to content

Instantly share code, notes, and snippets.

View sc0ttkclark's full-sized avatar
🍕
Working hard reviewing and deploying code

Scott Kingsley Clark sc0ttkclark

🍕
Working hard reviewing and deploying code
View GitHub Profile
{
"landingPage": "\/wp-admin\/admin.php?page=pods&pods_wasm_demo=1",
"preferredVersions": {
"php": "8.0",
"wp": "latest"
},
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
@sc0ttkclark
sc0ttkclark / Bindings.php
Last active March 16, 2024 18:05
The new Custom Binding Logic for Pods
<?php
namespace Pods\WP;
use Pods\Blocks\Types\Field;
use WP_Block;
/**
* Bindings specific functionality.
*
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active March 3, 2024 09:22
PhpStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

Toolbox PhpStorm.app Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and phpstorm-toolbox.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Update the phpstorm-toolbox.sh to use your username for the /Users/yourusername/ path and the correct version number (PhpStorm > About > Build #PS-XXX.XXXXX.XX where XXX.XXXXX.XX is the version number to use).
  3. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/phpstorm-toolbox.sh
  4. Go into Tower.app Preference > Git Config > Select "PhpStorm" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"
@sc0ttkclark
sc0ttkclark / pods-hide-taxonomy-meta-box-for-taxonomy.php
Created August 31, 2021 13:37
Pods Snippet -- Set the taxonomy meta box callback to false so it will hide the meta box on associated post types.
<?php
// pods_register_taxonomy_{YOUR_TAXONOMY_NAME_HERE}
add_filter( 'pods_register_taxonomy_my_custom_tax', 'my_pods_taxonomy_hide_meta_box' );
/**
* Set the taxonomy meta box callback to false so it will hide the meta box on associated post types.
*
* @param array $options The list of taxonomy options for register_taxonomy().
*
* @return array The list of taxonomy options for register_taxonomy().
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active December 1, 2023 10:12
PhpStorm.app (Standalone) Mac integration with Tower.app for diff and merge - https://youtrack.jetbrains.com/issue/WI-26090

PhpStorm.app (Standalone) Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and phpstorm.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/phpstorm.sh
  3. Go into Tower.app Preference > Git Config > Select "PhpStorm" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"

Other variations

@sc0ttkclark
sc0ttkclark / my-custom-pods-block-1.php
Last active December 4, 2022 10:21
Pods Blocks API examples for register a custom block type or a custom block collection. Screencast: https://share.skc.dev/12uJvZL1
<?php
/**
* Plugin Name: My Custom Pods Block
* Plugin URI: https://gist.github.com/sc0ttkclark/73930f5a4b8f093d4c0d500bdb1eca5b
* Description: Custom block built using the Pods Block PHP API. No Javascript needed!
* Author Name: Scott Kingsley Clark
* Author URI: https://skc.dev/
*/
/**
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active November 23, 2022 15:41
WebStorm.app (Standalone) Mac integration with Tower.app for diff and merge

WebStorm.app (Standalone) Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and webstorm.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory
  2. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/webstorm.sh
  3. Go into Tower.app Preference > Git Config > Select "WebStorm" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"

Other variations

@sc0ttkclark
sc0ttkclark / 0-README.md
Last active November 15, 2022 18:59
WebStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

WebStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and webstorm-toolbox.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Update the webstorm-toolbox.sh to use your username for the /Users/yourusername/ path and the correct version number (WebStorm > About > Build #WS-XXX.XXXXX.XX where XXX.XXXXX.XX is the version number to use).
  3. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/webstorm-toolbox.sh
  4. Go into Tower.app Preference > Git Config > Select "WebStorm (Toolbox)" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"
@sc0ttkclark
sc0ttkclark / pmpro-addon-checkout-email-template.php
Last active October 20, 2022 16:08
This snippet enables a custom template to be used for when a member completes checkout for an addon. Look for "Checkout - Paid - Addon" in the template list. REQUIRES: PMPro, PMPro Addon Packages, and PMPro Email Templates Add On
<?php
/**
* Register the custom checkout template for addon package purchases.
*
* @param array $templates The list of templates.
*
* @return array The list of templates.
*/
function my_addon_checkout_template_register_template( $templates ) {
@sc0ttkclark
sc0ttkclark / php-error.php
Created August 15, 2022 19:05
A quick handy debugging file for wp-content/php-error.php to expose critical errors more thoroughly. DO NOT LEAVE THIS ON PROD SITES.
<?php
/**
* A quick handy debugging file for wp-content/php-error.php to expose critical errors more thoroughly.
*
* DO NOT LEAVE THIS ON PROD SITES.
*/
echo '<h1>Site PHP Error</h1>';
echo '<pre>';
var_dump( [