Forked from n7studios/envira-standalone-enable-archives.php
Last active
November 25, 2016 14:55
-
-
Save tosinafolabi/65dd4bdc478f52e7123d643deb595a6f to your computer and use it in GitHub Desktop.
Envira Gallery - Standalone Addon - Enable Archives and Featured Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@2016.11.25 – Updated to support now-integrated standalone feature.