Skip to content

Instantly share code, notes, and snippets.

View erlendmr's full-sized avatar

Erlend Ribe erlendmr

View GitHub Profile
@erlendmr
erlendmr / functions.php
Created October 9, 2019 07:14
Ninja Forms - Pre-populate radio list
add_filter( 'ninja_forms_render_options', function($options,$settings){
if( $settings['key'] == 'example_field' ){
// Note! The global $post variable is null when this filter is run
// in the context of the merge tag {fields_table}.
global $post;
$args = array(
'post_type' => 'page',
'p' => $post->ID, // or get_the_ID()
@erlendmr
erlendmr / cloudSettings
Last active February 3, 2021 09:56
VIsual Code Settings
{"lastUpload":"2021-02-03T09:56:05.819Z","extensionVersion":"v3.4.3"}
@erlendmr
erlendmr / success.html
Created June 18, 2019 08:34
Lingit: Success-melding
<div class="success" display="none">
<img src="images/icon-msg-checked-round.svg" alt="Konto lagt til" class="success__icon">
<div class="success__message">
Konto lagt til!
</div>
</div>
@erlendmr
erlendmr / validation.html
Created June 18, 2019 08:27
Lingit: Validering
<div class="validation-summary validation-summary-valid" data-valmsg-summary="true" style="display:none">
<ul>
<li></li>
</ul>
</div>
@erlendmr
erlendmr / WP: wp-query-ref.php
Last active April 16, 2021 16:21 — forked from luetkemj/wp-query-ref.php
WordPress Query Comprehensive Reference
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
@erlendmr
erlendmr / js-moving-from-jquery-to-vanilla-js.md
Last active September 9, 2020 11:05 — forked from liamcurry/gist:2597326
Moving from jQuery to Vanilla JS

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})