get_post_types(); $support_post_type = $component->get_support_post_type(); $is_different = false; if( ( isset( $_POST['page_options'] ) && $_POST['page_options'] === RC_SETTING_OPTION_KEY ) && ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'update-options' ) ) ) { // update post $post_support_posts = ( isset($_POST['rc_support_post_types']) ) ? $_POST['rc_support_post_types'] : array(); if( count( array_diff( $support_post_type, $post_support_posts ) ) ) { // different data before post $is_different = true; } $is_update = $component->update_support_post_type( $post_support_posts ); if ( $is_different && $is_update ) { set_transient( RC_SETTING_UPDATE, array( __( 'Success to setting update.', RC_TXT_DOMAIN ) ), 10 ); } else if ( $is_different === false && $is_update === false ) { set_transient( RC_SETTING_UPDATE, array( __( 'Success to setting update.', RC_TXT_DOMAIN ) ), 10 ); } else if ( $is_different && $is_update === false ) { // 更新失敗 $e = new WP_Error(); $e->add( 'error', __( 'Failed to setting update.', RC_TXT_DOMAIN ) ); set_transient( RC_SETTING_ERROR, $e->get_error_messages(), 10 ); } $support_post_type = $component->get_support_post_type(); wp_safe_redirect( menu_page_url( 'rucy', false ) ); } ?>

    $post_type ) { $checked = ( in_array( $key, $support_post_type ) ) ? 'checked' : ''; ?>