- 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 -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 | |
/** | |
* Make CloudFlare Client API calls via wp_remote_post | |
* A fork from CloudFlare-API by VEXXHOST, Inc. | |
* | |
* @package CloudFlare_API_Helper | |
* @link https://github.com/vexxhost/CloudFlare-API | |
* @link https://www.cloudflare.com/docs/client-api.html | |
*/ |
<?php | |
/* | |
* Plugin Name: Settings API Tabs Demo | |
* Plugin URI: http://theme.fm/?p= | |
* Description: This is a demo showing off usage of tabs with the WordPress Settings API | |
* Version: 1.0 | |
* Author: kovshenin | |
* Author URI: http://theme.fm | |
* License: GPL2 | |
*/ |
<div id="sunny_demo_url_purger" class="wrap"> | |
<form id="sunny_demo_url_purger_form" method="POST"> | |
<?php wp_nonce_field( 'sunny_demo_url_purger', 'sunny_demo_url_purger_nonce'); ?> | |
<?php do_settings_sections( 'sunny_demo_url_purger_section' ); ?> | |
<?php submit_button( __('Purge', $plugin_slug ), 'primary', 'sunny_demo_url_purger_button' ); ?> | |
</form> | |
<br class="clear"> | |
<div id="sunny_demo_url_purger_result" style="display: none"> | |
<h3 id="sunny_demo_url_purger_result_heading">URL Purger Result</h3> | |
<img id="sunny_demo_url_purger_form_spinner" style="display: none" src="<?php echo admin_url(); ?>images/spinner-2x.gif"> |
<?php | |
// inside private function register_settings() | |
// below add_settings_section() | |
// Next, we will introduce the fields for CloudFlare Account info. | |
add_settings_field( | |
// ID used to identify the field throughout the theme | |
'sunny_demo_cloudflare_email', | |
// The label to the left of the option interface element |
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 | |
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) { |
<?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);