Skip to content

Instantly share code, notes, and snippets.

Peter Wilson peterwilsoncc

View GitHub Profile
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"]=>
View composer.json
{
"require": {
"altis/cloud": "^2.0",
"altis/cms-installer": "0.3.2",
"altis/core": "^2.0",
"altis/media": "^2.0",
"johnpbloch/wordpress": "5.3.*",
},
"require-dev": {
"altis/dev-tools": "^2.0",
@peterwilsoncc
peterwilsoncc / remove-caps.php
Created Sep 30, 2019
Remove all caps unrelated to posts for all WordPress accounts.
View remove-caps.php
<?php
/* ********************************************************* *
* WARNING WARNING WARNING! *
* Written in about ten minutes, only roughly tested. *
* ********************************************************* */
/**
* Do not allow meta caps unrelated to posts.
*
* @param string[] $caps Array of required capabilities.
@peterwilsoncc
peterwilsoncc / plugin-comment-reply.js
Last active May 18, 2019
Replacing WordPress's comment code to move the comment reply form.
View plugin-comment-reply.js
// After WP Core's comment-reply.js is loaded.
(function () {
if ( typeof addComment === 'undefined' ) {
return;
}
// Source: Jetpack comments module by Automattic.
// See https://github.com/Automattic/jetpack/blob/2e9efb22810cbd0e60ad2d2a9158e47a4432577c/modules/comments/comments.php#L375-L413
addComment._myPlugins_moveForm = addComment.moveForm;
@peterwilsoncc
peterwilsoncc / userContent.css
Created Apr 29, 2019
Firefox user styles for maintaining sanity.
View userContent.css
@-moz-document url-prefix(https://www.abc.net.au/news),
domain(www.linkedin.com),
domain(www.theage.com.au),
domain(www.smh.com.au) {
html::before {
content:"It's all terrible and depressing." !important;
display: block !important;
position: fixed !important;
top: 0 !important;
left: 0 !important;
@peterwilsoncc
peterwilsoncc / index.php
Created Jun 17, 2016
get post class test
View index.php
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
// post_class();
?>
<p><?php the_ID(); ?></p>
<?php
endwhile;
?>
You can’t perform that action at this time.