summaryrefslogtreecommitdiffstats
path: root/include/plugin-options.php
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2018-07-04 18:03:21 +0200
committerdanix <danix@danix.xyz>2018-07-04 18:03:21 +0200
commit80ada5400b9bcfcccc1ac741727dc6dfc04896e8 (patch)
treee4786290717df8162b2612db73adb405bdb6f17e /include/plugin-options.php
downloaddanixland-user-panel-80ada5400b9bcfcccc1ac741727dc6dfc04896e8.tar.gz
danixland-user-panel-80ada5400b9bcfcccc1ac741727dc6dfc04896e8.zip
initial commitHEADmaster
Diffstat (limited to 'include/plugin-options.php')
-rw-r--r--include/plugin-options.php94
1 files changed, 94 insertions, 0 deletions
diff --git a/include/plugin-options.php b/include/plugin-options.php
new file mode 100644
index 0000000..2635375
--- /dev/null
+++ b/include/plugin-options.php
@@ -0,0 +1,94 @@
+<?php
+/*****************************************************************************************
+* Settings Sections
+*******************************************************************************************/
+// Add a form section for the Gravatar Display
+add_settings_section('dnxup_settings_gravatar_display', __('Gravatar setting', 'dnxup'), 'dnxup_settings_gravatar_section_text', 'dnxup_settings_sections');
+
+// Add a form section for the Logged out Heading
+add_settings_section('dnxup_settings_log_out_heading_display', __('Logged out Heading', 'dnxup'), 'dnxup_settings_log_out_heading_section_text', 'dnxup_settings_sections');
+
+// Add a form section for the Logged in Heading
+add_settings_section('dnxup_settings_log_in_heading_display', __('Logged in Heading', 'dnxup'), 'dnxup_settings_log_in_heading_section_text', 'dnxup_settings_sections');
+
+// Add a form section for the Logged in Custom Links
+add_settings_section('dnxup_settings_log_in_custom_links_display', __('Logged in Custom Links', 'dnxup'), 'dnxup_settings_log_in_custom_links_section_text', 'dnxup_settings_sections');
+
+
+/*****************************************************************************************
+* Settings Fields
+*******************************************************************************************/
+// Add Gravatar Display field to his section
+add_settings_field('dnxup_setting_gravatar_display', __('Display Gravatar?', 'dnxup'), 'dnxup_setting_gravatar_display', 'dnxup_settings_sections', 'dnxup_settings_gravatar_display');
+
+// Add Logged out Heading field to his section
+add_settings_field('dnxup_setting_log_out_heading_display', __('Logged out Heading', 'dnxup'), 'dnxup_setting_log_out_heading_display', 'dnxup_settings_sections', 'dnxup_settings_log_out_heading_display');
+
+// Add Logged in Heading field to his section
+add_settings_field('dnxup_setting_log_in_heading_display', __('Logged in Heading', 'dnxup'), 'dnxup_setting_log_in_heading_display', 'dnxup_settings_sections', 'dnxup_settings_log_in_heading_display');
+
+// Add Logged in Heading field to his section
+add_settings_field('dnxup_setting_log_in_custom_links_display', __('Logged in Custom Links', 'dnxup'), 'dnxup_setting_log_in_custom_links_display', 'dnxup_settings_sections', 'dnxup_settings_log_in_custom_links_display');
+
+
+/*****************************************************************************************
+* Fields text
+*******************************************************************************************/
+// Gravatar Display Section
+function dnxup_settings_gravatar_section_text() { ?>
+<p><?php _e( 'Select this if you want to display the Gravatar image on the widget', 'dnxup' ); ?></p>
+<?php }
+
+// Logged out Heading Display Section
+function dnxup_settings_log_out_heading_section_text() { ?>
+<p><?php _e( 'Heading for widget when user is logged out.', 'dnxup' ); ?></p>
+<?php }
+
+// Logged in Heading Display Section
+function dnxup_settings_log_in_heading_section_text() { ?>
+<p><?php _e( 'Heading for widget when user is logged in.', 'dnxup' ); ?></p>
+<?php }
+
+// Logged in Custom Links Display Section
+function dnxup_settings_log_in_custom_links_section_text() { ?>
+<p><?php _e( 'Custom Links to display when user is logged in.', 'dnxup' ); ?></p>
+<?php }
+
+
+/*****************************************************************************************
+* Form display functions
+*******************************************************************************************/
+// Display Gravatar??
+function dnxup_setting_gravatar_display() {
+$dnxup_options = get_option( 'dnxup_options' ); ?>
+<input type="checkbox" name="dnxup_options[show_gravatar]" <?php checked( $dnxup_options['show_gravatar'] ); ?> />
+<span class="description"><?php _e('Select this to display the Gravatar image for the current user', 'dnxup'); ?></span>
+<?php }
+
+// Logged out Heading
+function dnxup_setting_log_out_heading_display() {
+$dnxup_options = get_option( 'dnxup_options' ); ?>
+<input type="text" name="dnxup_options[logged_out_heading]" value="<?php echo $dnxup_options['logged_out_heading']; ?>" />
+<span class="description"><?php _e('This is the heading your users will see when they\'re not logged in to your site', 'dnxup'); ?></span>
+<?php }
+
+// Logged in Heading
+function dnxup_setting_log_in_heading_display() {
+$dnxup_options = get_option( 'dnxup_options' ); ?>
+<input type="text" name="dnxup_options[logged_in_heading]" value="<?php echo $dnxup_options['logged_in_heading']; ?>" />
+<span class="description"><?php _e('This is the heading your users will see when they\'re logged in. <code>%username%</code> shows username.', 'dnxup'); ?></span>
+<?php }
+
+// Logged in Custom Links
+function dnxup_setting_log_in_custom_links_display() {
+$dnxup_options = get_option( 'dnxup_options' ); ?>
+<textarea name="dnxup_options[logged_in_links]" rows="10" cols="80" /><?php echo wp_kses_data( $dnxup_options['logged_in_links'] ) ?></textarea>
+<div class="description">
+ <p>
+ <?php _e("<strong>One link per line</strong>. Note: Logout link will always show regardless. Tip: Add <code>|true</code> after a link to only show it to admin users or alternatively use a <code>|user_capability</code> and the link will only be shown to users with that capability. See <a href='http://codex.wordpress.org/Roles_and_Capabilities' target='_blank'>http://codex.wordpress.org/Roles_and_Capabilities</a> for more info on roles and Capabilities.<br/> You can also type <code>%USERNAME%</code> and <code>%USERID%</code> which will be replaced by the user info.<br />Example:",'dnxup');
+ echo '<br /><code>&lt;a href="'.get_bloginfo('wpurl').'/wp-admin/"&gt;'. __('Dashboard', 'dnxup') . '&lt;/a&gt;<br/>&lt;a href="'.get_bloginfo('wpurl').'/wp-admin/profile.php"&gt;'. __('Profile', 'dnxup') .'&lt;/a&gt;</code>'; ?>
+ </p>
+</div>
+<?php }
+
+?> \ No newline at end of file