Last active
April 15, 2019 11:49
-
-
Save n7studios/f8e9d64828cb2d18666d8f0a7972aa0d to your computer and use it in GitHub Desktop.
Page Generator Pro: Enable Meta Boxes: https://www.wpzinc.com/documentation/page-generator-pro/developers-enable-meta-boxes/
This file contains hidden or 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: Page Generator Pro: Enable Meta Boxes | |
* Plugin URI: http://www.wpzinc.com/plugins/page-generator-pro | |
* Version: 1.0.0 | |
* Author: WP Zinc | |
* Author URI: http://www.wpzinc.com | |
* Description: Demonstrates how to enable custom and/or third party plugin meta boxes on Page Generator Pro Groups. See: https://www.wpzinc.com/documentation/page-generator-pro/developers-enable-meta-boxes/ | |
*/ | |
/** | |
* Defines additional meta boxes that are permitted to be displayed on the Generate Content screen. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $permitted_meta_boxes Array of Meta Box IDs permitted to be displayed on the Generate Content screen. | |
* @return array Array of Meta Box IDs permitted to be displayed on the Generate Content screen. | |
*/ | |
function page_generator_pro_groups_permitted_meta_boxes( $permitted_meta_boxes ) { | |
// Start editing | |
// Define the meta boxes that you want to permit to display | |
$additional_meta_boxes = array( | |
'review_metabox', | |
); | |
// Stop editing | |
// Bail if no additional meta boxes were defined | |
if ( empty( $additional_meta_boxes ) ) { | |
return $permitted_meta_boxes; | |
} | |
// Merge arrays and return | |
return array_merge( $permitted_meta_boxes, $additional_meta_boxes ); | |
} | |
add_filter( 'page_generator_pro_groups_ui_permitted_meta_boxes', 'page_generator_pro_groups_permitted_meta_boxes', 10, 1 ); | |
// Backward compat filter | |
add_filter( 'page_generator_pro_groups_permitted_meta_boxes', 'page_generator_pro_groups_permitted_meta_boxes', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment