Skip to content

Instantly share code, notes, and snippets.

View jaworowicz's full-sized avatar

Jakub Jaworowicz jaworowicz

View GitHub Profile
add_action( 'wp_head', 'jcz_disqus_controll' );
function jcz_disqus_controll() {
if ( is_singular( array( 'post', 'page' ) ) && comments_open() )
return;
remove_action( 'wp_footer', 'dsq_output_footer_comment_js' );
remove_action( 'loop_end', 'dsq_loop_end' );
}
define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // Pełna ścieżka, bez końcowego ukośnika
// Czy wtyczka jest aktywna - Przykład WooCommerce
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
echo 'WooCommerce aktywny.';
} else {
echo 'WooCommerce nie aktywny.';
}
// Czy klasa istnieje - If Class Exist
if ( class_exists( 'WooCommerce' ) ) {
/**
* Returns drop-ins that WordPress uses.
*
* Includes Multisite drop-ins only when is_multisite()
*
* @since 3.0.0
* @return array Key is file name. The value is an array, with the first value the
* purpose of the drop-in and the second value the name of the constant that must be
* true for the drop-in to be used, or true if no constant is required.
*/
<?php
require(WPMU_PLUGIN_DIR . '/wtyczka/plik-wtyczki.php');
?>
add_action( 'customize_register', 'jt_customize_register' );
function jt_customize_register( $wp_customize ) {
$wp_customize->remove_control( 'custom_css' );
}
<?php
// Wstaw do Functions lub wtyczki funkcyjnej usuwając <?php i koniec kodu php ? > z konca pliku
add_action( 'woocommerce_after_order_notes', 'jcz_uczestnicy_woocommerce' );
function jcz_uczestnicy_woocommerce( $checkout ) {
global $woocommerce;
$class_basket_count = $woocommerce->cart->cart_contents_count;
$class_basket_count = $class_basket_count - 0;
/*** Wyłączenie frontend edytora VisualComposer ***/
if(function_exists('vc_disable_frontend')){
vc_disable_frontend();
}
function usun_devicepx() {
wp_dequeue_script( 'devicepx' );
}
add_action( 'wp_enqueue_scripts', 'usun_devicepx' );
<!-- Instrukcja http://jaworowi.cz/?p=4444 -->
<div id="jcz_rwd_2col_form" class="clearfix">
<div class="jcz_rwd_cf7_row">
<div class="jcz_rwd_cf7_col">Imię [text* first-name]</div>
<div class="jcz_rwd_cf7_col">Nazwisko [text* last-name]</div>
</div>
<div class="jcz_rwd_cf7_row">