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
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 = ''; |
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 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'; |
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
if ( defined('CBXPHPSPREADSHEET_PLUGIN_NAME') && cbxphpspreadsheet_loadable() ) { | |
//Include PHPExcel | |
require_once( CBXPHPSPREADSHEET_ROOT_PATH . 'lib/vendor/autoload.php' ); //or use 'cbxphpspreadsheet_load();' | |
//now take instance | |
$objPHPExcel = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); | |
//do whatever you need to do | |
} |
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
<?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/ |
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
add_filter('cbxwpsimpleaccounting_currencies', 'cbxwpsimpleaccounting_currencies_custom_currency'); | |
//how to add new currency | |
/** | |
* Add new currency | |
* | |
* @param array $currency_arr | |
* | |
* @return array |
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
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'] ) . '" />'; |
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
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; |
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
$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 |
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
<?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() | |
{ |