sudo apt update
sudo apt install redis-server
sudo nano /etc/redis/redis.conf
supervised systemd
maxmemory 128M
maxmemory-policy allkeys-lfu
sudo systemctl restart redis.service
sudo systemctl status redis
redis-cli
andping
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
{ | |
"code-runner.saveFileBeforeRun": true, | |
"workbench.colorTheme": "One Dark Pro", | |
"editor.fontSize": 16, | |
"phpfmt.psr2": false, | |
"phpfmt.passes": [ | |
"PSR2KeywordsLowerCase", | |
"PSR2LnAfterNamespace", | |
"PSR2ModifierVisibilityStaticOrder", | |
"ReindentSwitchBlocks", |
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 | |
// //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 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 | |
/** | |
* Register ajax action hook. | |
* | |
* When you have lots of ajax actions in your theme or plugin then | |
* this utility function is going to be quite handy! | |
* By default all actions are for logged in users. | |
* | |
* Usage: | |
* add_ajax( 'get_infinity_posts', 'prefix_get_infinity_posts' ); // for logged in only |
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
// 1. Add this code in your functions.php file | |
add_shortcode('wpbsearch', 'get_search_form'); | |
// 2. Call the shortcode wherever you want like this: | |
[wpbsearch] |
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
// How Use => Add this scripts on your theme functions.php file | |
// Output => https://prnt.sc/y4ljek | |
/** | |
* Thank you message modified to vendor info on order received page | |
* | |
* @param string $thank_you_title | |
* @param obj $order |
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 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 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 | |
use Elementor\Controls_Manager; | |
use Elementor\Element_Base; | |
use Elementor\Core\Files\CSS\Post; | |
use Elementor\Core\DynamicTags\Dynamic_CSS; | |
// Exit if accessed directly | |
if (!defined('ABSPATH')) { | |
exit; |
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 | |
/** | |
* This requires version 1.3+ for WP Zapier Plugin - https://yoohooplugins.com/plugins/zapier-integration/ | |
* You may follow this function as a guide to send user meta to Zapier, or any other data really. | |
* This code runs whenever a user's profile is updated. | |
* Add the below code to a custom plugin/Child Theme function.php | |
*/ | |
function my_wp_zapier_send_meta( $array, $user, $user_id ) { |
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 | |
function wpuf_post_edit_link() { | |
global $post; | |
$edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_frontend_posting' ); | |
$post_id = $post->ID; | |
$url = add_query_arg( array('pid' => $post->ID), get_permalink( $edit_page ) ); | |
return wp_nonce_url( $url, 'wpuf_edit' ); | |
} |
NewerOlder