https://developers.facebook.com/tools/debug/
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 | |
// Sample code for reference | |
global $wpdb; | |
$year = (int) ( $_GET['year'] ?? date_i18n( 'Y' ) ); | |
$sql = "SELECT * FROM transactions WHERE DATE( datetime_created ) LIKE %s"; | |
$sql = $wpdb->prepare( $sql, $year . '-01-%' ); |
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 | |
/* | |
Place in theme's functions.php or /wp-content/mu-plugins folder | |
Assumes: | |
- PHP 7 | |
- WP 5.2 | |
- Gravity Forms | |
- Edit this file for the appropriate invite code => gform_id relationships (lines 32-37) | |
- Edit this file for the appropriate invite code user meta key (line 41) | |
*/ |
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
location ~* ^/wp-content/.*\.(png|jpe?g)$ { | |
add_header Vary Accept; | |
if ($http_accept !~* "webp"){ | |
break; | |
} | |
if ( !-f $request_filename ) { | |
return 404; | |
} |
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
git checkout $revision-hash file-name.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 | |
foreach ( [ 'Andy', 'Drew', 'Rob', 'Shane', 'Chris' ] as $name ) | |
{ | |
switch ( $name ) | |
{ | |
case 'Rob' : | |
case 'Drew' : | |
case 'Shane' : | |
// continue; // acts as break within switch(); needs arg "2" | |
continue 2; |
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
<!-- Typical builds --> | |
<style> | |
.heading { color: blue; } | |
.list-red { color: red; } | |
p.intro { font-size: 1.2em; } | |
p.intro span { font-weight: bold;} | |
</style> | |
<section class="section section__prices"> |
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
mysqldump -u root -p --all-databases > alldb.sql | |
mysqldump -u root -p --opt --all-databases > alldb.sql | |
mysqldump -u root -p --all-databases --skip-lock-tables > alldb.sql | |
mysqldump -u root -p --all-databases --single-transaction --skip-lock-tables > all-your-db.sql |
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 the following code to your functions.php or | |
// save this file to your /wp-content/mu-plugins/ folder. | |
// | |
\add_filter( 'pr_message_content', function( $content ){ | |
return \do_shortcode( $content ); | |
}); |
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
UPDATE wp_options | |
SET option_value = 'https://dev.website.com' | |
WHERE option_name IN ( 'home', 'siteurl' ); |
OlderNewer