Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.