This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schemas.wp.org/trunk/block.json", | |
"apiVersion": 2, | |
"name": "create-block/mol-custom-blocks", | |
"version": "0.1.0", | |
"title": "Monte Logic's Custom Blocks", | |
"category": "text", | |
"icon": "flag", | |
"description": "A Gutenberg block to show your pride! This block enables you to type text and style it with the color font Gilbert from Type with Pride.", | |
"attributes": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schemas.wp.org/trunk/block.json", | |
"apiVersion": 2, | |
"name": "create-block/mol-custom-blocks", | |
"version": "0.1.0", | |
"title": "Monte Logic's Custom Blocks", | |
"category": "text", | |
"icon": "flag", | |
"description": "A Gutenberg block to show your pride! This block enables you to type text and style it with the color font Gilbert from Type with Pride.", | |
"attributes": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function attachToggleActionToButtons(menus) { | |
menus.each((index, menu) => { | |
// I think(?) this is for the larger menu on mobile and not | |
// the submenu. Have to test that out. | |
$(menu).on('click', '.gw-mm__toggle', function (event) { | |
toggleMobileMenu($(this), $(menu)); | |
}); | |
// I could write an if statement here but I still don't know | |
// the full jurisdictions of the this operator below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$(document).ready(function () { | |
const menus = $('.gw-mm'); | |
const plainMenus = $('.gw-pm'); | |
function setDropdownsPosition(menus) { | |
menus.each((index, menu) => { | |
if ($(menu).hasClass('is-mobile')) { | |
$(menu).find('.gw-mm-item__dropdown-wrapper').css({ | |
'left': '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./styles.css"; | |
import React, { useEffect, useState } from "react"; | |
export default function App() { | |
const [resourceType, setResourceType] = useState("posts"); | |
console.log("render"); | |
useEffect(() => { | |
fetch(`https://jsonplaceholder.typicode.com/${resourceType}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_store_api_checkout_update_order_from_request', 'woo_blocks_address_field_validation', 10, 2); | |
function woo_blocks_address_field_validation( WC_Order $order, $request ) { | |
$shipping_address = $order->get_address('shipping')['address_1']; | |
if ( $shipping_address && ! preg_match( '/[0-9]+/', $shipping_address ) ) { | |
throw new Exception( 'Your shipping address must contain a house number!' ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* What I am trying to do is access the IntegrationInterface from | |
* WooCommerce-Blocks | |
* Documentation on IntegrationInterface: | |
* https://github.com/woocommerce/woocommerce-blocks/blob/50f9b3e8d012f425d318908cc13d9c601d97bd68/docs/extensibility/integration-interface.md | |
* | |
* | |
* It is an interface which allows for certain files to be loaded in a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: The WordPress SlotFill System | |
* Description: Plugin of Slot Fill Examples. | |
* Version: 0.1.0 | |
* Author: Monte Logic | |
* Author URI: www.ryanwelcher.com | |
* Plugin URI: https://github.com/montelogic | |
* Textdomain: gutenberg-slot-fill-system | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* External dependencies | |
*/ | |
import classnames from 'classnames'; | |
/** | |
* Internal dependencies | |
*/ | |
import OptionLayout from './option-layout'; | |
import type { RadioControlOptionProps } from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getThisToWork() { | |
fetch('/wp-json/wp/v2/users/3', { | |
method: 'GET', | |
headers: { | |
'Content-Type': 'application/json', | |
'X-WP-Nonce': wpApiSettings.nonce, // replace with your nonce value | |
}, | |
}) | |
.then(response => response.json()) | |
.then(data => { |