mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- admin settings new enhancements (partially);
This commit is contained in:
@@ -97,19 +97,18 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function render_form_row( $data ) {
|
||||
public function render_form_row( $data ) {
|
||||
|
||||
if ( empty( $data['type'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( !empty( $data['value'] ) && $data['type'] != 'email_template' ) {
|
||||
if ( ! empty( $data['value'] ) && $data['type'] != 'email_template' ) {
|
||||
$data['value'] = wp_unslash( $data['value'] );
|
||||
|
||||
/*for multi_text*/
|
||||
@@ -1739,6 +1738,50 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $field_data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render_form_section( $field_data ) {
|
||||
$html = '<h3>' . esc_html( $field_data['title'] ) . '</h3>';
|
||||
if ( ! empty( $field_data['content'] ) ) {
|
||||
$html .= '<div id="um_' . esc_attr( $field_data['id'] ) . '_description"><p>' . wp_kses( $field_data['content'] , UM()->get_allowed_html( 'admin_notice' ) ) . '</p></div>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function render_override_templates( $field_data ) {
|
||||
$um_check_version = get_transient( 'um_check_template_versions' );
|
||||
|
||||
$check_url = add_query_arg(
|
||||
array(
|
||||
'um_adm_action' => 'check_templates_version',
|
||||
'_wpnonce' => wp_create_nonce( 'check_templates_version' ),
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<p class="description" style="margin: 20px 0 0 0;">
|
||||
<a href="<?php echo esc_url( $check_url ); ?>" class="button" style="margin-right: 10px;">
|
||||
<?php esc_html_e( 'Re-check templates', 'ultimate-member' ); ?>
|
||||
</a>
|
||||
<?php
|
||||
if ( false !== $um_check_version ) {
|
||||
// translators: %s: Last checking templates time.
|
||||
echo esc_html( sprintf( __( 'Last update: %s. You could re-check changes manually.', 'ultimate-member' ), wp_date( get_option( 'date_format', 'F j, Y' ) . ' ' . get_option( 'time_format', 'g:i a' ), $um_check_version ) ) );
|
||||
} else {
|
||||
esc_html_e( 'Templates haven\'t check yet. You could check changes manually.', 'ultimate-member' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
ob_start();
|
||||
include_once UM_PATH . 'includes/admin/core/list-tables/version-template-list-table.php';
|
||||
$html = ob_get_clean();
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get field value
|
||||
|
||||
Reference in New Issue
Block a user