Skip to content

Commit

Permalink
added version compare condition for advance timer
Browse files Browse the repository at this point in the history
  • Loading branch information
etchirag committed Dec 1, 2023
1 parent dad8d13 commit 00c61c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions php/admin/options-page-questions-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function qsm_options_questions_tab_content() {
$read_only = "";
$disable_class = "";
$background = "#FFFFFF";
$display_advance = "yes";
if ( ! class_exists ( 'QSM_AdvancedTimer' ) ) {
$read_only = 'readonly';
$disable_class = 'qsm-disabled-td';
Expand All @@ -180,6 +181,12 @@ function qsm_options_questions_tab_content() {
$target_link = sprintf( '<div class="notice notice-error notice-advance-timer"><strong>'.__('Error! ', 'quiz-master-next').'</strong>'.$target_text.'</div>' );
echo wp_kses_post($target_link);
}
$advancetimer = 'qsm-advanced-timer/qsm-advanced-timer.php';
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/'. $advancetimer);
$version_number = $plugin_data['Version'];
if ( version_compare($version_number, '2.0.0', '<') ) {
$display_advance = "no";
}
}
?>
<div class="question-controls">
Expand Down Expand Up @@ -699,6 +706,7 @@ class="save-page-button button button-primary"><?php esc_html_e( 'Save Questions
<input name="hide_prevbtn" id="hide_prevbtn" type="checkbox" value="" />
<span class="qsm-page-setting-span"><?php _e( 'Hide Previous button', 'quiz-master-next' ); ?></span>
</div>
<?php if ( "yes" == $display_advance ) { ?>
<div class="qsm-page-setting-container" style="background-color:<?php echo esc_attr($background); ?>">
<div class="qsm-page-setting-top ">
<div class="qsm-page-setting-left">
Expand All @@ -725,6 +733,7 @@ class="save-page-button button button-primary"><?php esc_html_e( 'Save Questions
<?php } ?>
</div>
</div>
<?php } ?>
<?php do_action( 'qsm_action_quiz_page_attributes_fields' ); ?>
</div>
</main>
Expand Down

0 comments on commit 00c61c0

Please sign in to comment.