Skip to content

Instantly share code, notes, and snippets.

View isuke01's full-sized avatar

Łukasz ISU Biedroń isuke01

View GitHub Profile
@isuke01
isuke01 / markdown-text-101.md
Created January 27, 2022 13:07 — forked from matthewzring/markdown-text-101.md
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...

Sweet Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__

@isuke01
isuke01 / taxonomy-terms-order.php
Last active June 17, 2021 11:23
Fix issue with Wordpres Multisite for Category Order and Taxonomy Terms Order.
<?php
/*
Plugin Name: Category Order and Taxonomy Terms Order
Plugin URI: http://www.nsp-code.com
Description: Order Categories and all custom taxonomies terms (hierarchically) and child terms using a Drag and Drop Sortable javascript capability.
Version: 1.5.7.6
Author: Nsp-Code
Author URI: https://www.nsp-code.com
Author Email: [email protected]
Text Domain: taxonomy-terms-order
@isuke01
isuke01 / wp-rewrite.php
Last active June 28, 2023 14:27
Change wordpress blog poss rewrite rules
<?php
/*
|--------------------------------------------------------------------------
| Fix for blog links
|--------------------------------------------------------------------------
| Add post type before single post name (fix post link on backend)
*/
function fix_blog_links($post_link, $post, $leavename) {
if($post->post_status === 'draft') return $post_link;
@isuke01
isuke01 / gutenberg_validation_acf_fix.php
Created March 7, 2020 10:09
Fix Gutenberg and ACF validation issue
function enhancement_gutenberg_isu(){
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
wp.domReady(function(){
//acf Custom Validation for Gutenberg
var postSaveButtonClasses = '.editor-post-publish-button';
$(document).on('click', postSaveButtonClasses , function(e){
e.stopPropagation();
@isuke01
isuke01 / gutenberg_validation_acf_fix.php
Created March 7, 2020 10:09
Fix Gutenberg and ACF validation issue
function enhancement_gutenberg_isu(){
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
wp.domReady(function(){
//acf Custom Validation for Gutenberg
var postSaveButtonClasses = '.editor-post-publish-button';
$(document).on('click', postSaveButtonClasses , function(e){
e.stopPropagation();
@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 ; }
}
@isuke01
isuke01 / fileUpload.vue
Created August 23, 2018 11:37 — forked from raisiqueira/fileUpload.vue
Simple file upload with Vue and Axios
<style>
input[type="file"]{
position: absolute;
top: -500px;
}
div.file-listing{
width: 200px;
}
@isuke01
isuke01 / acf.php
Last active September 7, 2018 09:54
ACF custom rules and match based on options (for custom page Archive in this case)
<?php
//More: https://www.advancedcustomfields.com/resources/custom-location-rules/
// fis to work on keys instead of IDS
// Filter for ACF create field panel
add_filter('acf/location/rule_values/page_type', 'acf_location_rules_values_page', 10); // filter location
function acf_location_rules_values_page( $choices ) {
$choices['archive_for_projects'] = __('Projects archive page', 'ustekveikja'); // value and select box text
$choices['archive_for_neighborhood'] = __('Neighborhood archive page', 'ustekveikja'); // value and select box text
return $choices;
@isuke01
isuke01 / wp_navi_siblings.php
Created July 23, 2018 11:55
Wordpress navigation for siblings
<?php
/*
* Based on https://gist.github.com/LL782/3551634
*/
function wp_links_siblings($postID = null){
if(!$postID){
global $post;
$postID = $post->ID;
}
$ancestors = get_post_ancestors( $postID );
@isuke01
isuke01 / support_for_svg_in_wp.php
Created July 23, 2018 11:06
Add SVG support to Wordpress Media library view + upload SVG
<?php
/**
* Add support to SVG in WP media viewer
*/
function svg_meta_data_support($data, $id){
$attachment = get_post($id); // Filter makes sure that the post is an attachment
$mime_type = $attachment->post_mime_type; // The attachment mime_type