Skip to content

Instantly share code, notes, and snippets.

View jaworowicz's full-sized avatar

Jakub Jaworowicz jaworowicz

View GitHub Profile
@jaworowicz
jaworowicz / moja-wtyczka.php
Created November 28, 2021 01:06
Nagłówek wtyczki niestandardowej WordPress by https://jaworowi.cz
<?php
/**
* Plugin Name: FUNKCJONALNOŚCI JAWOROWI.CZ
* Plugin URI: https://jaworowi.cz
* Description: Plugin techczniczny - nie usuwać
* Version: 1.0
* Author: Jakub Jaworowicz
* Author URI: https://jaworowi.cz
*/
@jaworowicz
jaworowicz / put-into-functions___WooManageEdit.php
Last active September 28, 2021 22:16
Customize Shop Manager WooCommerce role
<?php // Put into functions.php without this line
add_role('shop_manager', __('Shop Manager', 'woocommerce'), array(
'read' => true,
'read_private_pages' => true,
'read_private_posts' => true,
'edit_posts' => true,
'edit_pages' => true,
'edit_published_posts' => true,
'edit_published_pages' => true,
'edit_private_pages' => true,
@jaworowicz
jaworowicz / gist:71500a891cf51c91fc2e982dd86862d6
Last active September 16, 2020 23:57
Wyświetl produkty na stronie potwierdzenia zamówienia | Instrukcja: https://jaworowi.cz/?p=15220
<?php
/**
* @snippet Wyświetl produkty na stronie potwierdzenia zamówienia
* @how-to https://jaworowi.cz/?p=15220
* @author Jakub Jaworowicz
* @testedwith WooCommerce 5.5.1
*/
/* W pliku functions.php lub wtyczce funkcyjnej - wklej bez <?php na początku! */
@jaworowicz
jaworowicz / acf_repeater_shortcode.php
Created March 23, 2020 00:11 — forked from FranciscoG/acf_repeater_shortcode.php
An Advanced Custom Fields shortcode that allows to loop through a field with a repeater. This only handles simple cases, it can't handle nested repeater fields
<?php
/**
* ACF Pro repeater field shortcode
*
* I created this shortcode function because it didn't exist and it was being requested by others
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/
*
* @attr {string} field - (Required) the name of the field that contains a repeater sub group
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc
@jaworowicz
jaworowicz / wordpress-location-change.php
Created October 21, 2019 14:57
WordPress folder location Change. https://jaworowi.cz
define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/aplikacja/inc/' );
define( 'WP_CONTENT_URL', 'http://testowa1.local/aplikacja/inc' );
define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/aplikacja/inc/extensions' );
define( 'WP_PLUGIN_URL', 'http://testowa1.local/aplikacja/inc/extensions' );
define( 'UPLOADS', 'aplikacja/inc/media' );
@jaworowicz
jaworowicz / disable-login-email.php
Created October 21, 2019 13:32
WordPress disable login by email. https://jaworowi.cz
remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );
@jaworowicz
jaworowicz / Fake-error-login.php
Created October 21, 2019 13:27
WordPress login Fake Error. https://jaworowi.cz
function jcz_fake_error(){
return 'Błąd';
}
add_filter( 'login_errors', 'jcz_fake_error' );
@jaworowicz
jaworowicz / wp-admin.htaccess
Created October 21, 2019 12:50
Soft secure wp-admin // https://jaworowi.cz
<FilesMatch "install.*\.php">
Order allow,deny
Deny from all
</FilesMatch>
@jaworowicz
jaworowicz / wp-includes.htaccess
Created October 21, 2019 12:43
Secure wp-includes Folder. https://jaworowi.cz
<FilesMatch "\.(?i:php)$">
Order allow,deny
Deny from all
</FilesMatch>
<Files wp-tinymce.php>
Allow from all
</Files>
<Files ms-files.php>
Allow from all
</Files>
@jaworowicz
jaworowicz / wp_generator.php
Last active October 21, 2019 12:42
Hide wp_generator
// Ukrycie RSS
remove_action('wp_head', 'wp_generator');
// Ukrycie w RSS
function jcz_generator( $generator, $type ) {
return '';
}
add_filter( 'the_generator', 'jcz_generator', 10, 2 );
// Usunięcie Query w skryptach