WordPress Snippets
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
name: 🚀 Production rsync deployment by SSH/SFTP | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
name: Build |
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 | |
/* | |
* Redirect if specific slug "hello-world OR hello-regex" not found in URL | |
*/ | |
add_action('template_redirect', 'ic_icredirection'); | |
function ic_icredirection() | |
{ | |
if (!is_user_logged_in()) { | |
$regex = '/^(?:(?!\/(?:hello-world|hello-regex)(?:\/|$)).)*$/m'; |
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 | |
/** | |
* Asssign any elementor widget to a different category | |
* | |
* To override the existing category just pass [ 'your-custom-category' ] | |
* And to keep existing [ 'your-custom-category', 'basic' ] | |
* here 'your-custom-category' is any registered category slug | |
* | |
* @param array $config |
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 | |
/** | |
* Disable elementor registered widget. | |
* | |
* This will disable all WordPress native widgets | |
* | |
* @param \Elementor\Widgets_Manager $widgets_manager Instance of elementor widgets manager | |
* | |
* @author obiPlabon <https://obiPlabon.im> | |
* |
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
/** | |
* Adding custom icon to icon control in Elementor | |
*/ | |
function jet_add_custom_icons_tab( $tabs = array() ) { | |
// Append new icons | |
$new_icons = array( | |
'account', | |
'airplane', | |
'wordpress', |
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
v-change-sys-hostname somedomain.com | |
v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'yes' | |
# v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'no'#mail domain = no | |
v-update-host-certificate admin $HOSTNAME | |
echo "UPDATE_HOSTNAME_SSL='yes'" >> /usr/local/vesta/conf/vesta.conf |
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
// Less project settings, you can edit it and set custom settings. | |
{ | |
// The mappings of source directory and output directory | |
"mappings": [ | |
{ | |
"src": "styles/main.less", | |
"dest": "css/main.css" | |
}, | |
{ | |
"src": "js/main.js", |
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 askForApproval(title = '', content = '', icon = '', url = '') { | |
if(Notification.permission === "granted") { | |
createNotification( | |
title, | |
content, | |
icon, | |
url | |
); | |
} | |
else { |
NewerOlder