Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #141 from xwp/hide-remove-setting-for-published-ch…
Browse files Browse the repository at this point in the history
…angesets

Hide Remove Setting link when viewing a published changeset
  • Loading branch information
westonruter committed Jul 26, 2017
2 parents a900e76 + 23c52fe commit 1875944
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion php/class-post-type.php
Expand Up @@ -407,7 +407,9 @@ public function render_data_metabox( $post ) {
echo '<li>';
echo '<details open>';
echo '<summary><code>' . esc_html( $setting_id ) . '</code> ';
echo '<a href="#" id="' . esc_attr( $setting_id ) . '" data-text-restore="' . esc_attr__( 'Restore setting', 'customize-snapshots' ) . '" class="snapshot-toggle-setting-removal remove">' . esc_html__( 'Remove setting', 'customize-snapshots' ) . '</a>';
if ( 'publish' !== get_post_status( $post ) ) {
echo '<a href="#" id="' . esc_attr( $setting_id ) . '" data-text-restore="' . esc_attr__( 'Restore setting', 'customize-snapshots' ) . '" class="snapshot-toggle-setting-removal remove">' . esc_html__( 'Remove setting', 'customize-snapshots' ) . '</a>';
}

// Show error message when there was a publishing error.
if ( isset( $setting_params['publish_error'] ) ) {
Expand Down

0 comments on commit 1875944

Please sign in to comment.