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 | |
/** | |
* Call a shortcode function by tag name. | |
* | |
* @param string $tag The shortcode whose function to call. | |
* @param array $atts The attributes to pass to the shortcode function. Optional. | |
* @param array $content The shortcode's content. Default is null (none). | |
* | |
* @return string|bool False on failure, the result of the shortcode on success. | |
*/ |
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
<?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
app.use((request, response, next) => { | |
// wheather `req.write` / `req.send` / `req.json`, express calls underlying `socket.write` | |
// thus intercepting `socket.write` | |
const backup = response.socket.write; | |
let code; | |
function newWriter(...args) { | |
for (const arg of args) { | |
if (typeof arg === 'string') { |
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
// Click event happened in iframe won't propagate to the containing element of it. | |
// This script provides a workaround to simulate the propagation of click event of iframe. | |
// | |
// inspired by https://gist.github.com/jaydson/1780598#gistcomment-2609301 | |
(function ($) { | |
var selector = '[data-event-category][data-event-action]'; | |
var $elementsContainIframe = $(selector).filter(function () { | |
return $(this).find('iframe,script').length; |
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 | |
/** | |
* Adding custom icon to icon control in Elementor | |
*/ | |
function modify_icon_controls($controls_registry) { | |
//3696 material design icon classes | |
$material_design_icons_cls = 'mdi mdi-access-point, mdi mdi-access-point-network, mdi mdi-access-point-network-off, mdi mdi-account, mdi mdi-account-alert, mdi mdi-account-alert-outline, mdi mdi-account-arrow-left, mdi mdi-account-arrow-left-outline, mdi mdi-account-arrow-right, mdi mdi-account-arrow-right-outline, mdi mdi-account-badge, mdi mdi-account-badge-alert, mdi mdi-account-badge-alert-outline, mdi mdi-account-badge-horizontal, mdi mdi-account-badge-horizontal-outline, mdi mdi-account-badge-outline, mdi mdi-account-box, mdi mdi-account-box-multiple, mdi mdi-account-box-outline, mdi mdi-account-card-details, mdi mdi-account-card-details-outline, mdi mdi-account-check, mdi mdi-account-check-outline, mdi mdi-account-child, mdi mdi-account-child-circle, mdi mdi-account-circle, mdi mdi-account-circle-outline, mdi mdi-account-clock, mdi mdi-account-clock- |
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 example will add a custom "select" drop down & "switcher" to the "testimonial" section | |
// and add custom "color" to the "testimonial style" section | |
add_action('elementor/element/before_section_end', 'add_control_in_existing_widget', 10, 3 ); | |
function add_control_in_existing_widget( $section, $section_id, $args ) { | |
if( $section->get_name() == 'testimonial' && $section_id == 'section_testimonial' ){ | |
// we are at the end of the "section_testimonial" area of the "testimonial" | |
$section->add_control( | |
'testimonial_name_title_pos' , | |
[ |
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
#!/usr/bin/env bash | |
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error | |
# Make sure that the .gnupg directory and its contents is accessibile by your user. | |
chown -R $(whoami) ~/.gnupg/ | |
# Also correct the permissions and access rights on the directory | |
chmod 600 ~/.gnupg/* | |
chmod 700 ~/.gnupg |
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 | |
/** | |
* @license GPLv3 (or any later version) | |
* @see http://kizu514.com/blog/refactor-your-slow-form-using-php-generators-and-event-streams/ | |
*/ | |
namespace KIZU514; | |
class EventEmitter | |
{ |
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
<link media="all" rel="stylesheet" href="https://unpkg.com/[email protected]/dist/video-js.css"> | |
<script src="https://unpkg.com/[email protected]/dist/video.js"></script> | |
<video-js id="player"> | |
<source src="//video/index.m3u8" type="application/x-mpegURL" /> | |
</video-js> | |
<script> | |
var player = videojs("player"); | |
var prefix = "key://"; | |
var urlTpl = "https://domain.com/path/{key}"; |
NewerOlder