Skip to content

Instantly share code, notes, and snippets.

@kamlesh08
kamlesh08 / validation_msgs_key_codes
Created February 15, 2021 12:23
Validation Message Key Codes for Contact Form Module
'empty_name' => __( 'Please enter your name.', 'bb-powerpack' ),
'empty_email' => __( 'Please enter a valid email address.', 'bb-powerpack' ),
'empty_phone' => __( 'Please enter a valid phone number.', 'bb-powerpack' ),
'empty_subject' => __( 'Please enter a subject.', 'bb-powerpack' ),
'empty_message' => __( 'Please type your message.', 'bb-powerpack' ),
'captcha_error' => __( 'Please check the captcha to verify you are not a robot.', 'bb-powerpack' ),
'checkbox_error' => __( 'Please check this field.', 'bb-powerpack' ),
'failed_message' => __( 'Message failed. Please try again.', 'bb-powerpack' ),
'sent_message' => __( 'Message Sent!', 'bb-powerpack' ),
@kamlesh08
kamlesh08 / change_name_validation_msg_contact_form
Created February 15, 2021 11:22
Change Validation Message in Contact Form Module
add_filter( 'pp_contact_form_strings_i18n', function( $msgs ) {
// Previous msg - Please enter your name.
// New msg
$msgs['empty_name'] = 'Your custom validation message.';
return $msgs;
} );
@kamlesh08
kamlesh08 / change_pwd_reset_email.php
Last active November 16, 2020 09:11
Change "A password reset email has been sent..." message in Login Form Module
add_filter( 'pp_login_form_js_messages_i18n', function ( $msgs ) {
// Add the message that you want to be displayed when a password reset email has been sent.
$msgs['email_sent'] = 'A password reset email has been sent to the email address for your account, but may take several minutes to show up in your inbox. Please wait at least 10 minutes before attempting another reset.';
// Add the message that you want to be displayed when password has been reset successfully.
$msgs['reset_success'] = 'Your password has been reset successfully.';
return $msgs;
}, 10 );
@kamlesh08
kamlesh08 / 15722.css
Created July 30, 2020 13:39
Arrows Image Slider PPE - Custom
@media only screen and ( min-width: 1024px ){
.swiper-pagination {
text-align: right;
}
.pp-slider-arrow {
position: absolute;
top: 96.4%;
}
.pp-slider-arrow.pp-arrow-next {
right: -5% !important;
@kamlesh08
kamlesh08 / 15809.js
Created July 27, 2020 08:30
15809 - Image Carousel inside Expandable Row
;(function($) {
$(document).on('pp_expandable_row_toggle', function(e, selector) {
if ( selector.is('.pp-er-open') && selector.parent().find( '.fl-node-5f17183d368c0' ).length > 0 ) {
carousel_5f17183d368c0.swipers.main.update();
}
});
})(jQuery);
@kamlesh08
kamlesh08 / advanced-tabs-content-on-hover.js
Created July 9, 2020 09:11
View Advanced Tabs Content on Hover - PPBB - #15518
(function($) {
$(document).ready(function() {
$('.pp-tabs-labels .pp-tabs-label').on('mouseover', function() {
if ( $(this).hasClass('pp-tab-active') ) {
return;
}
$(this).trigger('click');
});
});
})(jQuery);
@kamlesh08
kamlesh08 / activate-expandable-row.js
Created July 9, 2020 08:31
URL Anchor for opening an Expandable Row
(function($) {
$(window).on('load hashchange', function() {
if ( 'astrazeneca' === location.hash.replace('#', '') ) {
$('.fl-node-5eff90a74db9e .pp-er-wrap').trigger('click');
}
});
})(jQuery);
@kamlesh08
kamlesh08 / cart-form-in-2-columns.css
Last active May 22, 2020 13:26
WooCommerce Cart Form in 2 Columns
form.woocommerce-cart-form {
max-width: 60%;
float: left;
}
.woocommerce .cart-collaterals, .woocommerce-page .cart-collaterals {
width: 35%;
float: right;
}
@kamlesh08
kamlesh08 / sort-table-automatically.js
Last active May 21, 2020 09:09
Sort tables automatically in PowerPack Beaver Table Module
;(function($) {
$('.pp-table-wrap .tablesaw-sortable-switch select').trigger('change');
})(jQuery);
function fl_builder_loop_query_args_filter( $query_args ) {
if ( 'test-grid' == $query_args['settings']->id ) {
$query_args['post_parent'] = 0;
}
return $query_args;
}
add_filter( 'fl_builder_loop_query_args', 'fl_builder_loop_query_args_filter' );