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
# /etc/nginx/snippets/wordpress/common.conf | |
index index.php; | |
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). | |
location ~ /\. { | |
deny all; | |
} | |
# Block PHP files in uploads, content, and includes directory. | |
location ~* /(?:uploads|files|wp-content|wp-includes)/.*\.php$ { |
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 /* Template Name: Contact Page */ | |
$response = ""; | |
//function to generate response | |
function my_contact_form_generate_response($type, $message){ | |
global $response; | |
if($type == "success") $response = "<div class='alert alert-success'>{$message}</div>"; | |
else $response = "<div class='alert alert-danger'>{$message}</div>"; |
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 // For implementation instructions see: https://aceplugins.com/how-to-add-a-code-snippet/ | |
/** | |
* Add link icons. | |
* | |
* Adds a external-link icon to external links only. | |
* Related post: https://jeroensormani.com/adding-a-icon-to-external-links/ | |
*/ | |
function ace_add_external_link_icon( ) { | |
wp_register_script( 'external-link-icon', false ); |
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
#!/usr/bin/env bash | |
# WP-CLI Back up Script to Amazon S3 | |
# Source: https://www.jonathan.vc | |
# Author: Jonathan Dingman | |
# Adapted from Mike at WP Bullet | |
#define local path for backups | |
BACKUPPATH=/tmp/backups | |
#path to WordPress installations |
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 | |
/** | |
* Handles email sending | |
*/ | |
class Custom_Email_Manager { | |
/** | |
* Constructor sets up actions | |
*/ | |
public function __construct() { |
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 | |
/** | |
* Admin new order email | |
*/ | |
$order = new WC_order( $item_data->order_id ); | |
$opening_paragraph = __( 'A new order has been made by %s. The details of the item are as follows:', 'custom-email' ); | |
?> | |
<?php do_action( 'woocommerce_email_header', $email_heading ); ?> |
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 | |
/** | |
* Admin new order email | |
*/ | |
$order = new WC_order( $item_data->order_id ); | |
echo "= " . $email_heading . " =\n\n"; | |
$opening_paragraph = __( 'A new order has been made by %s. The details of the item are as follows:', 'custom-email' ); |
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 | |
// Display Input Field on Backend | |
add_action( 'woocommerce_product_options_general_product_data', function () { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
woocommerce_wp_text_input( | |
array( | |
'id' => 'product_key_features', | |
'label' => __( 'Product Key Features', 'woocommerce' ), | |
'placeholder' => 'Enter product key features (3 words)', |
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_filter( 'woocommerce_admin_disabled', '__return_true' ); | |
add_filter( 'jetpack_just_in_time_msgs', '__return_false', 20 ); | |
add_filter( 'jetpack_show_promotions', '__return_false', 20 ); | |
add_filter( 'woocommerce_allow_marketplace_suggestions', '__return_false', 999 ); | |
add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' ); | |
add_filter( 'woocommerce_marketing_menu_items', '__return_empty_array' ); | |
add_filter( 'woocommerce_background_image_regeneration', '__return_false' ); | |
add_filter( 'wp_lazy_loading_enabled', '__return_false' ); | |
add_filter( 'woocommerce_menu_order_count', 'false' ); |
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 namespace GM\WWWPostThumbnail; | |
/** | |
* Plugin Name: WWW Post Thumbnail | |
* Description: Allow to use an external image url as featured image. | |
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/928bc22e5f49a654cf7c | |
* Author: Giuseppe Mazzapica | |
* Author URI: https://github.com/Giuseppe-Mazzapica | |
* License: MIT | |
* Version: 0.1.0 | |
* |
OlderNewer