Skip to content

Instantly share code, notes, and snippets.

Avatar
🌻

Peter Wilson peterwilsoncc

🌻
View GitHub Profile
@peterwilsoncc
peterwilsoncc / composer.json
Last active Oct 18, 2021
Using WP.org MVP sniffs in a project.
View composer.json
{
"name": "awesomemotive/seedprod-plugins",
"type": "project",
"require-dev": {
"wordpress/wporg-code-analysis": "1.0.0"
},
"scripts": {
},
"repositories": [
{
View 48556-testing-plugin.php
<?php
/**
* A testing plugin for trac ticket #48556.
*
* As a testing plugin, this includes a nasty hack to allow for easily
* viewing WP_Query dumps.
*
* **THIS SHOULD NEVER BE RUN ON A PUBLIC FACING SITE**
*/
namespace Trac\WPQ_Update;
View metaboxes.php
<?php
namespace PWCC;
/**
* Register meta box(es).
*/
function wpdocs_register_meta_boxes() {
add_meta_box( 'meta-box-id', __( 'My Meta Box', 'textdomain' ), __NAMESPACE__ . '\\wpdocs_my_display_callback', 'post' );
}
View plugin-header-check.yaml
name: Version checks
on:
push:
branches:
- master
pull_request:
jobs:
# Compares the header information in the readme.txt and the main plugin file
View noindex_ppp.php
<?php
namespace PWCC\NoIndexPPP;
if ( ! is_admin() ) {
add_action( 'pre_get_posts', __NAMESPACE__ . '\\show_public_preview' );
}
/**
* Filter the Yoast SEO and AIOSEO robots meta tag for public previews.
*
View clear-google-meet-background-bookmarklet.js
javascript:( (d) => { d.querySelector( '.q9EjXc' ).style.visibility="hidden";d.querySelector('.yvv8Re.OAburf').style.backgroundColor='black';d.querySelector('.l4V7wb.Fxmcue').style.display="none"; } )(window.document);
View pwcc-wp-cron.php
<?php
namespace PWCC\WP_Cron_Cavalcade;
/**
* Initialize the plugin.
*/
function bootstrap() {
/*
* The Cavalcade plugin uses a different rescheduling algorithm to WordPress
* Core. This overrides the Cavalcade changes to use the WordPress default.
View async-post-delete.php
<?php
namespace PWCC\AsyncDelete;
const ACTION_HOOK = 'pwcc.async_delete_post';
/**
* Register hooks for WordPress.
*/
function bootstrap() {
add_filter( 'pre_delete_post', __NAMESPACE__ . '\\async_delete_post', 10, 3 );
View dailies-at-night.php
<?php
namespace PWCC\NightlyCronSchedule;
use DateTime;
use DateTimeZone;
use HM\Cavalcade\Plugin\Job;
/**
* Register hooks for WordPress.
*/
View tachyon-large.meta-data.txt
array(6) {
["width"]=>
int(2560)
["height"]=>
int(1440)
["file"]=>
string(32) "2019/12/tachyon-large-scaled.jpg"
["sizes"]=>
array(13) {
["medium"]=>