Skip to content

Instantly share code, notes, and snippets.

View ms-studio's full-sized avatar

Manuel Schmalstieg ms-studio

View GitHub Profile
@ms-studio
ms-studio / formidable-get-form-name.php
Last active September 7, 2017 12:02
With Formidable Forms, display Names of all forms a user submitted
<?php
// For context, see discussion here:
// https://formidableforms.com/help-desk/display-all-entries-by-user-across-several-forms/
global $wpdb;
// Get IDs of all Forms the current user has submitted:
$user_forms = $wpdb->get_col( $wpdb->prepare(
@ms-studio
ms-studio / simple-git-branching-model.md
Created December 9, 2016 21:45 — forked from jbenet/simple-git-branching-model.md
a simple git branching model

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: [
'css/build/*.css'
],
@ms-studio
ms-studio / no-robots-function.php
Created April 15, 2016 12:12
no robots on archive pages
<?php
// in answer to https://twitter.com/evrenk/status/720939858529796097
// based on http://wordpress.stackexchange.com/questions/86918/
add_action('wp_head', 'no_robots_on_uncategorized_posts');
function no_robots_on_uncategorized_posts() {
if ( is_archive() ) {
wp_no_robots();
@ms-studio
ms-studio / notes-about-page-schedule-grid.php
Last active March 8, 2016 08:08
About page-schedule-grid for LGM
<?php
/*
* 1) Use transient for better performance:
*
* Instead of this:
*/
$custom_query = new WP_Query(array(
'post_type' => 'talk',
@ms-studio
ms-studio / dabblet.css
Last active March 1, 2016 23:19
Triangle CSS
/**
* Triangle CSS
* Source: http://appendto.com/2013/03/pure-css-triangles-explained/
*/
.triangle {
width: 0;
height: 0;
border-bottom: 116px solid blue;
border-left: 58px solid transparent;
@ms-studio
ms-studio / add-several-term-meta-fields-to-custom-taxonomy.php
Last active February 28, 2022 10:02
A variation on the previous gists, this time we add *several* term meta fields
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// original code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
/*
* NOTE:
* We are registering the fields for a custom taxonomy, called "user-logement".
*/
Here are a few questions that will tee us up for a good conversation:
- Can you tell me about your project in a few sentences?
- What’s the timeframe? Does a certain event depend on this project launching?
- What are you looking for from us? Do you want us to design, build, and launch the whole site? Or do you have developers or other partners lined up and only need us for design?
- Have you already started on any part of the project? Do you have existing work? A new logo? Some rough designs or ideas for the site?
- How large is your team? What are the roles you envision on your end?
- How did you hear about our work? What specifically interests you about it? Any projects that you’re keen on?
- How much money have you set aside for this project?
- Are you talking to others about this project? Might we ask how many? What do you like about their work?
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@ms-studio
ms-studio / add-term-to-custom-taxonomy.php
Created December 15, 2015 08:10
add term metabox to custom taxonomy - using WP 4.4 term meta functions
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
// CREATE CUSTOM TAXONOMY
add_action( 'init', '___create_my_custom_tax' );