sudo apt updatesudo apt install redis-serversudo nano /etc/redis/redis.confsupervised systemdmaxmemory 128Mmaxmemory-policy allkeys-lfusudo systemctl restart redis.servicesudo systemctl status redisredis-cliandping
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 emoji support | |
| remove_action('wp_head', 'print_emoji_detection_script', 7); | |
| remove_action('wp_print_styles', 'print_emoji_styles'); | |
| // // Remove rss feed links | |
| remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
| remove_action( 'wp_head', 'feed_links', 2 ); |
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 | |
| add_post_meta( 5, 'fruit', 'orange', false ); | |
| add_post_meta( 5, 'fruit', 'grape', false ); | |
| add_post_meta( 5, 'fruit', 'apple', false ); | |
| add_post_meta( 5, 'veggie', 'carrot', false ); | |
| print_r(get_post_meta( 5, 'fruit', false )); |
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
| // Get Posts | |
| $posts = get_posts([ | |
| 'post_type' => 'press-release', | |
| 'posts_per_page' => 25, | |
| 'category' => 4, | |
| ]); | |
| foreach($posts as $post){ | |
| setup_postdata($post); |
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
| function upload_svg_files( $allowed ) { | |
| if ( !current_user_can( 'manage_options' ) ) | |
| return $allowed; | |
| $allowed['svg'] = 'image/svg+xml'; | |
| return $allowed; | |
| } | |
| add_filter( 'upload_mimes', 'upload_svg_files'); |
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
| // Removing plugin controls from admin | |
| function remove_plugin_controls($actions, $plugin_file, $plugin_data, $context){ | |
| if (array_key_exists('edit', $actions)) { | |
| unset($actions['edit']); | |
| } | |
| if (array_key_exists('deactivate', $actions)) { |
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
| function defer_parsing_of_js($url) | |
| { | |
| if (is_admin()) return $url; //don't break WP Admin | |
| if (false === strpos($url, '.js')) return $url; | |
| if (strpos($url, 'jquery.js')) return $url; | |
| return str_replace(' src', ' defer src', $url); | |
| } | |
| add_filter('script_loader_tag', 'defer_parsing_of_js', 10); |
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_value upload_max_filesize 64M | |
| php_value post_max_size 64M | |
| php_value max_execution_time 300 | |
| php_value max_input_time 300 |
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
| rsync -rlmvz --size-only --ipv4 --progress -e 'ssh -p 2222' <env>.<site_id>@appserver.<env>.<site_id>.drush.in:files/ . |
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
| <?xml version="1.0"?> | |
| <ruleset name="WordPress Theme Coding Standards"> | |
| <!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | |
| <!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml --> | |
| <!-- Set a description for this ruleset. --> | |
| <description>A custom set of code standard rules to check for WordPress themes.</description> | |
| <!-- Include the WordPress ruleset, with exclusions. --> | |
| <rule ref="WordPress"> |
NewerOlder