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 | |
/** | |
* Show Video | |
* | |
* Creates a video element that plays in modal window. | |
*/ | |
function show_video($type = 'default', $thumb = 0, $post_id = null) { | |
// Assume this function returns the html for a video player | |
} |
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 | |
// Remove links for blog clients, shortlink, and generator info from header | |
remove_action('wp_head', 'rsd_link'); | |
remove_action('wp_head', 'wlwmanifest_link'); | |
remove_action('wp_head', 'wp_shortlink_wp_head'); | |
remove_action('wp_head', 'wp_generator'); | |
// Remove Yoast SEO next/prev links |
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
#!/bin/bash | |
# Gratitude: https://stackoverflow.com/questions/1759587/how-to-un-submodule-a-git-submodule | |
origin=submodule_origin | |
url=git://url/to/submodule/origin | |
path=submodule_path | |
echo "git remote add $origin $url" | |
echo "git fetch $origin" |
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
# Apache example configuration, added inside the <VirtualHost> directive, or root server block if VirtualHost is not being used. | |
<Directory "${SRVROOT}/htdocs/www.example.local/wp-content/uploads"> | |
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule (.*) https://www.example.com/wp-content/uploads/$1 [L,R,NE] | |
</IfModule> | |
</Directory> |
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
# Nginx example configuration, added inside the server {} block | |
# Uploads redirected to the hostname of your production server | |
location /wp-content/uploads/ { | |
try_files $uri @uploads-redirect; | |
} | |
location @uploads-redirect { | |
expires 30s; | |
return 301 https://{HOSTNAME}/$request_uri; |
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 | |
class cf_deploy_client extends cfd_common { | |
protected $use_compression = CF_DEPLOY_USE_COMPRESSION; | |
public function __construct() { | |
$this->options = maybe_unserialize(get_option(CF_DEPLOY_SETTINGS, array())); | |
} | |
/** |
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 | |
/** | |
* Hello, this is a minimal ajax handler for WP. | |
* Based off of: https://coderwall.com/p/of7y2q/faster-ajax-for-wordpress which didn't work for me out of the box. | |
* Note: replace tld with your own prefix. | |
* Handles get and post type requests. | |
* Assumes you put this file in the root directory of your theme folder. | |
*/ | |
$_tld_ajax = []; |
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 | |
/** | |
* Programmatically logs a user in | |
* | |
* @param string $username | |
* @return bool True if the login was successful; false if it wasn't | |
*/ | |
function programmatic_login( $username ) { | |