Skip to content

Instantly share code, notes, and snippets.

advokatb

  • Ukraine
Block or report user

Report or block advokatb

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
@advokatb
advokatb / email_if_ordertotal.php
Created Sep 19, 2019
WooCommerce New order notification if order total bigger than value
View email_if_ordertotal.php
<?php
// New order notification if order total bigger than value
add_action( 'woocommerce_checkout_order_processed', 'devise_email_if_ordertotal_bigger_than', 20, 1 );
function devise_email_if_ordertotal_bigger_than ( $order_id ) {
$order = wc_get_order( $order_id );
$total = $order->get_total();
$total_over = 500;
View admin-bar-menu-filter.php
<?php
/**
* Change site url in admin bar
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function admin_bar_menu_filter( WP_Admin_Bar $wp_admin_bar ) {
$new_url = 'site.org';
$site_name_node = $wp_admin_bar->get_nodes()['site-name'];
$site_name_node->href = $new_url;
View devise-woocommerce.php
<?php
/* Display only children of current category in Woocommerce product categories widget */
add_filter('woocommerce_product_categories_widget_args','woo_current_product_category');
function woo_current_product_category( $args ){
global $wp_query, $post, $woocommerce;
$include = array();
$category_parent = '';
@advokatb
advokatb / chat.xc
Created Mar 30, 2017 — forked from Tey/chat.xc
[WoT] Colorize in battle chat with XVM colors
View chat.xc
{
// Add the following line to @xvm.rc to register that file:
// , "chat": ${"chat.xc":"chat"}
// Color values for substitutions.
// Значения цветов для подстановок.
"def": {
// Dynamic color by various statistical parameters.
// Динамический цвет по различным статистическим показателям.
"colorRating": {
@advokatb
advokatb / functions.php
Created Feb 14, 2017
Internal CSS for WordPress Homepage
View functions.php
<?php if( is_home() || is_front_page() ) : ?>
<style id="my-internal-css">
#main_content .container {
position: relative;
padding: 120px 0;
}
</style>
<?php endif; ?>
@advokatb
advokatb / Gravity Forms and Fancybox
Created Nov 10, 2015 — forked from mandiwise/Gravity Forms and Fancybox
Using Gravity Forms with a modal and ajax
View Gravity Forms and Fancybox
<div id="voting-form" style="display:none">
<?php echo do_shortcode( '[gravityform id="6" title="false" description="false" ajax="true"]' ) ?>
</div>
<a href="#voting-form" class="fancybox button">Vote Now</a>
View gist:ce6c71fcbe1e857dfd72
add_filter( 'job_manager_application_email_subject', 'custom_job_manager_application_email_subject', 10, 2 );
// This is your hooked in function. Note: the $post variable is only available after v1.11.2
function custom_job_manager_application_email_subject( $subject, $post ) {
// By default, $subject will contain: Job Application via "X" listing on X. Change that below
$subject = 'New subject';
// Return the new subject
return $subject;
}
View CSS for <sup> and <sub>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
You can’t perform that action at this time.