Skip to content

Instantly share code, notes, and snippets.

@saprativa
saprativa / summarization.ipynb
Last active February 5, 2024 07:25
Summarization of Long Documents using Transformers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
/*
Migrate from WP User Avatar to Simple Local Avatars
Allows sites to easily move away from the WP User Avatar plugin and switch to Simple Local Avatars instead.
Run by invoking with WP CLI like so:
`wp eval-file migrate-wp-user-avatar.php`
Author: Philip John
<?php
/**
* Plugin Name: Dev Plugins
*/
add_action( 'muplugins_loaded', function() {
// Plugins to activate automatically.
$auto_activate = [
'debug-bar/debug-bar.php',
'debug-bar-extender/debug-bar-extender.php',
@bfintal
bfintal / base-frame-template.php
Last active January 7, 2021 18:33
Since it's hard to find an example of how to create a readily usable modal popup using Backbone & WordPress, here's one that you can drop in your code and use right away.
<script type="text/html" id="tmpl-my-frame">
<div class="media-frame-title">
<h1>My Frame</h1>
</div>
<div class="media-frame-content"></div>
<div class="media-frame-toolbar">
<div class="media-toolbar">
<div class="media-toolbar-secondary"></div>
<div class="media-toolbar-primary search-form">
<button type="button" class="button button-primary media-button button-large">My Button</button>
@kevinwhoffman
kevinwhoffman / responsive-images-notes.md
Last active May 18, 2020 13:31
WordPress 4.4 Responsive Images Notes

Notes and Resources for Responsive Images in WordPress 4.4

Following the addition of responsive images support in WordPress 4.4, there has been a lot of confusion over what WordPress does "automatically" and what is left up to the developer. I've gathered the following notes from chatting with members of the core team and also my own investigation of the 4.4 source. Here's what I've discovered:

  • Following the 4.4 update, WordPress automatically serves the following images responsively:

    • Content images added via the main content editor will now be served with srcset markup. This is accomplished by filtering the_content() prior to display, which means it applies to existing posts and new posts going forward.
    • Featured images called by the_post_thumbnail() also get srcset markup without any additional steps required.
  • Images that are referenced from custom fields will not be served responsively unless the theme calls the image via wp_get_attachment_image() OR constructst the responsive m

@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@bradt
bradt / url-coupons.js
Last active August 29, 2015 14:17
WooCommerce URL Coupons
$( document ).ready( function() {
var cookie_name = 'dbrains-coupon';
var cookie_name_error = 'dbrains-coupon-error';
if ( 'undefined' === typeof $.cookie( cookie_name ) ) {
return;
}
var message = 'The coupon code ' + $.cookie( cookie_name ).toUpperCase() + ' has been successfully applied.';
@hlashbrooke
hlashbrooke / Slack theme for Post Status
Last active May 16, 2017 18:33
Slack theme for the Post Status channel. To use this theme, go to the 'Sidebar Theme' tab in your preferences pane and add this text to the custom theme field.
#2E3641,#FC781F,#1088C4,#FFFFFF,#808080,#FFFFFF,#FC781F,#1088C4
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@ShinichiNishikawa
ShinichiNishikawa / newreview
Last active June 26, 2016 14:08
Creating a whole new Theme Review environmet in 1 minute using wp-cli
wp db reset --yes
wp core install --url=http://theme-review.loc --title="This is a really long long title to check if this theme design doesn't break with the long site title" --admin_user=admin --admin_password=admin --admin_email=example@example.com
wp core update
wp plugin install theme-check debug-bar log-deprecated-notices monster-widget wordpress-importer show-current-template customizer-theme-resizer --activate
wp plugin install wordpress-beta-tester debogger jetpack
wp plugin update --all
wp option update blogdescription "I'm in the theme review process and this is a very very long tagline to see if this long tagline text string in WordPress doesn't break the design of the theme header and else."
wp option update posts_per_page 5
wp option update thread_comments 1
wp option update thread_comments_depth 3