Skip to content

Instantly share code, notes, and snippets.

View mwhiteley16's full-sized avatar

Matt Whiteley mwhiteley16

View GitHub Profile
@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 ) {
@mwhiteley16
mwhiteley16 / config.codekit3
Created October 17, 2022 18:43
BudgetBytes CodeKit Config
{
"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" : "8DB4564B-D63F-45C5-A152-F67DC528DC35"
}
],
"creatorBuild" : "34434",
@mwhiteley16
mwhiteley16 / plugin-shared-counts.php
Created September 5, 2022 14:17
Shared Counts Reddit w/ Label
<?php
/**
* Shared Counts Functionality
*
* @author BillErickson
* @since 1.0.0
* @license GPL-2.0+
* @link https://sharedcountsplugin.com/2019/03/27/add-a-reddit-share-button/
**/
@mwhiteley16
mwhiteley16 / blocks.php
Created August 26, 2022 18:42
Conditionally load acf scripts
<?php
/**
* Blocks setup
*
* @link https://www.advancedcustomfields.com/resources/options-page/
*/
namespace WhiteleyDesigns\Blocks;
/**