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
# WordPress COMMON SETTINGS - WordOps 3.13.2 | |
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE | |
# Limit access to avoid brute force attack | |
#Yoast SEO Sitemaps | |
location ~ ([^/]*)sitemap(.*).x(m|s)l$ { | |
## this rewrites sitemap.xml to /sitemap_index.xml | |
rewrite ^/sitemap.xml$ /sitemap_index.xml permanent; | |
## this makes the XML sitemaps work | |
rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 last; |
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
/** | |
* Manually verify all unverified users | |
* | |
* @return bool | |
*/ | |
function verify_all_users() { | |
// Get only user IDs for unverified users | |
$user_query = new WP_User_Query( 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
#!/bin/sh | |
echo "Starting safe update" | |
# Display the WordPress version | |
current_wp_core=$(wp core version --path=./wordpress) | |
# Update the WordPress version | |
wp core update | |
wp core update-db |
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
/** | |
* Dynamically change Stripe keys upon conditions | |
*/ | |
if ( !class_exists( 'Woo_Conditional_Stripe_Keys' ) ) { | |
class Woo_Conditional_Stripe_Keys { | |
/** | |
* Stripe Live publishable key |
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
if ( ! function_exists('custom_meta_to_order') ) { | |
add_action('woocommerce_checkout_update_order_meta', 'custom_meta_to_order', 20, 1); | |
function custom_meta_to_order( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$order->update_meta_data( '_order_custom_field', 'value' ); | |
$order->save(); | |
} | |
} |
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
version: '3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: somewordpress |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name neshable.com www.neshable.com; | |
return 301 https://neshable.com$request_uri; | |
} | |
server { |
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
// Register Custom Post Type | |
function books_post() { | |
// Array of custom labels for our custom post type backend. | |
$labels = array( | |
'name' => 'Books', //general name for the post type, usually plural. Default is Posts/Pages | |
'singular_name' => 'Book', //name for single object of this post type. Default is Post/Page | |
'menu_name' => 'Books', // Name used in the menu | |
'name_admin_bar' => 'Book', // String for use in New in Admin menu bar. - New Book | |
'add_new_item' => 'Add New Book', // Default is Add New Post/Add New Page. |
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
var ourRequest = new XMLHttpRequest(); | |
ourRequest.open('GET', 'your-url'); | |
ourRequest.onload = function() { | |
if (ourRequest.status >= 200 && ourRequest.status < 400) { | |
var data = JSON.parse(ourRequest.responseText); | |
} else { | |
console.log("Connected, but errors occurred."); | |
} | |
}; |