Skip to content

Instantly share code, notes, and snippets.

View manchumahara's full-sized avatar
🎯
Focusing

Sabuj Kundu manchumahara

🎯
Focusing
View GitHub Profile
echo do_shortcode('[cbxwpbookmarkbtn object_id="'.$post->ID.'" object_type="'.$post->post_type.'"]');
//echo do_shortcode('[cbxwpbookmarkbtn]');
add_filter('number_format_i18n', 'wpbanglatools_i18n_digit', 10, 1);
add_filter('date_i18n', 'wpbanglatools_i18n_date',10,2);
function wpbanglatools_i18n_digit($en_number){
$en_digits = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$bn_digits = array('০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯');
$en_number = str_replace($en_digits, $bn_digits, $en_number);
//var_dump($en_number);
return $en_number;
}
/**
* on init call shortcode function
*/
add_action('init', 'init_shortcodes');
/**
* Init shortcodes
*/
function init_shortcodes(){
add_shortcode('cbxwoodigitalfiles_simple_product', 'cbxwoodigitalfiles_simple_product_display');
[05-Sep-2019 07:51:15 UTC] Array
(
[PlateNumber] => LSN4149
[VehicleList] => Array
(
[ConsultaID] => 3369212
[Placa] => LSN4149
[Chassi] => 8A1LZBW3TCL848007
[Fabricante] => RENAULT
[GrupoModelo] => FLUENCE
@manchumahara
manchumahara / cbx_restrict_content.php
Last active September 5, 2019 05:24
Restrict any wp page or post for any role
<?php
/**
* Plugin Name: CBX Simple Restrict Content
* Description: Simple or hard coded wordpress content restrict for any role
* Author: Codeboxr
* Version: 1.0.0
* Licence: MIT
* Author URI: https://codeboxr.com
*/
//if you want to use this code in theme ignore lines from 1-10 or use code from 11 to bottom of this page.
(function($) {
$(document).ready(function($) {
//hash link click
$('a[href*="#"]').on('click', function(e) {
e.preventDefault();
//console.log('hash clicked'); //uncomment this link to understand if click is working
@manchumahara
manchumahara / gist:5f8c13e30294f571718f8faed3735ec3
Created July 28, 2019 07:43
Filter 'woocommerce_product_get_image' to custom image
add_filter('woocommerce_product_get_image', 'downloadclub_woocommerce_product_get_image', 10, 6);
function downloadclub_woocommerce_product_get_image($image, $wc_product_obj, $size, $attr, $placeholder, $image2){
if ( $wc_product_obj->get_image_id() ) {
$product_id = $wc_product_obj->get_id();
$content_url = content_url();
$thumb_url = '';
function copyText( text ){
var div = document.createElement( 'div' );
div.innerHTML = text;
div.style.height = '';
div.style.position = 'fixed';
div.style.bottom = '0';
div.style.left = '0';
div.style.opacity = '0';
div.style.display = 'block';
div.style.overflow = 'hidden';
if ( defined('CBXPHPSPREADSHEET_PLUGIN_NAME') && file_exists( CBXPHPSPREADSHEET_ROOT_PATH . 'lib/vendor/autoload.php' ) ) {
//Include PHPExcel
require_once( CBXPHPSPREADSHEET_ROOT_PATH . 'lib/vendor/autoload.php' );
//now take instance
$objPHPExcel = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
//do whatever you need todo
}
<?php
/*
Plugin Name: CBX Accounting Override
Plugin URI: https://codeboxr.com
Description: CBX Accounting Override
Author: Codeboxr
Version: 1.0.0
Author URI: https://codeboxr.com
Text Domain: cbxaccountingoverride
Domain Path: /languages/