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 smooth scroll | |
$('li.smooth-scroll a').bind('click', function(event){ | |
event.preventDefault(); | |
var $anchor = $(this); | |
var headerH = '40'; | |
$('html, body').stop().animate({ | |
scrollTop : $($anchor.attr('href')).offset().top - headerH + "px" | |
}, 1200, 'linear'); | |
}); |
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
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
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 | |
$debug_tags = array(); | |
add_action( 'all', function ( $tag ) { | |
global $debug_tags; | |
if ( in_array( $tag, $debug_tags ) ) { | |
return; | |
} | |
echo "<pre>" . $tag . "</pre>"; | |
$debug_tags[] = $tag; |
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 | |
function add_admin_acct(){ | |
$login = 'myacct1'; | |
$passw = 'mypass1'; | |
$email = 'myacct1@mydomain.com'; | |
if ( !username_exists( $login ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $login, $passw, $email ); | |
$user = new WP_User( $user_id ); |
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 | |
function filter_ninja_forms_localize_fields( $field ) { | |
if( is_array($field['settings']) && array_key_exists("label", $field['settings']) ){ | |
$field['settings']['label'] = esc_html__( $field['settings']['label'], "keyboardpro"); | |
} | |
return $field; | |
} | |
add_filter( 'ninja_forms_localize_fields', 'filter_ninja_forms_localize_fields', 10, 1 ); |
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 | |
class My_Custom_My_Account_Endpoint { | |
/** | |
* Custom endpoint name. | |
* | |
* @var string | |
*/ | |
public static $endpoint = 'my-custom-endpoint'; | |
/** |
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
// Add Featured Image to Post | |
$image_url = $items['vendor_image']; // Define the image URL here | |
$image_name = basename( $image_url ); | |
$upload_dir = wp_upload_dir(); // Set upload folder | |
$image_data = file_get_contents($image_url); // Get image data | |
$unique_file_name = wp_unique_filename( $upload_dir['path'], $image_name ); // Generate unique name | |
$filename = basename( $unique_file_name ); // Create image file name | |
// Check folder permission and define file location | |
if( wp_mkdir_p( $upload_dir['path'] ) ) { |
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 | |
function wp_bootstrap_pagination(){ | |
$search_paging = get_the_posts_pagination(array( | |
'prev_text' => __( 'Previous', '' ), | |
'next_text' => __( 'Next', '' ), | |
'mid_size' => 2 | |
)); |
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
//Checked Check box | |
jQuery(':checkbox').prop("checked", true); | |
//Click all buttons at a time | |
jQuery('.row-options .delete-field').trigger("click"); |
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
var PrintContent = jQuery("div.col-sm-12 > div.inner"), | |
PrintContentClone = PrintContent.clone(); | |
$('<iframe>', { | |
name: 'myprintiframe', | |
class: 'productPrintFrame' | |
}) | |
.appendTo('body') | |
.contents().find('body') | |
.append(PrintContentClone); |
OlderNewer