Skip to content

Instantly share code, notes, and snippets.

View chiavi auth wp
/**
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'uW7fXe!NXZ347&X|iR_9lX4_:49DB[Ip-pUduA:605E)Dbsxo9q(;rW3EcM#DBy5');
View verifica-tabella-user-meta
SELECT * FROM `wp_a4b8hd74_usermeta` WHERE `meta_key` LIKE ‘%wp_%’
View rinominare-tabelle-db-wordpress
RENAME table `wp_commentmeta` TO `wp_a4b8hd74_commentmeta`;
RENAME table `wp_comments` TO `wp_a4b8hd74_comments`;
RENAME table `wp_links` TO `wp_a4b8hd74_links`;
RENAME table `wp_options` TO `wp_a4b8hd74_options`;
RENAME table `wp_postmeta` TO `wp_a4b8hd74_postmeta`;
RENAME table `wp_posts` TO `wp_a4b8hd74_posts`;
RENAME table `wp_terms` TO `wp_a4b8hd74_terms`;
RENAME table `wp_termmeta` TO `wp_a4b8hd74_termmeta`;
RENAME table `wp_term_relationships` TO `wp_a4b8hd74_term_relationships`;
RENAME table `wp_term_taxonomy` TO `wp_a4b8hd74_term_taxonomy`;
View compressione gzip via htaccess
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
View disabilitare-gutenberg-custom-post-type
//* Disabilitare Gutenberg su custom post type
(in questo caso il custom post type e libro), cambiare "libro" con il tuo custom post type *//
function ttwp_disable_gutenberg($is_enabled, $post_type) {
if ($post_type === 'libro') return false; // cambia libro con il tuo custom post type
return $is_enabled;
}
View disabilitare-gutenberg
//* Aggiungere questa stringa di codice nel file functions.php del tuo tema child per
disabilitare completamente Gutenberg su WordPress 5.0 *//
add_filter('use_block_editor_for_post', '__return_false');
View recuperare-condivisoni-perse
//* Questo snippet di codice e utile a tutti quelli che usano il plugin Really Simple SSl e vogliono recuperare le condivioni perse.
//* Questo va aggiunto nel file functions.php del tuo tema ( ti consiglio di usare un tema child )
//recuperare condivisoni
function my_opengraph_url( $url ) {
global $post;
$pubDate = get_the_date( $d='U', $post->ID);
$sslDate = 1490832000;
View maintenance.php
<?php
$protocol = $_SERVER["SERVER_PROTOCOL"];
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
$protocol = 'HTTP/1.0';
header( "$protocol 503 Service Unavailable", true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Stiamo aggiornando il nostro sito. Ritorna tra un po.</h1>
View mysqp-wp-config
// ** Impostazioni MySQL - È possibile ottenere queste informazioni dal proprio fornitore di hosting ** //
/** Il nome del database di WordPress */
define('DB_NAME', 'nome_del_database_qui');
/** Nome utente del database MySQL */
define('DB_USER', 'nome_utente_qui');
/** Password del database MySQL */
define('DB_PASSWORD', 'password_qui');
You can’t perform that action at this time.