Skip to content

Instantly share code, notes, and snippets.

View Sixl-Daniel's full-sized avatar

Daniel Sixl Sixl-Daniel

View GitHub Profile
@Sixl-Daniel
Sixl-Daniel / wp_usermeta.md
Last active January 12, 2021 19:07 — forked from magnific0/wp_usermeta.md
Show and Edit User Meta in Wordpress

#Show and Edit User Meta in Wordpress

Description

This simple procedure will allow you to:

  1. Display user meta fields under in the user list as additional columsn (Users > All Users).
  2. Display these fields on user profiles.
  3. Edit these fields under user edit.

This method works completely without plugins and involves just some functions and hooks in functions.php. Plugins like "User Meta Display" achieve this to some level, but treat custom meta fiedlds completely different from the regular fields. They are shown and edited in seperate environment and fail to show the meta data is a table list. This method integrates custom user meta along with regular user (meta).

const poll = async ({ fn, validate, interval, maxAttempts }) => {
let attempts = 0;
const executePoll = async (resolve, reject) => {
const result = await fn();
attempts++;
if (validate(result)) {
return resolve(result);
} else if (maxAttempts && attempts === maxAttempts) {
@Sixl-Daniel
Sixl-Daniel / some_plugin.php
Created December 7, 2020 09:05 — forked from dbspringer/some_plugin.php
WordPress front-end uploader & current-user only media filter
<?php
class Some_WP_Plugin {
/**
* Init everything here
*/
public function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
add_filter( 'ajax_query_attachments_args', array( $this, 'filter_media' ) );
@Sixl-Daniel
Sixl-Daniel / plugin.php
Created December 3, 2020 17:32 — forked from dbspringer/plugin.php
Front-end Media Example plugin
<?php
/**
* Plugin Name: Front-end Media Example
* Plugin URI: http://derekspringer.wordpress.com
* Description: An example of adding the media loader on the front-end.
* Version: 0.1
* Author: Derek Springer
* Author URI: http://derekspringer.wordpress.com
* License: GPL-2.0+
@Sixl-Daniel
Sixl-Daniel / 2019-https-localhost.md
Created November 18, 2020 09:37 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@Sixl-Daniel
Sixl-Daniel / font-stacks.css
Created July 18, 2020 18:01 — forked from don1138/font-stacks.css
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* A modern Georgia-based serif */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@Sixl-Daniel
Sixl-Daniel / sass-7-1-pattern.scss
Created December 27, 2018 15:30 — forked from rveitch/sass-7-1-pattern.scss
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@Sixl-Daniel
Sixl-Daniel / README-Template.md
Created August 15, 2018 11:10 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites