Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label
{
@flesueur
flesueur / deloldtweets.py
Created June 26, 2018 10:11
Delete (very) old tweets obtained from a twitter archive
#!/bin/python3
# Largely copied from http://www.mathewinkson.com/2015/03/delete-old-tweets-selectively-using-python-and-tweepy
# However, Mathew's script cannot delete tweets older than something like a year (these tweets are not available from the twitter API)
# This script is a complement on first use, to delete old tweets. It uses your twitter archive to find tweets' ids to delete
# How to use it :
# - download and extract your twitter archive (tweet.js will contain all your tweets with dates and ids)
# - put this script in the extracted directory
# - complete the secrets to access twitter's API on your behalf and, possibly, modify days_to_keep
# - delete the few junk characters at the beginning of tweet.js, until the first '[' (it crashed my json parser)
# - review the script !!!! It has not been thoroughly tested, it may have some unexpected behaviors...
@chuckreynolds
chuckreynolds / robots.txt
Last active May 22, 2023 18:44
Solid start Robots.txt for WordPress Sites. (HEADS UP: Make sure you're viewing the most recent version of this Gist) https://gist.github.com/chuckreynolds/135728/
# robots.txt for wordpress
# https://gist.github.com/chuckreynolds/135728
User-agent: *
Disallow: /cgi-bin/
Disallow: /trackback/
Disallow: /comment-page-*
Disallow: /?s=*
Disallow: /*.php$
@GaryJones
GaryJones / wp-prep.php
Created February 27, 2013 23:54
Refactor of wp-prep (https://github.com/jaredatch/wp-prep/blob/master/wp-prep.php). Completely untested.
<?php
/**
* WordPress Prep.
*
* Based from the WordPress Downloader
* http://www.farinspace.com/wordpress-downloader/
*
* @package wordpress-prep
* @version 1.0.1
* @author Jared Atchison
@GaryJones
GaryJones / nav-extras.php
Last active April 30, 2020 15:14 — forked from studiopress/nav-extras.php
Add Genesis Primary Nav Extras features in manually.
<?php
// Don't include the above <?php when copying
add_filter( 'wp_nav_menu_items', 'prefix_primary_nav_extras', 10, 2 );
/**
* Filter menu items, appending either a search form or today's date.
*
* @param string $menu HTML string of list items.
* @param stdClass $args Menu arguments.
<?php
/**
* Don't Update Plugin
*
* This prevents you being prompted to update if there's a public plugin
* with the same name.
*
* @since 1.0.0
* @author Mark Jaquith
<?php
add_action('gform_after_submission', 'post_to_third_party', 10, 2);
function post_to_third_party($entry, $form) {
$post_url = 'http://forms.franklin.edu/newsletter-registration/Register';
$body = array(
'fullName' => $entry['1.1'],
'email' => $entry['1.2']
);
$request = new WP_Http();
$response = $request->post($post_url, array('body' => $body));
@pippinsplugins
pippinsplugins / gist:146c6f90bc8194c7dba1
Last active May 9, 2017 23:13
This is a simple example that shows how we can maintain backwards compatibility in a plugin for data that used to be stored in post meta but is now stored in a taxonomy term. When this change was made, a new `edd_get_commission_status()` function was introduced, but before this function existed, the status was retrieved by calling `get_post_meta…
<?php
/**
* Filters get_post_meta() to ensure old commission status checks don't fail
*
* The status for commission records used to be stored in postmeta, now it's stored in a taxonomy
*
* @access private
* @since 2.8
* @return mixed
<?php
// Grab Authorized Users
$admins = new WP_User_Query( array( 'role' => 'bbp_keymaster', 'fields' => 'ID' ) );
$moderators = new WP_User_Query( array( 'role' => 'bbp_moderator', 'fields' => 'ID' ) );
$users = array_merge( $admins->results, $moderators->results );
// Build the bbPress query
// ...
@simonpioli
simonpioli / wp-config.php
Created March 9, 2013 13:33
Improved Wordpress wp-config for >1 Environment
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the