Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sabuj Kundu manchumahara

🎯
Focusing
Block or report user

Report or block manchumahara

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:827675e49a73c53596ae729e7d39d440
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
}
View cbxaccountingoverride.php
<?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/
@manchumahara
manchumahara / gist:6a432b33c7422c803822cfb1dffc5f7e
Last active May 20, 2019
How to add Mongolian tögrög to CBX Accounting
View gist:6a432b33c7422c803822cfb1dffc5f7e
add_filter('cbxwpsimpleaccounting_currencies', 'cbxwpsimpleaccounting_currencies_custom_currency');
//how to add new currency
/**
* Add new currency
*
* @param array $currency_arr
*
* @return array
View unified_woo_placeholder_image.php
add_filter('woocommerce_placeholder_img_src', 'downloadclub_woocommerce_placeholder_img_src', 10, 1);
function downloadclub_woocommerce_placeholder_img_src( $src ) {
return get_template_directory_uri() . '/assets/img/default_thumb.png';
}
add_filter('woocommerce_placeholder_img', 'downloadclub_woocommerce_placeholder_img', 10, 3);
function downloadclub_woocommerce_placeholder_img($image_html, $size, $dimensions){
$image = wc_placeholder_img_src( $size );
$image_html = '<img src="' . esc_attr( $image ) . '" alt="' . esc_attr__( 'Placeholder', 'woocommerce' ) . '" width="' . esc_attr( $dimensions['width'] ) . '" class="woocommerce-placeholder wp-post-image" height="' . esc_attr( $dimensions['height'] ) . '" />';
@manchumahara
manchumahara / gist:bcdb7bd4f4e2f1c6f9744da16cbb8d24
Created Apr 30, 2019
WC()->cart null or such error fix for wc 3.6.0 or higher
View gist:bcdb7bd4f4e2f1c6f9744da16cbb8d24
if ( version_compare( WC_VERSION, '3.6.0', '>=' )) {
require_once( WC_ABSPATH . 'includes/wc-cart-functions.php' );
require_once( WC_ABSPATH . 'includes/wc-notice-functions.php' );
if ( null === WC()->session ) {
$session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
// Prefix session class with global namespace if not already namespaced
if ( false === strpos( $session_class, '\\' ) ) {
$session_class = '\\' . $session_class;
@manchumahara
manchumahara / buddyposting_object.php
Last active Apr 1, 2019
buddyPress posting for poll vote example
View buddyposting_object.php
$buddy_post = array(
'id' => false,
// Pass an existing activity ID to update an existing entry.
'action' => sprintf(__( '%s has voted poll: <a target="_blank" href = "%s">%s</a>', 'cbxpollproaddon' ), bp_core_get_userlink( bp_loggedin_user_id() ), esc_url(get_permalink( $poll_id )), esc_attr(get_the_title( $poll_id )) ),
// The activity action - e.g. "Jon Doe posted an update"
'content' => apply_filters( 'cbxpoll_buddypress_vote_usernote', __( '<blockquote>I have voted on this poll, why not you ?</blockquote>', 'cbxpollproaddon' ), $user_id, $poll_id ),
'component' => 'cbxpoll',
// The name/ID of the component e.g. groups, profile, mycomponent
'type' => 'cbxpoll_vote',
// The activity type e.g. activity_update, profile_updated
View wp hooks and filters example
<?php
//action
do_action('tagname');
do_action('tagname2', 'asdasd', 2);
add_action('tagname', 'callback_function');
add_action('tagname2', 'callback_function2', 10, 2);
function callback_function()
{
View swipe slider 3.4.2 limited nav items
//timeline
var timelineLimit = 7;
var timelineHalf = 3;
var timelineTotal = 0;
var timelineLimitO = 0;
var timelineHalfO = 0;
var timelineActive = 0;
var timelineSwiper = new Swiper ('.timeline .swiper-container', {
direction: 'vertical',
@manchumahara
manchumahara / gist:6ee3f5e9ea1e63f9df09f03e475810fb
Created Dec 10, 2018
cbx single criteria rating integration
View gist:6ee3f5e9ea1e63f9df09f03e475810fb
if ( function_exists( 'cbxscratingreview_postAvgRatingInfo' ) )
{
echo cbxscratingreview_postAvgRatingRender( get_the_ID() );
}
if(function_exists('cbxscratingreview_reviewformRender')){
echo cbxscratingreview_reviewformRender();
}
if ( function_exists( 'cbxscratingreview_postReviewsRender' ) )
View cbxdebug.php
<?php
/**
* @package Joomla.Plugin
* @subpackage System.CBXDebug
*
* @copyright Copyright (C) 2018 Codeboxr.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
You can’t perform that action at this time.