Skip to content

Instantly share code, notes, and snippets.

@nickcernis
Last active October 22, 2019 22:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickcernis/38020edad310d5984b6abc0ecc6ec2f0 to your computer and use it in GitHub Desktop.
Save nickcernis/38020edad310d5984b6abc0ecc6ec2f0 to your computer and use it in GitHub Desktop.
Enable the block editor for Genesis Portfolio Pro
<?php
/*
Plugin Name: Genesis Portfolio Pro Modifications
Description: Enable the Block Editor for the Portfolio post type.
Version: 1.0.0
*/
add_filter( 'register_post_type_args', 'studiopress_enable_block_editor_portfolio', 10, 2 );
function studiopress_enable_block_editor_portfolio( $args, $post_type ) {
if ( 'portfolio' === $post_type ) {
$args['show_in_rest'] = true;
}
return $args;
}
  1. Create a file named genesis-portfolio-pro-modifications.php in your WordPress site's wp-content/plugins directory.
  2. Paste the genesis-portfolio-pro-modifications.php code on this page into that file.
  3. Activate the plugin.

You should then see the block editor active when you visit Portfolio Items -> Add New.

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