Skip to content

Instantly share code, notes, and snippets.

View Lovor01's full-sized avatar
💭
I may be slow to respond.

Lovro Hrust Lovor01

💭
I may be slow to respond.
  • makeITeasy
  • Zagreb
View GitHub Profile
@Lovor01
Lovor01 / Block binding.md
Created April 7, 2025 22:06
Block binding

For image, I only found that separate single meta must exist for image id and url to work binding image

@Lovor01
Lovor01 / Search block.md
Created April 2, 2025 22:18
How to refine query parameters while searching

Search block query attribute

Search block has hidden query attribute which can be used by building variations which will add additional query parameters. See this issue. It will add hidden input html tags with necessary query attributes.

@Lovor01
Lovor01 / Ubuntu 24.04 ext.md
Created February 16, 2025 21:26
Ubuntu 24.04 extended session
@Lovor01
Lovor01 / webpack.config.js
Created February 2, 2025 11:18
Wordpress scripts HMR config for one or more blocks
// change webpack default config
const defaultConfig = require( '@wordpress/scripts/config/webpack.config.js' );
// eslint-disable-next-line import/no-extraneous-dependencies
require( 'dotenv' ).config();
/* Either define host, cert_location and key_location in .env file
i root directory of the project or encode strings here to use
https and hot reload under https. Alternatively, remove this config file
*/
@Lovor01
Lovor01 / xdebug.md
Created December 20, 2024 14:46
Xdebug

PHP 8+

[xdebug]
;off develop coverage debug gcstats profile trace
;step debugging
xdebug.mode=debug
; yes, no, trigger; default (trigger on debug mode)
xdebug.start_with_request=trigger
xdebug.output_dir="C:\Wamp.NET\tools\profile"
xdebug.var_display_max_data=8192
@Lovor01
Lovor01 / Phpcs.md
Last active November 9, 2024 22:59
PHPCS find rules
phpcs --standard='WordPress-Extra' -s '<path to file>'
@Lovor01
Lovor01 / solution.md
Created August 27, 2024 19:03
Git authentication problem with gitlab
git config --edit --local

and change password in url url = https://ecostac-frontend:[email protected]

@Lovor01
Lovor01 / malware.md
Last active March 15, 2024 13:16
WordPress Malware detection

A list of WordPress malware tools

@Lovor01
Lovor01 / Replace.php
Created October 21, 2023 16:31
Replace srcset
<?php
/**
* add sizeSlug attribute where it is missing and update image src accordingly
*/
// alternative only for fixing sizeSlug:
// wp search-replace '(<!-- wp:image\s{(?!.*"sizeSlug")[^}]*)' '$1,\"sizeSlug\":\"full\"' gr8_posts --regex --regex-delimiter='/' --include-columns=post_content --log=C:\Users\Admin\Downloads\replace.log --precise
@Lovor01
Lovor01 / unregister ctrl+k.js
Created September 23, 2023 20:47
WordPress: Unregister shortcut key ctrl+k (cmd+k)
wp.domReady( () => {
const unsubscribe = wp.data.subscribe( () => {
const command = wp.data.select( 'core/keyboard-shortcuts' ).getShortcutKeyCombination( 'core/commands' );
if ( command && command.character === 'k' ) {
wp.data.dispatch( 'core/keyboard-shortcuts' ).unregisterShortcut( 'core/commands' );
unsubscribe();
}