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
// Custom scrolling bar for select | |
// Solution for no scroll in MAC browsers | |
<html> | |
<head> | |
<style> | |
.frame::-webkit-scrollbar { | |
-webkit-appearance: none; | |
} |
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
jQuery(document).ready(function($) { | |
var divBodyConfig = { | |
selector: '.tinymce-body', | |
menubar: false, | |
inline: true, | |
plugins: [ | |
'link', | |
'textcolor', | |
'lists', | |
// 'powerpaste', |
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 custom_wc_translations( $translated_text, $text, $domain ) { | |
if(is_checkout()){ | |
switch ($translated_text) { | |
case 'Replaceble_text' : | |
$translated_text = __('String to Replace', 'Domain'); | |
break; | |
} | |
} | |
return $translated_text; |
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 | |
// Content jumping when scroll bar is introduced | |
<div class="outer-wrapper"> | |
<div class="inner-wrapper"> | |
<div> | |
// Contents that affects overflow here | |
</div> | |
</div> | |
</div> |
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 | |
// Get wordpress upload folder directory | |
function get_upload_folder_path(){ | |
$current_user = wp_get_current_user(); | |
$upload_dir = wp_upload_dir(); | |
$uploads_folder = $upload_dir['basedir']; // Path to wordpress uploads folder | |
return $uploads_folder; | |
} | |
?> |
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
<html> | |
<form id="sample_form" name="sample-form"> | |
<p> | |
<label>Name</label><br> | |
<input value="Melvin Stanly" type="text"> | |
</p> | |
<p> | |
<label>File</label><br> | |
<input id="example-file" type="file"> | |
</p> |
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
Color picker won't appear when clicked, if it is inside a scrollable div. | |
Also when colorpicker is opened and scrolled, the colorpicker also get scrolled. | |
The solution to fix this is to add `position:relative` to the parent div in which input field, span(colorpicker preview) and | |
div(iris-picker iris-border). |
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 to fix “this file type is not permitted for security reasons” in WordPress | |
function enable_extended_upload ( $mime_types =array() ) { | |
// The MIME types listed here will be allowed in the media library. | |
// You can add as many MIME types as you want. | |
$mime_types['gz'] = 'application/x-gzip'; | |
$mime_types['zip'] = 'application/zip'; | |
$mime_types['rtf'] = 'application/rtf'; | |
$mime_types['ppt'] = 'application/mspowerpoint'; |
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
* To replace all runs of white spaces in a string with ( _ ) underscore => /\s+/g | |
-> Replace adjacent white spaces with a single underscore | |
* To replace whitespace in a string with underscore => / /g | |
-> Replace each white space with a single underscore. Each adjacent white spaces will be replaced |
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
// Remove all data attributes of an element | |
$.each( $("element-selected").data(), function(i){ | |
$("div").removeAttr("data-" + i); | |
}); |
OlderNewer