This file contains hidden or 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
Number : <input type="text" name="quantity" id="quantity" /> <span id="errmsg"></span> | |
$(document).ready(function () { | |
//called when key is pressed in textbox | |
$("#quantity").keypress(function (e) { | |
//if the letter is not digit then display error and don't type anything | |
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) { | |
//display error message | |
$("#errmsg").html("Digits Only").show(); | |
return false; |
This file contains hidden or 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
onkeypress="return (event.charCode !=8 && event.charCode ==0 || (event.charCode >= 48 && event.charCode <= 57))" |
This file contains hidden or 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="wrapper"> | |
<div class="lazy-background img"></div> | |
<div class="lazy-background img"></div> | |
<div class="lazy-background img"></div> | |
<div class="lazy-background img"></div> | |
<div class="lazy-background img"></div> | |
</div> |
This file contains hidden or 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
/** | |
* Create Shoebox - Check if Shoebox name already exists if does do not create duplicated shoebox. | |
*/ | |
function dwply_check_group_name( $group_new ) { | |
if ( 'group-details' == bp_get_groups_current_create_step() ) { | |
$args = array( | |
'per_page' => null, | |
'populate_extras' => false, | |
'update_meta_cache' => false | |
); |
This file contains hidden or 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
git config credential.helper 'cache --timeout=9000000' |
This file contains hidden or 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
/** | |
* Enable SVG upload. | |
*/ | |
function dwply_svgs_upload_mimes( $mimes = array() ) { | |
// allow SVG file upload | |
$mimes['svg'] = 'image/svg+xml'; | |
$mimes['svgz'] = 'image/svg+xml'; | |
return $mimes; | |
} |
This file contains hidden or 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
/** | |
* Register Flexible Content Group | |
* | |
* @since 1.0.0 | |
*/ | |
public function dwply_universalia_builder_register_flexible_content_group() { | |
if( function_exists('acf_add_local_field_group') ): | |
acf_add_local_field_group(array( | |
'key' => 'group_5e7fbfdd8cbaa', | |
'title' => 'Universalia Content Builder', |
This file contains hidden or 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 | |
add_filter( 'acf/load_field/name=flex_layout', __CLASS__ . '::craft_content_layouts' ); | |
static function craft_content_layouts( $field ) { | |
// Remove the layouts | |
// that are named in this list | |
$remove_list = [ | |
'paragraph', | |
'banner', |
This file contains hidden or 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 | |
/** | |
* The below function will help to load template file from plugin directory of wordpress | |
* Extracted from : http://wordpress.stackexchange.com/questions/94343/get-template-part-from-plugin | |
*/ | |
define('PLUGIN_DIR_PATH','Your-plugin-directory-path'); | |
function ccm_get_template_part($slug, $name = null) { | |
do_action("ccm_get_template_part_{$slug}", $slug, $name); |
This file contains hidden or 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 | |
/** | |
* Check if the given user agent string is one of a crawler, spider, or bot. | |
* | |
* @param string $user_agent | |
* A user agent string (e.g. Googlebot/2.1 (+http://www.google.com/bot.html)) | |
* | |
* @return bool | |
* TRUE if the user agent is a bot, FALSE if not. |