Skip to content

Instantly share code, notes, and snippets.

View mwhiteley16's full-sized avatar

Matt Whiteley mwhiteley16

View GitHub Profile
@mwhiteley16
mwhiteley16 / Theme.json
Created June 28, 2023 11:27
Theme.json
"styles": {
"blocks": {
"core/button": {
"color": {
"background": "var(--wp--preset--color--primary)",
"text": "var(--wp--preset--color--background)"
},
"border": {
"color": "var(--wp--preset--color--primary)"
},
@mwhiteley16
mwhiteley16 / functions.php
Last active April 27, 2023 17:26
Post Payment Gravity Forms
/**
* Update puppy reservation status after payment is received.
*
* @link https://docs.gravityforms.com/gform_after_submission/
*
*/
add_action( 'gform_post_payment_completed', 'wd_gform_submission_updates', 10, 2 );
function wd_gform_submission_updates( $entry, $payment_id ) {
// Get form title of form that was submitted.
@mwhiteley16
mwhiteley16 / config.codekit3
Created April 14, 2023 14:40
Feast Build Stuff
{
"AAInfo" : "This is a CodeKit 3 project config file. EDITING THIS FILE IS A POOR LIFE DECISION. Doing so may cause CodeKit to crash and\/or corrupt your project. Several critical values in this file are 64-bit integers, which JavaScript JSON parsers do not support because JavaScript cannot handle 64-bit integers. These values will be corrupted if the file is parsed with JavaScript. This file is not backwards-compatible with CodeKit 1 or 2. For details, see https:\/\/codekitapp.com\/",
"buildSteps" : [
{
"name" : "Process All Remaining Files and Folders",
"stepType" : 1,
"uuidString" : "018EC27F-CDF8-4226-9947-B78C647B50E0"
}
],
"creatorBuild" : "34472",
@mwhiteley16
mwhiteley16 / feast-css-output.php
Created December 12, 2022 14:49
CSS Output for Feast
<?php
// function to output all the CSS
function feast_output_css() {
if ( function_exists( 'feast_css' ) ) {
$output = '';
$output .= '<style id="id-goes-here">';
feast_css();
$output .= '</style>';
@mwhiteley16
mwhiteley16 / output.php
Created December 12, 2022 13:11
Add Create Recipe Stars
if ( function_exists( 'mv_get_post_creations' ) ) {
$recipes = mv_get_post_creations( get_the_ID() );
if ( ! empty( $recipes ) ) {
// get Create recipe object
$recipe = $recipes[0];
$recipe_meta = mv_create_get_creation( $recipe );
// get the recipe rating, round it to the nearest half integer
$rounded_rating = round( $recipe_meta->rating * 2 ) / 2;
@mwhiteley16
mwhiteley16 / fsri-shortcode.php
Created December 9, 2022 14:05
Get Create Ratings
<?php
if ( function_exists( 'mv_get_post_creations' ) ) {
$recipes = mv_get_post_creations( get_the_ID() );
if ( ! empty( $recipes ) ) {
$recipe = $recipes[0];
$recipe_meta = mv_create_get_creation( $recipe );
$recipe_rating = 'Create Recipe Rating - ' . $recipe_meta->rating;
// print_r( $recipe_meta ); // show other available data
}
}
@mwhiteley16
mwhiteley16 / fsri-shortcode.php
Created December 8, 2022 15:31
Recipe rating output
<?php
if ( class_exists( 'Tasty_Recipes' ) ) {
$recipes = Tasty_Recipes::get_recipes_for_post( get_the_ID() );
if ( ! empty( $recipes ) ) {
$recipe = array_shift( $recipes );
if ( $recipe->get_total_reviews() ) {
$recipe_rating = \Tasty_Recipes\Ratings::get_rendered_rating(
$recipe->get_average_rating()
);
}
@mwhiteley16
mwhiteley16 / class-unipay.php
Created December 7, 2022 22:27
UniPay Form Detials
<?php
/**
* Payment Gateway: UniPay
*
* @package Vatu\PermitOrders\Gateway
*/
namespace Vatu\PermitOrders\Gateway;
// Block access to file directly.
@mwhiteley16
mwhiteley16 / fsri_after_title.php
Created November 23, 2022 21:58
Filter for FSRI shortcode after title
<?php
function example_callback() {
return 'some value';
}
add_filter( 'fsri_shortcode_after_title', 'example_callback' );
@mwhiteley16
mwhiteley16 / helper.php
Created October 19, 2022 20:57
Get Category Image ID Helper
<?php
/**
* Helper function to get ID of feast category image
*
* @since 7.7.0
*
* @param string $taxonomy Name of the taxonomy
*/
function get_feast_category_image_id( $term ) {