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
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$"> | |
Order Allow,Deny | |
Deny from all | |
</FilesMatch> | |
# Strictly disallow .htaccess file | |
<files ~ "^.*\.([Hh][Tt][Aa])"> | |
order allow,deny | |
deny from all | |
satisfy all | |
</files> |
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 | |
# VARIABLES | |
CONFIG_FILE="./app/etc/local.xml" | |
DUMP_FILE="./var/db-sales-users.sql" | |
TABLES="sales_bestsellers_aggregated_daily sales_bestsellers_aggregated_monthly sales_bestsellers_aggregated_yearly sales_billing_agreement sales_billing_agreement_order sales_flat_creditmemo sales_flat_creditmemo_comment sales_flat_creditmemo_grid sales_flat_creditmemo_item sales_flat_invoice sales_flat_invoice_comment sales_flat_invoice_grid sales_flat_invoice_item sales_flat_order sales_flat_order_address sales_flat_order_grid sales_flat_order_item sales_flat_order_payment sales_flat_order_status_history sales_flat_quote sales_flat_quote_address_item sales_flat_quote_item sales_flat_quote_item_option sales_flat_quote_payment sales_flat_quote_shipping_rate | |
sales_flat_shipment sales_flat_shipment_comment sales_flat_shipment_grid sales_flat_shipment_item sales_flat_shipment_track sales_invoiced_aggregated sales_invoiced_aggregated_order sales_order_aggregated_created sales_order_aggregated_updated sales_order_statu |
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 define('CONSUMER_KEY', 'gNJIDw6Div95Wm8PqAjn0g'); | |
define('CONSUMER_SECRET', 'tGmL9R0RZGmZsjXDA8V7BhfK9fhyOxScnIh4R0'); | |
function get_bearer_token(){ | |
// Step 1 | |
// step 1.1 - url encode the consumer_key and consumer_secret in accordance with RFC 1738 | |
$encoded_consumer_key = urlencode(CONSUMER_KEY); | |
$encoded_consumer_secret = urlencode(CONSUMER_SECRET); | |
// step 1.2 - concatinate encoded consumer, a colon character and the encoded consumer secret | |
$bearer_token = $encoded_consumer_key.':'.$encoded_consumer_secret; |
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 | |
$post_data = array('post_title' => $post_title); | |
$imagesrc = migrate_image($image_url, $post_id, $post_title, $post_data); | |
function migrate_image($image_url, $post_id, $desc, $post_data) | |
{ | |
// Need to require these files | |
if (!function_exists('media_handle_upload')) { | |
require_once ABSPATH . "wp-admin" . '/includes/image.php'; | |
require_once ABSPATH . "wp-admin" . '/includes/file.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
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_URI} "images/case-studies-pdf/Case\sStudy\s-\sDelta\sCourt\s-\sInstallation\sof\sRoof\sAccess\sPoints.pdf" | |
RewriteRule .* http://site.uk/images/case-studies-pdf/Case-Study-Delta-Court-Installation-of-Roof-Access-Points.pdf [R=301,L] | |
</IfModule> |
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
jQuery(document).ready(function($) { | |
var newarr = []; | |
$table = jQuery('table'); | |
var dyarr = []; | |
$table.find('tr').each(function(){ | |
$(this).find('td font').each(function(){ | |
dyarr.push( $(this).html() ); // Column | |
}); | |
newarr.push(dyarr); // Row |
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 | |
function wpdocs_register_meta_boxes() { | |
add_meta_box( 'product-list-box', __( 'Product List', 'textdomain' ), 'product_list_callback', 'articles','side' ); | |
} | |
add_action( 'add_meta_boxes', 'wpdocs_register_meta_boxes' ); | |
function product_list_callback(){ ?> | |
<select name="product_list[]" multiple> | |
<?php | |
global $wpdb, $post; |
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
gzip on; | |
gzip_static on; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 6; | |
gzip_min_length 512; | |
gzip_buffers 16 8k; | |
gzip_http_version 1.1; | |
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml; |
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 | |
function pnavigation( $wp_query ) { | |
$big = 999999999; // need an unlikely integer | |
$pages = paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $wp_query->max_num_pages, | |
'prev_next' => 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 | |
/** | |
* Join posts and postmeta tables | |
* | |
* @param string $join | |
* @param WP_Query $query | |
* | |
* @see https://iconicwp.com/blog/add-product-sku-woocommerce-search/ | |
* | |
* @return string |
OlderNewer