Skip to content

Commit

Permalink
PHPCS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jayedul committed Feb 23, 2023
1 parent 8d0acef commit 16581d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions includes/ConvertToBlocks/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Plugin {
*
* @var array
*/
private static $default_post_types = array(
'post',
private static $default_post_types = array(
'post',
'page',
);

Expand Down Expand Up @@ -145,15 +145,15 @@ public function init_admin() {
*
* @return void
*/
function convert_to_block_setting_form() {
public function convert_to_block_setting_form() {
$post_types = get_post_types( array( 'show_in_rest' => true ) );
$options = get_option( self::POST_TYPE_FIELD, self::$default_post_types );

foreach ( $post_types as $type ) {
$post_type = get_post_type_object( $type );
$id = 'cb-supported-post-types-' . $type;
?>
<input id="<?php echo esc_attr( $id ); ?>" type="checkbox" name="<?php echo self::POST_TYPE_FIELD; ?>[]" value="<?php echo esc_attr( $type ); ?>" <?php echo in_array( $type, $options ) ? 'checked="checked"' : ''; ?>/>
<input id="<?php echo esc_attr( $id ); ?>" type="checkbox" name="<?php echo esc_attr( self::POST_TYPE_FIELD ); ?>[]" value="<?php echo esc_attr( $type ); ?>" <?php echo in_array( $type, $options, true ) ? 'checked="checked"' : ''; ?>/>
<label for="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $post_type->label ); ?></label><br/>
<?php
}
Expand Down

0 comments on commit 16581d1

Please sign in to comment.