Skip to content

Instantly share code, notes, and snippets.

View landbryo's full-sized avatar
🤠
Always Excitied

Landon Otis landbryo

🤠
Always Excitied
View GitHub Profile
@landbryo
landbryo / index-error.txt
Last active May 16, 2025 18:46
Index Error
Memory Usage: 989.32mb (Peak: 994.15mb)
Processed posts 199500 - 199850 of 409152. Last Object ID: 555809
Processed posts 199850 - 200200 of 409152. Last Object ID: 555451
Processed posts 200200 - 200550 of 409152. Last Object ID: 555079
Processed posts 200550 - 200900 of 409152. Last Object ID: 554725
Processed posts 200900 - 201250 of 409152. Last Object ID: 554363
Processed posts 201250 - 201600 of 409152. Last Object ID: 554013
Processed posts 201600 - 201950 of 409152. Last Object ID: 553663
Processed posts 201950 - 202300 of 409152. Last Object ID: 553306
Processed posts 202300 - 202650 of 409152. Last Object ID: 552952
@landbryo
landbryo / wp-playground-stream.json
Last active July 16, 2024 17:03
WordPress Playground - Stream
{
"preferredVersions": {
"php": "8.2",
"wp": "latest"
},
"phpExtensionBundles": [
"kitchen-sink"
],
"siteOptions": {
"blogname": "Stream Playground"
@landbryo
landbryo / enable-dropcap.php
Created December 20, 2023 18:19
Enable the dropcap feature by modifying the theme.json
<?php
/**
* Add drop cap support to the theme.json file.
*
* @param array $theme_json The theme.json json.
*
* @link https://developer.wordpress.org/block-editor/developers/themes/theme-json/#typography
*/
add_filter( 'wp_theme_json_data_theme', function( $theme_json ) {
@landbryo
landbryo / modify-paragraph-controls.js
Created December 20, 2023 18:15
Modify paragraph controls to add "Lead" and "Endmark" toggles.
import { createHigherOrderComponent } from '@wordpress/compose';
import { InspectorControls } from "@wordpress/block-editor";
import { __experimentalToolsPanelItem as ToolsPanelItem, ToggleControl, } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
const editParagraphAttributes = function ( settings, name ) {
if ( 'core/paragraph' === name ) {
settings.supports = {
...settings.supports,
@landbryo
landbryo / sample-getty-image-meta.json
Created December 12, 2023 15:35
Sample Getty Image Metadata
{
"width": 612,
"height": 408,
"file": "2023/12/gettyimages-1463514722-612x612-1.jpg",
"filesize": 82069,
"sizes": {
"medium": {
"file": "gettyimages-1463514722-612x612-1-300x200.jpg",
"width": 300,
"height": 200,
@landbryo
landbryo / disable-login-cookie-bookmarket.js
Created October 16, 2023 22:39
Disable Login Cookie Bookmarklet
@landbryo
landbryo / enable-login-cookie-bookmarklet.js
Created October 16, 2023 22:38
Enable Login Cookie Bookmarklet
@landbryo
landbryo / additional-authors-partial.php
Created October 16, 2023 18:07
Filter posts SQL query to include additional authors.
<?php
/**
* Hooks
*
* @return void
*/
public function init() {
// Filter author query to include posts author was added to as an additional author.
add_filter( 'posts_where', [ $this, 'filter_where' ], 10, 2 );
@landbryo
landbryo / gravity-complex-calculation.md
Last active September 9, 2023 20:18
Example Gravity Form Complex Calculation

Complex calculations in Gravity Forms may not work in the order that you'd expect. In this scenario, instead of subtracting the total value of the calculations from the value of field 15, we have to force the order of operation by subtracting it at the end, which creates a negative number. To return the number to positive, we multiply the total value by -1.

(
    ( {:15} * ( {:3} * 0.01 ) ) + 
    ( {:15} * ( {:16} * 0.01 ) ) + 
    ( {:15} * ( {:17} * 0.01 ) ) + 
    ( {:15} * ( {:7} * 0.01 ) ) - 
    ( {:15} ) 
) * -1
@landbryo
landbryo / mrss-example-item-description-cdata.xml
Created September 5, 2023 22:12
Example mRSS feed using non-spec custom parameters
<item>
<link>https://www.nerdwallet.com/article/mortgages/fthb-affordability-q22023</link>
<guid>https://www.nerdwallet.com/article/mortgages/fthb-affordability-q22023</guid>
<description>
<![CDATA[
<p>This second quarter analysis finds high rates and higher prices made for another tough quarter for potential first-time home buyers.</p>
<ul>
<li>
<a href="https://www.drsquatch.com">Sasquatch Found Working at Arbys</a>