Skip to content

Instantly share code, notes, and snippets.

@n7studios
Last active November 25, 2016 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save n7studios/c726c265c43155520de1 to your computer and use it in GitHub Desktop.
Save n7studios/c726c265c43155520de1 to your computer and use it in GitHub Desktop.
Envira Gallery - Standalone Addon - Enable Archives and Featured Images
<?php
/**
* Plugin Name: Envira Gallery - Standalone Addon - Enable Archives and Featured Image
* Plugin URI: http://enviragallery.com
* Version: 1.0
* Author: Tim Carr
* Author URI: http://www.n7studios.co.uk
* Description: Enables archives for Envira CPT
*/
/**
* Enable archives and featured image capabilities on Envira Galleries
*/
function envira_standalone_enable_archives( $post_args ) {
$post_args['has_archive'] = true;
$post_args['supports'] = array( 'title', 'thumbnail' );
return $post_args;
}
add_filter('envira_standalone_post_type_args', 'envira_standalone_enable_archives');
/**
* Enables the Featured Image Metabox on Envira Galleries
*/
function envira_standalone_enable_featured_image_metabox( $pass_over ) {
$pass_over[] = 'postimagediv';
return $pass_over;
}
add_filter( 'envira_gallery_metabox_ids', 'envira_standalone_enable_featured_image_metabox' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment