Instantly share code, notes, and snippets.

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
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
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.

View 2017-nearby-wordcamps.md
View wp-auto-update-everything.php
<?php
/**
* Enable Auto Updates for Everything
* https://gist.github.com/salcode/b60df55598c21c5970600a56715a2b1c
*
* Please put this file in the `mu-plugins` directory.
*
* curl -O https://gist.githubusercontent.com/salcode/b60df55598c21c5970600a56715a2b1c/raw/wp-auto-update-everything.php
*/
View yoast-setup-notes.md

Setting Up Yoast SEO

  • Enable Twitter cards: /wp-admin/admin.php?page=wpseo_social#top#twitterbox Enable and Summary with Large Image
  • Change Title separator to |
View fe-prevent-slug-conflict.php
<?php
/**
* Prevent top level permalink slugs that will cause conflicts.
*
* New rewrite slugs are introduced when CPTs or Custom Taxonomies are created.
* This code adds a check when Pages or Posts are created, that their Permalink
* does not conflict with one of the reserved top level slugs you define.
*
* In the case of a bad (i.e conflicting slug), WordPress appends a "-2" to
* the permalink.
View fe-modify-num-of-posts-per-page-on-fe-recipe.php
<?php
/**
* Set the number of posts on the Custom Post Type archive for `fe_recipe` to 5.
*/
add_action( 'pre_get_posts', 'fe_modify_number_of_posts_per_page' );
/**
* Modify Posts Per Page for CPT `fe_recipe`
*