This file contains hidden or 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
| SELECT u.ID, u.user_email, count(distinct ifnull(c.comment_ID, 0)) as count, | |
| ( | |
| SELECT GROUP_CONCAT( m.meta_value ) | |
| FROM wp_usermeta m | |
| WHERE m.meta_key = 'member_level' AND m.user_id = u.ID AND m.meta_value != 'Non-member' | |
| ) as member_level | |
| FROM wp_users u | |
| JOIN wp_comments c ON u.ID = c.user_id | |
| WHERE comment_approved = 1 AND comment_type IN ("comment", "") AND c.user_id <> 0 | |
| GROUP BY u.ID |
This file contains hidden or 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
| SELECT | |
| ID, | |
| CONCAT( | |
| ( | |
| SELECT option_value | |
| FROM wp_options | |
| WHERE option_name = 'siteurl' | |
| ), | |
| '/', ( | |
| SELECT slug FROM wp_terms WHERE term_id IN |
This file contains hidden or 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
| // first, run cat ~/Desktop/sql/*.sql | mysql -u root -p minnpost.wordpress in terminal | |
| DELETE FROM wp_options WHERE option_name = 'jetpack_options'; | |
| UPDATE wp_options SET option_value = 'https://minnpost-wordpress.test' WHERE option_name = 'siteurl'; | |
| UPDATE wp_options SET option_value = 'https://minnpost-wordpress.test' WHERE option_name = 'home'; |
This file contains hidden or 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 | |
| error_reporting(E_ALL); | |
| ini_set( 'display_errors','1'); | |
| /* Create a new imagick object */ | |
| $im = new Imagick(); | |
| /* Create new image. This will be used as fill pattern */ | |
| $im->newPseudoImage(50, 50, "gradient:red-black"); |
This file contains hidden or 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
| SELECT t.term_id, REPLACE(t.name, '&', '&') as name, COUNT(p.ID) as post_count, YEAR(post_date) as year, MONTH(post_date) as month | |
| FROM wp_terms t | |
| INNER JOIN wp_term_taxonomy tax ON t.term_id = tax.term_id | |
| INNER JOIN wp_term_relationships r ON tax.term_taxonomy_id = r.term_taxonomy_id | |
| INNER JOIN wp_posts p ON r.object_id = p.ID | |
| WHERE tax.taxonomy = 'category' and YEAR(post_date) >= YEAR(CURDATE()) and p.post_type = 'post' and p.post_status = 'publish' | |
| GROUP BY term_id, YEAR(post_date), MONTH(post_date) | |
| ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC, t.name ASC; |
This file contains hidden or 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
| sublime ~/.config/valet/Log/nginx-error.log |
This file contains hidden or 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
| # keep stage and dev out of indexes | |
| <IfModule mod_headers.c> | |
| <IfModule mod_setenvif.c> | |
| SetEnvIf Host ^stage\. NOINDEX | |
| SetEnvIf Host ^dev\. NOINDEX | |
| Header set X-Robots-Tag "noindex, nofollow, noarchive" env=NOINDEX | |
| </IfModule> | |
| </IfModule> |
This file contains hidden or 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
| # Varnish's cache can be purged by restarting the service: | |
| systemctl restart varnish |
This file contains hidden or 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 | |
| /** | |
| * Remove the default WordPress excerpt field. | |
| */ | |
| function theme_admin_hide_excerpt_field() { | |
| add_action( 'dbx_post_advanced', '_theme_admin_hide_excerpt_field' ); | |
| } | |
| add_filter( 'admin_init', 'theme_admin_hide_excerpt_field' ); | |
| function _theme_admin_hide_excerpt_field() { | |
| $screen = get_current_screen(); |
This file contains hidden or 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
| # remove .git from a svn repository. this is useful for WP plugins | |
| find . -name ".git" -exec svn delete '{}' \; |