- 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);
#!/bin/bash | |
set -euExo pipefail | |
THE_ORG=foo | |
THE_REPO=bar | |
gh api -X GET /repos/${THE_ORG}/${THE_REPO}/actions/runs --paginate \ | |
| jq '.workflow_runs[] | .id' \ | |
| xargs -t -I{} gh api -X DELETE /repos/${THE_ORG}/${THE_REPO}/actions/runs/{} |
post_id | foo | bar | baz | qux | |
---|---|---|---|---|---|
4569 | Dog, Cat & Fish | a:1:{s:1:"a";s:1:"b";} | !@£$%^&*()_+-=[]'; |
#!/bin/bash | |
set -euo pipefail | |
app='@theApp.theEnv' | |
plugin='wordpress-seo' | |
echo "Checking whether plugin ${plugin} is activated on ${app}" | |
echo 'Fetching URLs' | |
urls=$(vip "${app}" --yes -- wp site list --fields="url" --format="csv" --quiet --no-color) |
#!/bin/bash | |
set -euo pipefail | |
echo 'Fetching URLs...' | |
urls=$(vip -y @theApp.theEnv -- wp site list --fields="url" --format="csv") | |
for url in $urls | |
do | |
if [ "${url}" == "url" ]; then | |
continue # skip the CSV header | |
fi |
<?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) { |
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) |
<?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', |
<?php
function is_download_monitor_attachment(int $id): bool
{
$parentPostId = wp_get_post_parent_id($id);
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
I hereby claim:
To claim this, I am signing this object: