- add_action('parse_query', [$this, 'fixEmptyQueryString']);
- add_action('parse_query', [$this, 'filterBarQueryRedirect']);
+ add_action('wp', [$this, 'fixEmptyQueryString'], 5);
+ add_action('wp', [$this, 'filterBarQueryRedirect'], 5);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this one along with your other nginx config files | |
# Do not change any existing site config file | |
# This example use port 8080 | |
# Maybe you have to change to another port | |
# See also: https://www.nginx.com/resources/admin-guide/serving-static-content/ | |
server { | |
listen 8080; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# roles/deploy/hooks/build-after.yml | |
- debug: | |
msg: "Before Gzip static assets: {{lookup('pipe', 'date')}}" | |
- name: Gzip static assets | |
shell: "gzip --best --keep --force {{ static_assets | map(attribute='path') | join(' ') }}" | |
when: project.gzip_assets_on_deploy | default(gzip_assets_on_deploy) | |
- debug: |
I hereby claim:
- I am tangrufus on github.
- I am tangrufus (https://keybase.io/tangrufus) on keybase.
- I have a public key whose fingerprint is CFBE 0B13 3B14 C437 56D0 0D34 5709 0746 B2C4 EAC7
To claim this, I am signing this object:
To keep it simple, always warp them inside double quotes
"id", "title", "descriptions"
"123", "About Us", "i , have, commas"
"456", "Contact Us", "I am meta desc"
the above example will translate into https://gist.github.com/TangRufus/1568776425a6e683ae66440c2f4d10ec#file-real-csv
- https://deliciousbrains.com/wp-offload-media/
- https://www.download-monitor.com/
- https://www.download-monitor.com/extensions/amazon-s3/
<?php
function is_download_monitor_attachment(int $id): bool
{
$parentPostId = wp_get_post_parent_id($id);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mineTypes = get_allowed_mime_types(); | |
$imageMineTypes = array_filter($mineTypes, function (string $type): bool { | |
return '' !== 'image/' && 0 === strpos($type, 'image/'); | |
}); | |
$query = new WP_Query([ | |
'fields' => 'ids', | |
'post_type' => 'attachment', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('save_post', function($id, $post, $update): void { | |
if (! $update) { | |
return; | |
} | |
$postType = get_post_type($id); | |
// TODO: Change to the correct post type! | |
if ('post' !== $postType) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "http" | |
require 'json' | |
require 'open3' | |
http = HTTP.auth("token XXXXX") | |
max_page=12 | |
clone_urls = (1..max_page).map do |page| | |
body = http.get("https://api.github.com/orgs/itinerisltd/repos?type=sources&sort=created&page=#{page}").body | |
repos = JSON.parse(body) |