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 | |
/* | |
This function will return easy to use email object which can be use in | |
any email template by giving the order id only | |
*/ | |
function coder618_get_email_obj($order_id){ | |
$email_obj = ['order_id' => $order_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
$has_stock = false; | |
// echo $product->get_type(); | |
if( $product->get_type() == 'variable' ){ | |
$available_variations = $product->get_available_variations(); | |
foreach( $available_variations as $item ){ | |
if($item['is_in_stock']== true){ | |
$has_stock = true; | |
} | |
} |
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 | |
// require_once 'app/aws/aws-autoloader.php'; | |
require 'vendor/autoload.php'; | |
$awsAccessKeyId = '-----'; | |
$awsSecretKey = '-----'; | |
$credentials = new \Aws\Credentials\Credentials($awsAccessKeyId, $awsSecretKey); | |
$client = new \Aws\Polly\PollyClient([ | |
'version' => '2016-06-10', | |
'credentials' => $credentials, | |
'region' => 'us-east-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
<ul class="accordion"> | |
<?php for($i=0; $i< 5; $i++): ?> | |
<li> | |
<a class="toggle" href="javascript:void(0);">Item 1 <i class="far fa-chevron-down"></i></a> | |
<div class="inner"> | |
some inner textttttttt | |
</div> | |
</li> | |
<?php endfor; ?> | |
</ul> |
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
Q1: Suppose this array come from back-end. data of this array can be dynamic. | |
You have to make a Dynamic HTML Output (using ul tag) based on this array, | |
where each item will fall under its parent id. | |
output will look something like this. | |
Bangladesh | |
Dhaka | |
Uttara | |
Khilgaon |
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
/** | |
Return Form Data in json formate. | |
require jQuery Form Selector | |
*/ | |
function returnFormJson(fromSelector) { | |
var output = []; | |
var f_Data = $(fromSelector).serializeArray(); |
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
function returnIndex() { | |
var postsPerPage = 12; | |
console.log('return start endindex ', page, postsPerPage); | |
let startIndex = postsPerPage * page; | |
let endIndex = startIndex + postsPerPage; | |
return [ startIndex, endIndex ]; | |
} |
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
HTML, PHP | |
{ | |
"php tag": { | |
"prefix": "php", | |
"body": ["<?php $1 ?>"], | |
"description": "php" | |
}, | |
"coder618_print": { | |
"prefix": "coder618_print_markup", | |
"body": ["<?php coder618_print_markup($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 | |
use Carbon_Fields\Container; | |
use Carbon_Fields\Field; | |
use Carbon_Fields\Block; | |
add_action( 'carbon_fields_register_fields', 'dd' ); | |
function dd(){ | |
// var_dump( WP_Block_Type_Registry::get_instance()->get_all_registered() ); | |
Block::make( __( 'My Shiny Gutenberg Block' ) ) |
NewerOlder