Skip to content

Instantly share code, notes, and snippets.

@divipro
divipro / functions.php
Created January 3, 2019 00:35 — forked from BoDonkey/functions.php
Remove the 'Divi' post status
/**
* Remove 'Divi' from post states.
*
* @param array $post_states Existing post states.
* @param object $post Current post object.
*
* @return array
*/
function divi_removal_filter( $post_states, $post ){
// Make sure that $post_states is an array. Third party plugin might modify $post_states and makes it null which can create issues
@divipro
divipro / function.php
Created February 14, 2018 05:38 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
@divipro
divipro / all_fields_extra_options.php
Created February 5, 2018 04:02
The Gravity Forms {all_fields} merge tag in notifications includes all fields which had data entered, it doesn't include HTML fields, Section Break descriptions, nor does it allow you to omit fields from the notification. By adding the following code to your themes functions.php file you will gain the ability to include HTML fields, and Section …
/**
* to exclude field from notification add 'exclude[ID]' option to {all_fields} tag
* 'include[ID]' option includes HTML field / Section Break field description / Signature image in notification
* see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options
* example: {all_fields:exclude[2,3]}
* example: {all_fields:include[6]}
* example: {all_fields:include[6],exclude[2,3]}
*/
add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 11, 5 );
function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_value ) {