Skip to content

Instantly share code, notes, and snippets.

@salcode
salcode / add-mastodon-link.php
Created Nov 7, 2022
Add Mastodon "me" link to the header of the homepage on a WordPress website.
View add-mastodon-link.php
@salcode
salcode / javascript.js
Last active Aug 18, 2022
Alternative implementation of LoggedInBanner.
View javascript.js
// Alternative code, from my tweet:
// Generic, reusable Banner component
function Banner({ type, children }) {
const bg = type === 'success' ? 'green' : 'red';
return (
<div
className={styles.banner}
style={{ backgroundColor: bg }}
@salcode
salcode / PostStatus.php
Last active Oct 10, 2019 — forked from JasonTheAdams/PostStatus.php
Enumeration example of the Object Value Design Pattern
View PostStatus.php
<?php
class PostStatus
{
const PRIVATE = 'private';
const DRAFT = 'draft';
const PUBLISHED = 'published';
const TRASHED = 'trash';
/**
@salcode
salcode / .editorconfig
Last active Jan 16, 2020
PHP PSR-2 EditorConfig
View .editorconfig
# EditorConfig helps keep your project formatting consistent.
# See https://EditorConfig.org
#
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
#
# Author: Sal Ferrarello (@salcode)
#
# You can download this file directly
# to your project from the command-line with
@salcode
salcode / .editorconfig
Last active Oct 15, 2022
WordPress .editorconfig - modified version of the WordPress coding standards
View .editorconfig
# EditorConfig helps keep your project formatting consistent.
# See https://EditorConfig.org
#
# This is a modified version of the WordPress coding standards.
#
# Author: Sal Ferrarello (@salcode)
# https://salferrarello.com/wordpress-editorconfig/
#
# You can download this file directly
# to your project from the command-line with
@salcode
salcode / wp-cli-test-stop-emails.php
Created May 2, 2018
WordPress plugin proof of concept for disabling the Stop Emails plugin from logging emails when run from the command line. See https://github.com/salcode/stop-emails/issues/15
View wp-cli-test-stop-emails.php
<?php
/**
* Plugin Name: WP CLI Test Stop Emails
* Plugin URI: https://github.com/salcode/stop-emails/issues/15
* Description: Test plugin for <a href="https://github.com/salcode/stop-emails/issues/15">Issue 15</a>
* Author: Sal Ferrarello
* Author URI: https://salferrarello.com/
* Text Domain: wp-cli-test-stop-emails
* Domain Path: /languages
* Version: 0.1.0
View keybase.md

Keybase proof

I hereby claim:

  • I am salcode on github.
  • I am salcode (https://keybase.io/salcode) on keybase.
  • I have a public key ASBSYDWGe_itOiSiI6BnWuSnvvlLjok8KPK_E5OrUDofnAo

To claim this, I am signing this object:

View beaver.php
<?php
/**
* Modify theme to support Beaver Builder better.
*
* - Set the theme layout to full width.
* - Remove the `site-inner` markup.
* - Remove the `content-sidebar-wrap` markup.
* - Remove the entry header and page/ post title.
*
* @package Generico\Core
@salcode
salcode / myThoughts.md
Created Sep 8, 2017
Display PHP output on a WordPress page
View myThoughts.md

Context

https://twitter.com/felafel/status/906162644125659136

@salcode Met you at WC Lancaster. Looking to embed existing php code (not a snippet) in a WP page. Tried a few plugins. Suggestion?

My Thoughts

Displaying PHP output on a WordPress page can vary depending on where you want to display the output.

@salcode
salcode / 2017-nearby-wordcamps.md
Last active Oct 5, 2017
2017 WordCamps Near Me
View 2017-nearby-wordcamps.md