Skip to content

Instantly share code, notes, and snippets.

View joseph-farruggio's full-sized avatar

Joseph Farruggio joseph-farruggio

View GitHub Profile
<?php
/**
* A function that takes an array of HTML attribute
* key/value pairs and returns a string of HTML attributes.
**/
function unwrap_html_attrs($attrs)
{
$attributes = '';
@joseph-farruggio
joseph-farruggio / master.yml
Last active August 22, 2023 22:00
Github Action for deploying a WordPress plugin
name: Build and Publish Production Plugin
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
<?php
$args = wp_parse_args(
$args,
array(
'button' => get_field('button')
)
);
if ($args['button]): ?>
@joseph-farruggio
joseph-farruggio / get_parent_block_field.php
Last active January 22, 2023 23:12
Returns a specified field from the parent ACF block.
<?php
/**
* Returns a specified ACF field from a parent block
* @param string $child_id The ID of the child ACF block
* @param string $child_name The name of the child ACF block
* @param string $parent_name The name of the parent ACF block
* @param string $field The name of the parent's custom field to return
* @param boolean $return_first If $field is an array, optionally return the first item.
*/
function get_field_from_parent($child_id, $child_name, $parent_name, $field, $return_first = false) {
// webpack.mix.js test
let mix = require('laravel-mix');
let tailwindcss = require('tailwindcss');
mix.setPublicPath('assets/dist');
mix.js('assets/src/js/main.js', "assets/dist/js/main.min.js").version();
mix.sass("assets/src/scss/theme.scss", "assets/dist/css/theme.min.css").options({
postCss: [ tailwindcss('./tailwind.config.js') ],
{
"name": "your_name",
"version": "1.2.0",
"description": "Your Description",
"main": "webpack.mix.js",
"devDependencies": {
"@tailwindcss/custom-forms": "^0.2.1",
"@tailwindcss/forms": "^0.3.2",
"@tailwindcss/typography": "^0.4.0",
"ajv": "^6.12.6",
<?php
$category = get_field('category');
// query arguments
$args = array(
'category__in' => $category->term_id;
'post_status' => 'publish',
'posts_per_page' => 10,
'orderby' => 'date',
{
id: '581',
'$uid': '73e7c58f8dcaf08275e9ede885e170e0',
internal: { typeName: 'WordPressPost',
origin: undefined,
mimeType: undefined,
content: undefined,
timestamp: 1595134058463
},
date: '2020-07-08T18: 58: 21',
Redirect 301 "/spring-trends" "/baby-easter-outfits"
Redirect 301 "/safe-baby-sunscreen" "/baby-sunscreen"
Redirect 301 "/finding-a-pediatrician" "/find-a-pediatrician"
Redirect 410 "/royal-baby"
Redirect 410 "/dream-on-me-crib-collapse"
Redirect 410 "/recalled-playtex-infant-carrier"
Redirect 410 "/ikea-lamps-recalled-for-death"
Redirect 301 "/baby-photo-props" "/newborn-photo-props"
Redirect 301 "/category/incredible-infants/helpful-gadgets" "/category/incredible-infants/clothes-things"
Redirect 410 "/fall-fashion-mom-and-baby-2014"
[
{
"key": "group_5be5a1136a415",
"title": "Block: Hero",
"fields": [
{
"key": "field_5e0afdc64f5a3",
"label": "Content",
"name": "",
"type": "tab",