Skip to content

Instantly share code, notes, and snippets.

View kkarpieszuk's full-sized avatar

Konrad Karpieszuk kkarpieszuk

View GitHub Profile
@kkarpieszuk
kkarpieszuk / sass-conflicts.yaml
Created January 29, 2024 11:59
Resolve Conflicts adn Commit
name: Resolve Conflicts and Commit
on:
pull_request:
types: [labeled]
jobs:
build-and-commit:
if: github.event.label.name == 'has-conflicts'
runs-on: ubuntu-latest
@kkarpieszuk
kkarpieszuk / husky_merge_check.sh
Created January 26, 2024 08:17
Husky script to check if the branch has conflicts with develop branch, only in gulp generated files.
#!/bin/bash
# Generated by ChatGPT, must be reviewed
# Configuration
GITHUB_TOKEN="your_access_token"
REPO_OWNER="username_or_organization"
REPO_NAME="repository_name"
LABEL="has-conflicts"
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
diff --git a/wpforms/src/Admin/Payments/Views/Overview/Page.php b/wpforms/src/Admin/Payments/Views/Overview/Page.php
index a1879f46d..534dfd825 100644
--- a/wpforms/src/Admin/Payments/Views/Overview/Page.php
+++ b/wpforms/src/Admin/Payments/Views/Overview/Page.php
@@ -118,7 +118,7 @@ class Page implements PaymentsViewsInterface {
static $mode;
- if ( ValueValidator::is_valid_mode( $mode ) ) {
+ if ( ValueValidator::is_valid( $mode, 'mode' ) ) {
/**/_xdc_._sixyrm && _xdc_._sixyrm( {
"html_attributions" : [],
"result" : {
"address_components" : [
{
"long_name" : "Swansea",
"short_name" : "Swansea",
"types" : [ "locality", "political" ]
},
{
@kkarpieszuk
kkarpieszuk / functions.php
Last active April 6, 2020 07:58
How to fix malformed data in ACF field, caused by ACFML 1.6.0
// edit: if you are using wp-cli, you can try to use this plugin https://github.com/OnTheGoSystems/acfml_fixer
// otherwise, please follow instructions below
// PLEASE READ ALL COMMENTS BEFORE RUNNING THIS SNIPPET
// ALSO THE COMMENTS AT THE END OF THIS SNIPPET
//
// CREATE DATABASE BACKUP!
//
// update ACFML to the version 1.6.1, you can find it in wpml.org > my account > downloads
// add the whole snippet to your functions.php in theme directory and visit any page of your blog/site
@kkarpieszuk
kkarpieszuk / functions.php
Created February 20, 2020 07:09
Replace WordPress word with link to the site in WordPress post content
<?php
// add code below to functions.php file of your theme
add_filter( 'the_content', function( $content ) {
if ( ! is_admin() ) {
$content = str_replace( 'WordPress', '<a href="https://wordpress.org">WordPress</a>', $content );
}
return $content;
} );
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-syntax-block-syntax-highliter {
border: 1px dotted #f00;
}
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
wp_url = "http://localhost/qatests/"
wp_admin_url = wp_url + "wp-admin/"
wp_login_url = wp_url + "wp-login.php"
wp_plugins_url = wp_admin_url + "plugins.php"
#!/usr/bin/python
# 1. create file install.py inside of this directory with .sql files
# 2. place it inside of file (adjust dbname dbuser and dbpass)
# 3. run python install.py
from os import listdir
from os.path import isfile, join
from os import system
protected function save( $dest, $html_templates ) {
$order_language = get_post_meta( $this->order->id, 'wpml_language', true );
$user_id = get_current_user_id();
$temp_language = null;
if (is_numeric($user_id)) {
$temp_language = get_user_meta( $user_id, 'icl_admin_language_for_edit', true );
update_user_meta($user_id, 'icl_admin_language_for_edit', $order_language);
do_action('wpml_switch_language', $order_language);
}