Commit f75f37f6 by Muhammad Usman

settings done

parent 9fce169c
<?php
add_action( 'admin_menu', 'vq_lms_settings_page' );
add_action( 'admin_init', 'vq_lms_settings_init' );
function vq_lms_settings_init() {
register_setting( 'vq_lms_settings', 'vq_lms_settings_options' );
add_settings_section(
'vq_lms_settings_section_developers',
'General Settings',
'vq_lms_settings_section_developers_cb',
'vq_lms_settings'
);
add_settings_field(
'vq_lms_settings_field_general_price',
'Default Course Price',
'vq_lms_settings_field_price_cb',
'vq_lms_settings',
'vq_lms_settings_section_developers',
[
'label_for' => 'vq_lms_settings_field_general_price',
'class' => 'vq_lms_settings_row',
'vq_lms_settings_custom_data' => 'custom',
]
);
add_settings_field(
'vq_lms_settings_field_currency_name',
'Currency Name',
'vq_lms_settings_field_currency_name_cb',
'vq_lms_settings',
'vq_lms_settings_section_developers',
[
'label_for' => 'vq_lms_settings_field_currency_name',
'class' => 'vq_lms_settings_row',
'vq_lms_settings_custom_data' => 'custom',
]
);
add_settings_field(
'vq_lms_settings_field_currency_symbol',
'Currency Symbol',
'vq_lms_settings_field_currency_symbol_cb',
'vq_lms_settings',
'vq_lms_settings_section_developers',
[
'label_for' => 'vq_lms_settings_field_currency_symbol',
'class' => 'vq_lms_settings_row',
'vq_lms_settings_custom_data' => 'custom',
]
);
}
function vq_lms_settings_section_developers_cb( $args ) {
}
function vq_lms_settings_field_price_cb( $args ) {
$options = get_option( 'vq_lms_settings_options' );
?>
<input type="text"
name="vq_lms_settings_options[<?php echo esc_attr( $args['label_for'] ); ?>]"
value="<?php echo $options[$args['label_for']]; ?>"
>
<p class="description">
<?php esc_html_e( 'Your entered price will be listed as default price for all courses unless specified for each.', 'vq_lms_settings' ); ?>
</p>
<?php
}
function vq_lms_settings_field_currency_name_cb($args) {
$options = get_option( 'vq_lms_settings_options' );
?>
<input type="text"
name="vq_lms_settings_options[<?php echo esc_attr( $args['label_for'] ); ?>]"
value="<?php echo $options[$args['label_for']]; ?>"
>
<p class="description">
<?php esc_html_e( 'Your entered currency will be used for whole LMS system listing.', 'vq_lms_settings' ); ?>
</p>
<?php
}
function vq_lms_settings_field_currency_symbol_cb($args) {
$options = get_option( 'vq_lms_settings_options' );
?>
<input type="text"
name="vq_lms_settings_options[<?php echo esc_attr( $args['label_for'] ); ?>]"
value="<?php echo $options[$args['label_for']]; ?>"
>
<p class="description">
<?php esc_html_e( 'Enter Currency Symbol.', 'vq_lms_settings' ); ?>
</p>
<?php
}
function vq_lms_settings_page() {
add_submenu_page('edit.php?post_type=vq_course',
'Test Page',
'Settings',
'manage_options',
'vq_lms_settings',
'vq_lms_settings_page_html'
);
}
function vq_lms_settings_page_html() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
if ( isset( $_GET['settings-updated'] ) ) {
add_settings_error(
'vq_lms_settings_messages',
'vq_lms_settings_message',
'Settings Saved',
'updated'
);
}
settings_errors( 'vq_lms_settings_messages' );
?>
<div class="wrap">
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
<form action="options.php" method="post">
<?php
settings_fields( 'vq_lms_settings' );
do_settings_sections( 'vq_lms_settings' );
submit_button( 'Save Settings' );
?>
</form>
</div>
<?php
}
\ No newline at end of file
......@@ -5,12 +5,12 @@ require_once('admin/handle-post.php');
require_once('admin/handle-metaboxes.php');
require_once('admin/lms-setting.php');
add_action('init', 'vq_apex_custom_posts');
add_action('init', 'vq_apex_custom_taxonomies');
add_action( 'admin_menu', 'vq_add_plugin_setting_page' );
add_filter('wp_nav_menu_items', 'vq_add_lms_navigation', 10, 2);
add_filter( 'query_vars', 'vq_query_vars_filter' );
......@@ -131,17 +131,3 @@ function vq_render_large_banner($attr) {
}
function vq_add_plugin_setting_page() {
add_options_page(
'LMS Settings',
'LMS Settings',
'manage_options',
'vq_lms_settings',
'vq_render_lms_settings'
);
}
function vq_render_lms_settings() {
}
\ No newline at end of file
......@@ -67,40 +67,6 @@ $course_categories = get_terms( array(
<?php do_shortcode('[vq_large_banner pgslg="banner"]') ?>
<!--<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="e-learning-heading">
<h4>Learning Management System</h4>
</div>
</div>
</div>
</div>
<div class="learning-manaegment-image">
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="intro-box">
<div class="intro-heading">
<h2>Special <br>intro <br>price</h2>
<h3>$1.00</h3>
<h4>Per user / Per month</h4>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="intro-heading">
<p>Had a two & a half day of information overload about cloud, virtualization, byod etc.
under the professional professional guidance of a well-experienced trainer named Raj &
it was all worth it. I was able to capture & internalize the required knowledge &
concepts & because of that I was able to pass the certification exam! Had a two & a half
day of information overload about cloud, virtualization, byod etc.</p>
</div>
<button type="submit" class="learn-button-1">Loern More</button>
</div>
</div>
</div>
</div>-->
</div>
<?php
get_footer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment