Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
tellyworth committed Dec 5, 2022
1 parent 3e884c8 commit f9d329b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/wp-content/themes/wporg-main-2022/inc/capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ function map_meta_caps( $required_caps, $current_cap, $user_id, $args ) {
$post = get_post( $args[0] );
if ( $post && 'page' === $post->post_type ) {
// There ought to be a way to do this using a function like `locate_block_template()`, but if there is I can't figure out how.
if ( 'page' === get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) ) {
if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {
$maybe_template = get_stylesheet_directory() . '/templates/front-page.html';
} else {
$maybe_template = get_stylesheet_directory() . '/templates/page-' . $post->post_name . '.html';
}
if ( !file_exists( $maybe_template ) ) {
if ( ! file_exists( $maybe_template ) ) {
$required_caps[] = 'do_not_allow';
}
}
Expand Down

0 comments on commit f9d329b

Please sign in to comment.