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 | |
/** | |
* Fix Google reCaptcha v3 loading issue in Ninja Forms with Elementor Pro. | |
* | |
* @author Faisal Ahammad <[email protected]> | |
*/ | |
add_filter('ninja_forms_pre_enqueue_recaptcha_v3_js', 'nfele_enqueue_recaptcha_v3_js'); | |
function nfele_enqueue_recaptcha_v3_js() |
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
/** | |
* Set default hour to 09:00 for date/time fields in Ninja Forms | |
* | |
* @author Faisal Ahammad <[email protected]> | |
* | |
* First add the "setdefaulttime" CSS class in the Date/Time → Display → Container to make this code work. | |
*/ | |
jQuery(document).ready(function($) { | |
function checkAndSetHour() { |
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 | |
/** | |
* Gravity Forms Advanced Post Creation Auto Resave | |
* | |
* This code automatically resaves posts created by the Gravity Forms Advanced Post Creation add-on. | |
* It ensures that the post is properly saved and updated in the database. | |
* Visit https://yoursite.com/?force_cron if the code doesn’t run automatically. This URL will force the cron to run. | |
* | |
* @author Faisal Ahammad <[email protected]> | |
*/ |
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 | |
/** | |
* Gravity Forms: Redirect to Newly Created Post After Submission | |
* | |
* @author Faisal Ahammad <[email protected]> | |
* | |
* Replace 123 with your actual Gravity Form ID. | |
*/ | |
add_filter( 'gform_confirmation_123', 'gfapc_redirect_to_created_post', 10, 4 ); |
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
/** | |
* Rearranges label and image elements in the Select Image field | |
* @author Faisal Ahammad <[email protected]> | |
*/ | |
jQuery(document).ready(function ($) { | |
function waitForLabels() { | |
if ($(".listimage-container label").length) { | |
$(".listimage-container label").each(function () { | |
var $this = $(this); |
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
input::placeholder { | |
color: #000; | |
} | |
input::-webkit-input-placeholder { | |
color: #000; | |
} | |
input::-moz-placeholder { | |
color: #000; |
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 multilingual support for required field text in Gravity Forms | |
* | |
* @author Faisal Ahammad <[email protected]> | |
*/ | |
add_filter( 'gform_required_legend', 'dynamic_required_legend', 10, 2 ); | |
function dynamic_required_legend( $legend, $form ) { | |
$form_id = $form['id']; |
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('gform_field_validation', function($result, $value, $form, $field) { | |
// Specify the field IDs you want to restrict (example: 1, 2) | |
$restricted_field_ids = [1, 2]; | |
if (in_array($field->id, $restricted_field_ids)) { | |
// If value is an array (like Name field), convert it to a string | |
if (is_array($value)) { | |
$value = implode(' ', $value); | |
} |
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 | |
function gw_required_placeholder_asterisk( $form ) { | |
foreach ( $form['fields'] as &$field ) { | |
// Skip fields that don't support placeholders | |
if ( ! is_callable( [ $field, 'get_entry_inputs' ] ) ) { | |
continue; | |
} | |
// Single input fields | |
if ( is_array( $field->inputs ) ) { |
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 | |
/** | |
* Use jQuery to replace product thumbnails with full-size images in admin | |
* @author: Faisal Ahammad | |
*/ | |
function replace_admin_thumbnails_with_fullsize_js() { | |
$screen = get_current_screen(); | |
if (!$screen || $screen->base !== 'edit' || $screen->post_type !== 'product') { | |
return; | |
} |
NewerOlder