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( 'filter_name', 'your_function_name' ); | |
function your_function_name( $variable ) { | |
// Your code | |
return $variable; | |
} |
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_action( 'action_name', 'your_function_name' ); | |
function your_function_name() { | |
// Your code | |
} |
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 codeAstrology_set_default_qty(){ | |
return 0; | |
} | |
add_filter("woocommerce_quantity_input_min","codeAstrology_set_default_qty"); |
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 codeAstrology_change_product_html( $price ) { | |
global $product; | |
$pid = $product->get_id(); | |
if( has_term( array( 'accessories', 'backpacks' ), 'product_cat', $pid ) ){ | |
$price_html = '<span class="amount">' . $price . ' per kg </span>'; // change weight measurement here | |
}else { | |
$price_html = '<span class="amount">' . $price . ' </span>'; | |
} |
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 codeastrology_wpto_out_of_stock_text( $add_to_cart_text_final, $settings, $column_settings, $table_ID, $product){ | |
$StockQ = !$product->is_in_stock(); | |
if( $StockQ ){ | |
$add_to_cart_text_final = "Out of stock Massage"; | |
} | |
return $add_to_cart_text_final; | |
} | |
add_filter( 'wpto_add_to_cart_text', 'codeastrology_wpto_out_of_stock_text', 10, 5); |
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 | |
$my_shortcode = isset( $settings['text'] ) ? $settings['text'] : ''; | |
echo do_shortcode( $settings['text'] ); |
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 input_for_new_shortcode($_device_name, $column_settings){ | |
$text = isset( $column_settings['new_shortcode']['text'] ) ? $column_settings['new_shortcode']['text'] : false; ?> | |
<input class="ua_input" name="column_settings<?php echo $_device_name ?>[new_shortcode][text]" value="<?php echo esc_attr( $text ); ?>"> | |
<?php | |
} | |
add_action( 'wpto_column_setting_form_new_shortcode', 'input_for_new_shortcode',10,2 ); |
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( !function_exists( 'temp_file_for_new_shortcode' ) ){ | |
function temp_file_for_new_shortcode( $file ){ | |
//$file = __DIR__ . '/../file/hello.php'; | |
$file = $your_file_location; | |
return $file; | |
} | |
} | |
add_filter( 'wpto_template_loc_item_new_shortcode', 'temp_file_for_new_shortcode', 10 ); |
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( !function_exists( 'new_shortcode_column' ) ){ | |
function new_shortcode_column( $column_array ) { | |
$column_array['new_shortcode'] = 'New Shortcode'; | |
return $column_array; | |
} | |
} | |
add_filter( 'wpto_default_column_arr', 'new_shortcode_column' ); |
NewerOlder