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 | |
/** | |
* Polylang Shortcode - https://wordpress.org/plugins/polylang/ | |
* Add this code in your functions.php | |
* Put shortcode [polylang_langswitcher] to post/page for display flags | |
* | |
* @return string | |
*/ | |
function custom_polylang_langswitcher() { | |
$output = ''; |
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 | |
/** | |
* Gravity Forms: Use WooCommerce emails templates for notifications. | |
* | |
* @param string $template | |
* | |
* @return string | |
*/ | |
public function custom_gform_html_message_template_pre_send_email( string $template ) { |
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
// ==UserScript== | |
// @name YouTubeMusicScript | |
// @description YouTubeMusicScript | |
// @include http://music.youtube.com/* | |
// @autho Nicolas Mollet | |
// @version 1.0 | |
// ==/UserScript== | |
// Observe play-button clicks. |
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 | |
/** | |
* Catch plugin deactivation and write log of cause of deactivation (manual or error). | |
* | |
* Examples: | |
* [29-Sep-2023 07:40:40 UTC] Plugin antispam-bee/antispam_bee.php was disabled manually. | |
* [29-Sep-2023 07:47:29 UTC] Plugin antispam-bee/antispam_bee.php was disabled because Plugin file does not exist. | |
* | |
* @param string $plugin Path to the plugin file relative to the plugins directory. |
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: SITENAME | |
recipe: lemp | |
config: | |
env: dev | |
php: '7.1' | |
composer_version: '1.10.19' | |
database: mysql | |
webroot: . | |
xdebug: false | |
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
<div class="addthis_sharing_toolbox" data-url="http://customurl.com" data-title="customtitle"></div> | |
<script type="text/javascript"> | |
var addthis_share = addthis_share || {}; | |
addthis_share = { | |
passthrough: { | |
twitter: { | |
via: 'twitteraccount', | |
text: 'lorem ipsum' | |
} |
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 | |
/** | |
* Replace Home menu item by home icon | |
* | |
* @param $sorted_menu_items | |
* | |
* @return mixed | |
*/ | |
function homeicon_nav_menu_objects( $sorted_menu_items ) | |
{ |
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 | |
// Generate an admin scheme using the generator here: http://themergency.com/generators/admin-color-scheme-generator/ | |
// Copy the css file in css/admin.css | |
// Then include this function in your functions.php | |
// And setup the four hexadecimal colors | |
function custom_admin_color_schemes() { | |
$theme_dir = get_template_directory_uri(); | |
wp_admin_css_color( 'nameofscheme', 'Name of Scheme', | |
$theme_dir . 'css/admin.css', |
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 | |
/** | |
* WooCommerce: hide shipping when products marked as "local pickup only" are in the cart | |
* Tested with WordPress 5.3.4 and WooCommerce 4.2.0 | |
* | |
* The shipping class "local-pickup-only" needs to be created first. | |
* Then assign the products that are have "local pickup only" to this class | |
* | |
* @param array $rates | |
* @param array $package |
NewerOlder