Skip to content

Instantly share code, notes, and snippets.

@Idealien
Idealien / functions.php
Created March 17, 2018 18:49
Gravity Flow - Custom Column for status table based on creator, assignee, etc
<?php
add_filter( 'gravityflow_columns_status_table', 'custom_column_titles', 10, 3 );
function custom_column_titles( $columns, $args, $table ) {
$new_column = array(
'user_action' => 'User Action',
);
$pre_columns = array_slice( $columns, 0, 2 );
$post_columns = array_slice( $columns, 2 );
$columns = array_merge( $pre_columns, $new_column, $post_columns );
return $columns;
@carlodaniele
carlodaniele / kinsta_users.php
Last active December 14, 2021 21:40
A plugin for registering a custom post type with a specific set of capabilities
<?php
/**
* @package Kinsta_users
* @version 1.0
*/
/*
Plugin Name: Kinsta users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@codigoconjuan
codigoconjuan / front-page.php
Created July 4, 2017 03:56
Bootstrap 4 Slider with WordPress
<div id="main-slider" class="carousel slide mt-4" data-ride="carousel">
<?php $args = array(
'posts_per_page' => 5,
'tag' => 'slider'
);
$slider = new WP_Query($args);
if($slider->have_posts()):
$count = $slider->found_posts;
?>
@carlodaniele
carlodaniele / food-example-plugin-2.php
Created November 15, 2016 20:59
An example for WPMU readers
<?php
/**
* @package Food_example_plugin_2
* @version 1.0
*/
/*
Plugin Name: Food example plugin 2
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for WPMU DEV readers
Author: Carlo Daniele
@hasanm95
hasanm95 / bootstrap carousel with multiple items - wordpress
Created September 8, 2016 08:56
bootstrap carousel with multiple items in wordpress/ custom post / cmb2( Group field)
@RickeyMessick
RickeyMessick / Gravity Forms get all fields function
Created November 3, 2015 21:11
Gravity Forms get all fields function to use with gform_after_submission to display just filled out fields
function get_all_fields($entry, $form)
{
//only do this for a certain form (id 53 for example)
// if ($form["id"] == 17)
//{
foreach($form["fields"] as &$field)
{
//see if this is a multi-field, like name or address
if (is_array($field["inputs"]))
@justintadlock
justintadlock / register-post-type.php
Last active July 17, 2024 10:14
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@Mrshcom
Mrshcom / gist:3992304
Created November 1, 2012 07:21 — forked from AliMD/gist:3865955
Create A Somple Product Catalog width Wordpress.

ali.md/pcwp

Step One: Create the custom post type

The following code goes into the functions.php file:

// Create A Somple Product Catalog width Wordpress. ali.md/pcwp
// Step One: Create the custom post type