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
<form action="#" method="POST" class="comment-form"> | |
<div> | |
<label for="don">Donation amount</label> | |
<input id="don" type="number" name="don" value="5" /> | |
</div> | |
<input id="submit" type="submit" name="cagnote-don-envoi" id="submit" class="submit" value="Submit" /> | |
</form> |
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
<form action="#" method="POST" class="comment-form"> | |
<?php wp_nonce_field( 'faire-don', 'cagnotte-verif' ); ?> | |
<div> | |
<label for="don"><?php _e( 'Amount donation' ); ?></label> | |
<input id="don" type="number" name="don" value="5" /> | |
</div> | |
<input id="submit" type="submit" name="cagnote-don-envoi" id="submit" class="submit" value="<?php esc_attr_e( 'Submit', 'msk' ); ?>" /> | |
</form> |
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
/* Disable WooCommerce dashboard status widget */ | |
add_action('wp_dashboard_setup', 'wcbloat_disable_woocommerce_status'); | |
function wcbloat_disable_woocommerce_status() { | |
remove_meta_box('woocommerce_dashboard_status', 'dashboard', 'normal'); | |
} |
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
/** *DASHBOARD POST ID*/ | |
add_filter('manage_posts_columns', 'posts_columns_id', 5); | |
add_action('manage_posts_custom_column', 'posts_custom_id_columns', 5, 2); | |
add_filter('manage_pages_columns', 'posts_columns_id', 5); | |
add_action('manage_pages_custom_column', 'posts_custom_id_columns', 5, 2); | |
function posts_columns_id($defaults){ | |
$defaults['wps_post_id'] = __('ID'); | |
return $defaults; | |
} |
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
function wpsites_disable_self_pingbacks( &$links ) { | |
foreach ( $links as $l => $link ) | |
if ( 0 === strpos( $link, get_option( 'home' ) ) ) | |
unset($links[$l]); | |
} | |
add_action( 'pre_ping', 'wpsites_disable_self_pingbacks' ); |
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
add_filter( 'woocommerce_add_to_cart_redirect', function( $wc_cart_url ) { | |
return wc_get_checkout_url(); | |
} ); |
OlderNewer