You can use the .phar
for PHPCS, but it's easier to pull the repo down from git to then choose what version to use.
cd ~
mkdir -p code
cd code
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs
<?php | |
/** | |
* Plugin Name: Day-of-the-Month Filter | |
* Description: Adds a day-of-the-month filter to the posts list table in wp-admin. | |
* Version: 1.0.0 | |
* Author: Gary Jones | |
*/ | |
// Exit if accessed directly. | |
if ( ! defined( 'ABSPATH' ) ) { |
<?php | |
add_filter( 'wp_handle_upload', 'foo_strip_metadata_from_images_on_upload' ); | |
/** | |
* Overwrite the uploaded image with a new version that has no metadata. | |
* | |
* @param array $upload Array containing: | |
* - file: The path to the image file. | |
* - url: The URL to the image. | |
* - type: The MIME type of the image. |
--- /var/folders/5h/n5kgg5w13h77n1ffpd4hm2800000gn/T/rPo5nh_superfish.js 2018-10-05 10:50:58.000000000 +0100 | |
+++ /Users/gary/Local Sites/genesis/app/public/wp-content/themes/genesis/lib/js/menu/superfish.js 2018-10-05 10:50:59.000000000 +0100 | |
@@ -1,13 +1,13 @@ | |
/* | |
- * jQuery Superfish Menu Plugin | |
- * Copyright (c) 2013 Joel Birch | |
+ * jQuery Superfish Menu Plugin - v1.7.10 | |
+ * Copyright (c) 2018 Joel Birch | |
* | |
* Dual licensed under the MIT and GPL licenses: |
--- /var/folders/5h/n5kgg5w13h77n1ffpd4hm2800000gn/T/xxXKfj_superfish.js 2018-10-05 10:45:22.000000000 +0100 | |
+++ /Users/gary/Local Sites/genesis/app/public/wp-content/themes/genesis/lib/js/menu/superfish.js 2018-10-05 10:45:23.000000000 +0100 | |
@@ -1,13 +1,13 @@ | |
/* | |
- * jQuery Superfish Menu Plugin | |
- * Copyright (c) 2013 Joel Birch | |
+ * jQuery Superfish Menu Plugin - v1.7.6 | |
+ * Copyright (c) 2015 | |
* | |
* Dual licensed under the MIT and GPL licenses: |
<?php | |
// Can drop into {yourtheme}/functions.php and then hit the site. | |
$update_taxonomy = 'category'; // Set to the correct taxonomy. | |
$get_terms_args = array( | |
'taxonomy' => $update_taxonomy, | |
'fields' => 'ids', | |
'hide_empty' => false, |
<?php | |
// Can drop code into top of {yourtheme}/functions.php and then hit the site. | |
// Fix comment counts. | |
$post_types = ['post']; // Set to the post types to fix. | |
$post_status = ['publish', 'pending', 'draft']; // Set to the post status to fix. | |
global $wpdb; | |
$posts = $wpdb->get_results( |
<?php | |
/** | |
* Per-Site User Fields | |
* | |
* @package GaryJones\PerSiteUserfields | |
* @author Gary Jones | |
* @copyright 2018 Gary Jones, Gamajo | |
* @license GPL-2.0-or-later | |
* | |
* @wordpress-plugin |
<?php | |
// Copy everything below this line in to your functions.php file. | |
/** | |
* Remove microdata attributes from Genesis 2.6.0. | |
* | |
* May need adapting for other versions of Genesis. | |
* | |
* @author Gary Jones, Gamajo. |
<?php | |
add_filter( 'genesis_footer_widget_areas', 'gmj_add_footer_widgets_classes', 10, 2 ); | |
/** | |
* Add classes to footer widget areas container, depending on the configured number of footer widget areas. | |
* | |
* @param string $output Existing footer widget areas container markup. | |
* @param int $footer_widgets Number of configured footer widget areas. | |
* @return string Possibly amended markup for footer widget areas container. | |
*/ |