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
function init_tel(){ | |
$utils_url = plugins_url('/js/utils.js', __FILE__); | |
?> | |
<script> | |
var input = document.querySelector("#phone"); | |
var iti = window.intlTelInput(input,{ | |
utilsScript: "<?php echo $utils_url; ?>", | |
// the countries at the top of the list. defaults to united states and united kingdom | |
preferredCountries: [ "my", "us", "gb" ], | |
autoPlaceholder: null, |
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
# 1. create the folder of the year in your wordpress project folder | |
mkdir -p /project_folder/wp-content/uploads/2020 | |
# 2. then create child folders for every month!!!!! | |
#this is for 01-09 | |
for i in {1..9}; do mkdir -p /project_folder/wp-content/uploads/2020/0$i; done | |
#this is for 10-12 | |
for i in {0..2}; do mkdir -p /project_folder/wp-content/uploads/2020/1$i; done |
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
$developer = array("name"=>"alia", "job"=>"freelancer", "age"=>"30"); |
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
$parsed_array_to_json = json_decode($developer); |
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
//javascript | |
var developer = <?php echo $parsed_array_to_json; ?>; | |
//access the value. | |
console.log(developer.name, developer.age, developer.job); |
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
$developers = array( | |
array("name"=>"alia", "job"=>"freelancer", "age"=>"30"), | |
array("name"=>"naruto", "job"=>"freelancer hokage", "age"=>"30"), | |
array("name"=>"sasuke", "job"=>"freelancer spy", "age"=>"30") | |
); |
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
$parsed_array_to_json = json_decode($developers); |
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
//javascript | |
var developers = <?php echo $parsed_array_to_json; ?>; | |
//access the value. | |
developers.forEach(logData); | |
function logData(value, index, array) { | |
console.log(value.name, value.age, value.job); | |
} |
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 the directories first in our child theme | |
mkdir -p /var/www/our-wordpress-site/wp-content/themes/child-storefront/assets/js | |
mkdir -p /var/www/our-wordpress-site/wp-content/themes/child-storefront/assets/css | |
//copy files from our machine to the server site. | |
scp utils.js alia@xxx:/var/www/our-wordpress-site/wp-content/themes/child-storefront/assets/js/ | |
scp utils.css alia@xxx:/var/www/our-wordpress-site/wp-content/themes/child-storefront/assets/css/ |
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
function wp_add_javascripts() { | |
wp_enqueue_script('utils-js', | |
get_stylesheet_directory().'/assets/js/utils.js', array('jquery'),'1.1', true); | |
} | |
function wp_add_styles() { | |
wp_enqueue_style('utils-css', | |
get_stylesheet_directory().'/assets/css/utils.css'); | |
} |
OlderNewer