Skip to content

Instantly share code, notes, and snippets.

View isuke01's full-sized avatar

Łukasz ISU Biedroń isuke01

View GitHub Profile
@danielbachhuber
danielbachhuber / wordpress-language-codes.csv
Created April 24, 2020 12:35
Language / locale codes used in WordPress
language english_name native_name
af Afrikaans Afrikaans
ar Arabic العربية
ary Moroccan Arabic العربية المغربية
as Assamese অসমীয়া
az Azerbaijani Azərbaycan dili
azb South Azerbaijani گؤنئی آذربایجان
bel Belarusian Беларуская мова
bg_BG Bulgarian Български
bn_BD Bengali (Bangladesh) বাংলা
@imath
imath / post-taxonomy-panel.js
Created March 1, 2020 03:52
Example of use of the filter to replace the PostTaxonomy panel of the WordPress Block Editor
const { createElement, Component } = wp.element;
const { compose } = wp.compose;
const { RadioControl } = wp.components;
const { withSelect, withDispatch } = wp.data;
const { addFilter } = wp.hooks;
const { apiFetch } = wp;
const { __ } = wp.i18n;
class RiskDomain extends Component {
constructor() {
@derweili
derweili / block-string-list-block.js
Created July 24, 2019 09:41
Example Gutenberg Block with array attribute
/**
* BLOCK: string-list-block
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
// Import CSS.
import './style.scss';
import './editor.scss';
@psaikali
psaikali / acf-gravity-forms-field.php
Created January 4, 2019 13:43
Populate ACF select field options with Gravity Forms to select a specific form
<?php
/**
* Populate ACF select field options with Gravity Forms forms
*/
function acf_populate_gf_forms_ids( $field ) {
if ( class_exists( 'GFFormsModel' ) ) {
$choices = [];
foreach ( \GFFormsModel::get_forms() as $form ) {
$choices[ $form->id ] = $form->title;
@isuke01
isuke01 / tempalte_override.php
Created September 7, 2018 10:39
Template override, simple override template file of page, based on page ID
<?php
add_filter( 'template_include', 'archives_overrides', 99 );
function archives_overrides( $template ) {
global $post;
if(!$post){ return $template; }
if ( $post->ID == get_archive_for_projects() ) {
$new_template = locate_template( array( 'template-projects.php' ) );
if ( '' != $new_template ) { return $new_template ; }
}
@igorbenic
igorbenic / block.js
Last active April 22, 2022 22:25
Gutenberg Select Post - Duplicate Controls
/**
* BLOCK: my-block
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
// Import CSS.
import './style.scss';
import './editor.scss';
@raisiqueira
raisiqueira / fileUpload.vue
Created December 22, 2017 13:06
Simple file upload with Vue and Axios
<style>
input[type="file"]{
position: absolute;
top: -500px;
}
div.file-listing{
width: 200px;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" lang="pl">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# video: http://ogp.me/ns/video#">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<!--[if IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<![endif]-->
<script type="text/javascript" src="//static.cda.pl/js/layout_pack/layout_pack_no_uplv3.js?v=203bcd"></script>
<script type="text/javascript" src="//static.cda.pl/js/jquery.cookie.js"></script>
<?php
/*
Plugin Name: GF file upload to ACF image field
Plugin URI: https://gist.github.com/certainlyakey/8c19791b3133beb62d323bf060bf4270
Description: Map Gravity forms file upload field to ACF image/file field so GF would upload the file and save id to DB instead of URL.
Version: 1.0.0
Author: Kellen Mace
*/
@matthewzring
matthewzring / markdown-text-101.md
Last active November 13, 2024 18:15
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers: