Skip to content

Instantly share code, notes, and snippets.

View jonathanbossenger's full-sized avatar
🏠
Working from home

Jonathan Bossenger jonathanbossenger

🏠
Working from home
View GitHub Profile
@jonathanbossenger
jonathanbossenger / settings.json
Created December 4, 2024 13:39
VS Code settings
{
"scm.inputFontSize": 14,
"debug.console.fontSize": 14,
"markdown.preview.fontSize": 14,
"editor.codeLensFontSize": 14,
"editor.suggestFontSize": 14,
"editor.fontSize": 14,
"files.autoSave": "afterDelay",
"editor.minimap.enabled": false,
"workbench.startupEditor": "none",
/**
* Get Image URL.
*
* @param integer $id ID of the image.
* @param string $args The image arguments.
*
* @return string The image URL.
*/
function zawp_get_image_url( $id, $args ) {
// If image returned is an array, then return it's 'ID'.
addFilter(
"editor.BlockEdit",
"wpdev/is-post-link",
( BlockEdit ) => {
return (props) => {
if (props.name !== "core/button") {
return <BlockEdit {...props} />;
}
return (
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"steps": [
{
"step": "setSiteOptions",
"options": {
"blogname": "LearnPress",
"blogdescription": "My testing LearnPress site"
}
},
<?php
/**
* Plugin Name: Bookstore
* Description: A plugin to manage books
* Version: 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
<?php
/**
* Plugin Name: WP Learn Compatibility
* Description: Learn to test a plugin for PHP Version Compatibility
* Version: 1.0.1
*/
/**
* Posts fetcher class
*/
  • Quick Slack completely
  • In a terminal, run the following commands
export SLACK_DEVELOPER_MENU=true 
open /Applications/Slack.app
  • This will open a new Slack instance but you're now able to access the developer tools.
  • Use the cmd + opt + I keyboard combination to open dev tools
  • Switch to the console tab and run the following command
<?php
/**
* Plugin Name: WP Learn HTTP API
* Description: Learning about the WP HTTP API
* Version: 0.0.1
*/
/**
* Create an admin page to show the API data
*/
@jonathanbossenger
jonathanbossenger / switch_php.sh
Last active August 14, 2023 07:36
Script to switch PHP versions installed with homebrew on a Mac
NEW_PHP_VERSION=$1
if [ -z "$NEW_PHP_VERSION" ]; then
echo "Please provide a PHP version to switch to."
exit 1
fi
CURRENT_PHP_VERSION=$(php -v | tail -r | tail -n 1 | cut -d " " -f 2 | cut -c 1-3)
brew unlink php@"$CURRENT_PHP_VERSION" && brew link php@"$NEW_PHP_VERSION" --force --overwrite