Skip to content

Instantly share code, notes, and snippets.

@andresglx
andresglx / gist:16a8d1950e25e21bb46da33f027a7313
Created January 23, 2018 20:36 — forked from nathaningram/gist:035b4c6b25738c9805d14495b80ce907
Adding SVG Format to Allowed WordPress File Types
//Adding SVG Format to Allowed WordPress File Types
function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
}
add_action('upload_mimes', 'add_file_types_to_uploads');
@andresglx
andresglx / permalink-manager.php
Created November 16, 2016 12:32
PHP Notice: Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php
@andresglx
andresglx / permalink-manager.php
Created November 8, 2016 17:20
permalink-manager.php
@andresglx
andresglx / function.php
Created September 30, 2016 12:00 — 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');
@andresglx
andresglx / new-post-type-capabilities.php
Last active November 25, 2015 11:23
Creating a new post type with capabilities.
<?php
add_action( 'init', 'create_my_post_types' );
function create_my_post_types() {
register_post_type(
'movie',
array(
'public' => true,
'capability_type' => 'movie',
'capabilities' => array(
'publish_posts' => 'publish_movies',