Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tosinafolabi/65dd4bdc478f52e7123d643deb595a6f to your computer and use it in GitHub Desktop.
Save tosinafolabi/65dd4bdc478f52e7123d643deb595a6f 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_gallery_enable_archives( $post_args ) {
$post_args['has_archive'] = true;
$post_args['supports'] = array( 'title', 'thumbnail' );
return $post_args;
}
add_filter('envira_gallery_post_type_args', 'envira_gallery_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' );
@tosinafolabi
Copy link
Author

@2016.11.25 – Updated to support now-integrated standalone feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment