myStickymenu - Version 2.0.5

Version Description

  • Added: Admin settings sidebar right
  • Added: Admin separated js script
  • Added: Admin separated css script
Download this release

Release Info

Developer damiroquai
Plugin Icon 128x128 myStickymenu
Version 2.0.5
Comparing to
See all releases

Code changes from version 2.0.4 to 2.0.5

css/mystickymenu-admin.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ .mysticky-general,.mysticky-style,.mysticky-advanced,.mysticky-hideform,.mysticky-hideformreset{display:none;}
2
+ .main-content {float:left;width:65%;}
3
+ .main-sidebar {float:right;width:30%;background:#ffffff;border: 1px solid #e5e5e5;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);}
4
+ .main-sidebar h3 {margin: 0;padding: 8px 12px;border-bottom: 1px solid #ececec;}
5
+ .main-sidebar .inner {padding:10px;}
6
+ .main-sidebar p {padding:8px;margin:0;border-top:solid 1px #e5e5e5;}
7
+ .mystickyinput {padding-top: 6px;}
8
+ @media screen and (max-width: 782px) {
9
+ .main-content, .main-sidebar { width:100%; float:none;clear:both;}
10
+ }
js/mystickymenu-admin.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+ "use strict";
3
+
4
+
5
+
6
+ jQuery(document).ready(function($){
7
+
8
+
9
+ $("#myfixed_zindex,#myfixed_opacity,#myfixed_transition_time,#disable_css").parent().parent().parent().hide();
10
+ $("#myfixed_bgcolor,#mysticky_disable_at_front_home").parent().parent().parent().hide();
11
+ $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().hide();
12
+ $("#myfixed_cssstyle").parent().parent().hide();
13
+ $(".mysticky-hideformreset").hide();
14
+ $(".mysticky-hideform,.mysticky-general").fadeIn(300);
15
+
16
+
17
+ $(".btn-general").click(function(){
18
+ $(".btn-general").addClass("nav-tab-active");
19
+ $(".btn-style,.btn-advanced").removeClass("nav-tab-active");
20
+ $("#mysticky_class_selector,#myfixed_disable_small_screen,#myfixed_disable_large_screen,#mysticky_active_on_height,#mysticky_active_on_height_home,#myfixed_fade").parent().parent().parent().show();
21
+ $("#myfixed_zindex,#myfixed_opacity,#myfixed_transition_time,#disable_css,#mysticky_disable_at_front_home").parent().parent().parent().hide();
22
+ $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().hide();
23
+ $("#myfixed_cssstyle,#mysticky_disable_at_front_home").parent().parent().hide();
24
+ $(".mysticky-general").fadeIn(300);
25
+ $(".mysticky-style,.mysticky-advanced,.mysticky-hideformreset") .hide();
26
+ });
27
+
28
+ $(".btn-general,.btn-style,.btn-advanced").hover(function() {
29
+ $(".btn-general,.btn-style,.btn-advanced").css("cursor","pointer");
30
+ });
31
+
32
+ $(".btn-style").click(function(){
33
+ $(".btn-style").addClass("nav-tab-active");
34
+ $(".btn-general,.btn-advanced").removeClass("nav-tab-active");
35
+ $("#mysticky_class_selector,#myfixed_disable_small_screen,#myfixed_disable_large_screen,#mysticky_active_on_height,#mysticky_active_on_height_home,#myfixed_fade,#mysticky_disable_at_front_home").parent().parent().parent().hide();
36
+ $("#myfixed_zindex,#myfixed_bgcolor,#myfixed_opacity,#myfixed_transition_time,#disable_css").parent().parent().parent().show();
37
+ $("#myfixed_cssstyle").parent().parent().show();
38
+ $("#mysticky_disable_at_front_home").parent().parent().hide();
39
+ $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().show();
40
+ $(".mysticky-general").hide();
41
+ $(".mysticky-hideformreset").hide();
42
+ $(".mysticky-style") .fadeIn(300);
43
+ $(".mysticky-advanced").hide();
44
+ });
45
+
46
+ $(".btn-advanced").click(function(){
47
+ $(".btn-advanced").addClass("nav-tab-active");
48
+ $(".btn-style,.btn-general").removeClass("nav-tab-active");
49
+ $("#mysticky_class_selector,#myfixed_disable_small_screen,#myfixed_disable_large_screen,#mysticky_active_on_height,#mysticky_active_on_height_home,#myfixed_fade").parent().parent().parent().hide();
50
+ $("#myfixed_zindex,#myfixed_opacity,#myfixed_transition_time,#disable_css").parent().parent().parent().hide();
51
+ $("#myfixed_cssstyle").parent().parent().hide();
52
+ $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().hide();
53
+ $("#mysticky_disable_at_front_home").parent().parent().parent().show();
54
+ $("#mysticky_disable_at_front_home").parent().parent().show();
55
+ $(".mysticky-hideformreset").fadeIn(300);
56
+ $(".mysticky-general").hide();
57
+ $(".mysticky-style") .hide();
58
+ $(".mysticky-advanced").fadeIn(300);
59
+ });
60
+
61
+
62
+
63
+ $(".confirm").click(function() {
64
+ return window.confirm("Reset to default settings?");
65
+ });
66
+
67
+ });
68
+
69
+ })(jQuery);
mystickymenu.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: myStickymenu
4
  Plugin URI: http://wordpress.transformnews.com/plugins/mystickymenu-simple-sticky-fixed-on-top-menu-implementation-for-twentythirteen-menu-269
5
  Description: Simple sticky (fixed on top) menu implementation for navigation menu. After install go to Settings / myStickymenu and change Sticky Class to .your_navbar_class or #your_navbar_id.
6
- Version: 2.0.4
7
  Author: m.r.d.a
8
  Author URI: http://wordpress.transformnews.com/
9
  Text Domain: mystickymenu
@@ -12,137 +12,75 @@
12
  */
13
 
14
  defined('ABSPATH') or die("Cannot access pages directly.");
15
- define( 'MYSTICKY_VERSION', '2.0.4' );
16
 
17
  class MyStickyMenuBackend
18
  {
19
 
20
  private $options;
 
 
21
 
22
  public function __construct()
23
- {
 
 
24
  add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
25
  add_action( 'admin_init', array( $this, 'mysticky_load_transl') );
26
  add_action( 'admin_init', array( $this, 'page_init' ) );
27
  add_action( 'admin_init', array( $this, 'mysticky_default_options' ) );
28
 
29
- add_action( 'admin_enqueue_scripts', array( $this, 'mysticky_enqueue_color_picker' ) );
30
- add_action( 'admin_head', array( $this, 'mysticky_admin_script' ) );
 
 
 
 
 
31
  }
32
-
33
-
 
 
 
 
34
 
35
 
36
- public function mysticky_admin_script() {
37
- echo '<style type="text/css">.mysticky-general,.mysticky-style,.mysticky-advanced,.mysticky-hideform,.mysticky-hideformreset{display:none;}</style>';
38
- echo '
39
- <script>
40
-
41
- (function( $ ) {
42
- "use strict";
43
 
44
- jQuery(document).ready(function($){
45
-
46
- $("#myfixed_zindex,#myfixed_opacity,#myfixed_transition_time,#disable_css").parent().parent().parent().hide();
47
- $("#myfixed_bgcolor").parent().parent().parent().hide();
48
- $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().hide();
49
- $("#myfixed_cssstyle,#mysticky_disable_at_front_home").parent().parent().hide();
50
- $(".mysticky-hideformreset").hide();
51
- $(".mysticky-hideform,.mysticky-general").fadeIn(300);
52
-
53
-
54
- $(".btn-general").click(function(){
55
-
56
- $(".btn-general").addClass("nav-tab-active");
57
- $(".btn-style,.btn-advanced").removeClass("nav-tab-active");
58
- $("#mysticky_class_selector,#myfixed_disable_small_screen,#myfixed_disable_large_screen,#mysticky_active_on_height,#mysticky_active_on_height_home,#myfixed_fade").parent().parent().parent().show();
59
- $("#myfixed_zindex,#myfixed_opacity,#myfixed_transition_time,#disable_css").parent().parent().parent().hide();
60
- $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().hide();
61
-
62
- $("#myfixed_cssstyle,#mysticky_disable_at_front_home").parent().parent().hide();
63
-
64
- $(".mysticky-general").fadeIn(300);
65
- $(".mysticky-style,.mysticky-advanced,.mysticky-hideformreset") .hide();
66
-
67
-
68
-
69
-
70
- });
71
-
72
- $(".btn-general,.btn-style,.btn-advanced").hover(function() {
73
- $(".btn-general,.btn-style,.btn-advanced").css("cursor","pointer");
74
- });
75
-
76
-
77
-
78
- $(".btn-style").click(function(){
79
-
80
- $(".btn-style").addClass("nav-tab-active");
81
- $(".btn-general,.btn-advanced").removeClass("nav-tab-active");
82
-
83
-
84
- $("#mysticky_class_selector,#myfixed_disable_small_screen,#myfixed_disable_large_screen,#mysticky_active_on_height,#mysticky_active_on_height_home,#myfixed_fade").parent().parent().parent().hide();
85
- $("#myfixed_zindex,#myfixed_bgcolor,#myfixed_opacity,#myfixed_transition_time,#disable_css").parent().parent().parent().show();
86
- $("#myfixed_cssstyle").parent().parent().show();
87
- $("#mysticky_disable_at_front_home").parent().parent().hide();
88
- $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().show();
89
-
90
-
91
- $(".mysticky-general").hide();
92
- $(".mysticky-hideformreset").hide();
93
- $(".mysticky-style") .fadeIn(300);
94
- $(".mysticky-advanced").hide();
95
-
96
- });
97
-
98
-
99
-
100
-
101
- $(".btn-advanced").click(function(){
102
-
103
-
104
- $(".btn-advanced").addClass("nav-tab-active");
105
- $(".btn-style,.btn-general").removeClass("nav-tab-active");
106
-
107
- $("#mysticky_class_selector,#myfixed_disable_small_screen,#myfixed_disable_large_screen,#mysticky_active_on_height,#mysticky_active_on_height_home,#myfixed_fade").parent().parent().parent().hide();
108
- $("#myfixed_zindex,#myfixed_opacity,#myfixed_transition_time,#disable_css").parent().parent().parent().hide();
109
- $("#myfixed_cssstyle").parent().parent().hide();
110
- $("#myfixed_bgcolor").parent().parent().parent().parent().parent().parent().hide();
111
- $("#mysticky_disable_at_front_home").parent().parent().show();
112
- $(".mysticky-hideformreset").fadeIn(300);
113
-
114
- $(".mysticky-general").hide();
115
- $(".mysticky-style") .hide();
116
- $(".mysticky-advanced").fadeIn(300);
117
-
118
-
119
-
120
- });
121
-
122
-
123
-
124
- $(".confirm").click(function() {
125
- return window.confirm("Reset to default settings?");
126
- });
127
-
128
- });
129
-
130
- })(jQuery);
131
- </script>';
132
-
133
- }
134
-
135
-
136
-
137
-
138
 
139
- public function mysticky_load_transl()
 
 
 
 
 
140
  {
 
 
 
 
 
 
 
 
 
 
141
  load_plugin_textdomain('mystickymenu', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
142
  }
143
 
144
- public function add_plugin_page()
145
- {
146
  // This page will be under "Settings"
147
  add_options_page(
148
  'Settings Admin',
@@ -153,15 +91,16 @@ public function mysticky_admin_script() {
153
  );
154
  }
155
 
156
- public function create_admin_page()
157
- {
158
  // Set class property
159
  $this->options = get_option( 'mysticky_option_name');
160
  ?>
161
- <div class="wrap">
162
 
163
  <h2><?php _e('myStickymenu', 'mystickymenu'); ?></h2>
164
- <p><?php _e("Add sticky menu / header to any theme. <br />Simply change 'Sticky Class' to HTML element class desired to be sticky (div id can be used as well).", 'mystickymenu'); ?></p>
 
 
165
 
166
 
167
 
@@ -245,6 +184,27 @@ public function mysticky_admin_script() {
245
 
246
 
247
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  <?php
249
  }
250
 
@@ -373,62 +333,62 @@ public function mysticky_admin_script() {
373
 
374
  add_settings_field(
375
  'mysticky_disable_at_front_home',
376
- __("Disable at", 'mystickysidebar'),
377
  array( $this, 'mysticky_enable_callback' ),
378
  'my-stickymenu-settings',
379
  'setting_section_id'
380
  );
381
  add_settings_field(
382
  'mysticky_disable_at_blog',
383
- __("Disable at", 'mystickysidebar'),
384
  'my-stickymenu-settings',
385
  'setting_section_id'
386
  );
387
  add_settings_field(
388
  'mysticky_disable_at_page',
389
- __("Disable at", 'mystickysidebar'),
390
  'my-stickymenu-settings',
391
  'setting_section_id'
392
  );
393
  add_settings_field(
394
  'mysticky_disable_at_tag',
395
- __("Disable at", 'mystickysidebar'),
396
  'my-stickymenu-settings',
397
  'setting_section_id'
398
  );
399
  add_settings_field(
400
  'mysticky_disable_at_category',
401
- __("Disable at", 'mystickysidebar'),
402
  'my-stickymenu-settings',
403
  'setting_section_id'
404
  );
405
  add_settings_field(
406
  'mysticky_disable_at_single',
407
- __("Disable at", 'mystickysidebar'),
408
  'my-stickymenu-settings',
409
  'setting_section_id'
410
  );
411
  add_settings_field(
412
  'mysticky_disable_at_archive',
413
- __("Disable at", 'mystickysidebar'),
414
  'my-stickymenu-settings',
415
  'setting_section_id'
416
  );
417
  add_settings_field(
418
  'mysticky_enable_at_pages',
419
- __(" ", 'mystickysidebar'),
420
  'my-stickymenu-settings',
421
  'setting_section_id'
422
  );
423
  add_settings_field(
424
  'mysticky_enable_at_posts',
425
- __(" ", 'mystickysidebar'),
426
  'my-stickymenu-settings',
427
  'setting_section_id'
428
  );
429
  add_settings_field(
430
  'mysticky_disable_at_search',
431
- __("Disable at", 'mystickysidebar'),
432
  'my-stickymenu-settings',
433
  'setting_section_id'
434
  );
@@ -538,7 +498,7 @@ public function mysticky_admin_script() {
538
  'mysticky_active_on_height' => '0',
539
  'mysticky_active_on_height_home' => '0',
540
  'myfixed_fade' => 'on',
541
- 'myfixed_cssstyle' => '#mysticky-nav.wrapfixed { } #mysticky-nav.wrapfixed.up { } #mysticky-nav.wrapfixed.down { } #mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }'
542
  );
543
 
544
  if ( get_option('mysticky_option_name') == false ) {
@@ -556,12 +516,7 @@ public function mysticky_admin_script() {
556
 
557
 
558
 
559
- public function mysticky_enqueue_color_picker( )
560
- {
561
- wp_enqueue_style( 'wp-color-picker' );
562
- wp_enqueue_script( 'my-script-handle', plugins_url('js/iris-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
563
-
564
- }
565
 
566
  public function print_section_info()
567
  {
@@ -571,7 +526,7 @@ public function mysticky_admin_script() {
571
  public function mysticky_class_selector_callback()
572
  {
573
  printf(
574
- '<p class="description"><input type="text" size="8" id="mysticky_class_selector" name="mysticky_option_name[mysticky_class_selector]" value="%s" /> ',
575
  isset( $this->options['mysticky_class_selector'] ) ? esc_attr( $this->options['mysticky_class_selector']) : ''
576
  );
577
  echo __("menu or header element class or id.", 'mystickymenu');
@@ -708,11 +663,26 @@ public function mysticky_admin_script() {
708
  '<textarea type="text" rows="4" cols="60" id="myfixed_cssstyle" name="mysticky_option_name[myfixed_cssstyle]">%s</textarea> <br />',
709
  isset( $this->options['myfixed_cssstyle'] ) ? esc_attr( $this->options['myfixed_cssstyle']) : ''
710
  );
711
- echo '<p class="description">';
712
 
713
- echo __("If you want to change sticky hover color: ", 'mystickymenu');
714
- echo '.myfixed li a:hover {color:#000; background-color: #ccc;}<br />';
715
- echo __("More examples <a href='http://wordpress.transformnews.com/tutorials/mystickymenu-extended-style-functionality-using-myfixed-sticky-class-403'>here</a>.", 'mystickymenu');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
716
  echo'</p>';
717
  }
718
 
@@ -742,55 +712,69 @@ public function mysticky_admin_script() {
742
  public function mysticky_enable_callback()
743
  {
744
 
745
- _e('<span>front page </span>', 'mystickymenu');
746
  printf(
747
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_front_home]" type="checkbox" %2$s /> ',
748
  'mysticky_disable_at_front_home',
749
  checked( isset( $this->options['mysticky_disable_at_front_home'] ), true, false )
750
  ) ;
751
- _e('<span>blog page </span>', 'mystickymenu');
 
752
  printf(
753
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_blog]" type="checkbox" %2$s /> ',
754
  'mysticky_disable_at_blog',
755
  checked( isset( $this->options['mysticky_disable_at_blog'] ), true, false )
756
  );
757
- _e('<span>pages </span>', 'mystickymenu');
 
 
758
  printf(
759
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_page]" type="checkbox" %2$s /> ',
760
  'mysticky_disable_at_page',
761
  checked( isset( $this->options['mysticky_disable_at_page'] ), true, false )
762
  );
763
- _e('<span>tags </span>', 'mystickymenu');
 
 
764
  printf(
765
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_tag]" type="checkbox" %2$s /> ',
766
  'mysticky_disable_at_tag',
767
  checked( isset( $this->options['mysticky_disable_at_tag'] ), true, false )
768
  );
769
- _e('<span>categories </span>', 'mystickymenu');
 
 
770
  printf(
771
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_category]" type="checkbox" %2$s /> ',
772
  'mysticky_disable_at_category',
773
  checked( isset( $this->options['mysticky_disable_at_category'] ), true, false )
774
  );
775
- _e('<span>posts </span>', 'mystickymenu');
 
 
776
  printf(
777
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_single]" type="checkbox" %2$s /> ',
778
  'mysticky_disable_at_single',
779
  checked( isset( $this->options['mysticky_disable_at_single'] ), true, false )
780
  );
781
- _e('<span>archives </span>', 'mystickymenu');
 
 
782
  printf(
783
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_archive]" type="checkbox" %2$s /> ',
784
  'mysticky_disable_at_archive',
785
  checked( isset( $this->options['mysticky_disable_at_archive'] ), true, false )
786
  );
 
 
787
 
788
- _e('<span>search </span>', 'mystickysidebar');
789
  printf(
790
- '<input id="%1$s" name="mysticky_option_name[mysticky_disable_at_search]" type="checkbox" %2$s /> ',
791
  'mysticky_disable_at_search',
792
  checked( isset( $this->options['mysticky_disable_at_search'] ), true, false )
793
  );
 
 
794
 
795
  if (isset ( $this->options['mysticky_disable_at_page'] ) == true ) {
796
 
@@ -802,7 +786,7 @@ public function mysticky_admin_script() {
802
  isset( $this->options['mysticky_enable_at_pages'] ) ? esc_attr( $this->options['mysticky_enable_at_pages']) : ''
803
  );
804
 
805
- _e('<span class="description">Comma separated list of pages to enable. It should be page name, id or slug. Example: about-us, 1134, Contact Us. Leave blank if you realy want to disable sticky sidebar for all pages.</span>', 'mystickymenu');
806
 
807
  }
808
 
@@ -816,7 +800,7 @@ public function mysticky_admin_script() {
816
  isset( $this->options['mysticky_enable_at_posts'] ) ? esc_attr( $this->options['mysticky_enable_at_posts']) : ''
817
  );
818
 
819
- _e('<span class="description">Comma separated list of posts to enable. It should be post name, id or slug. Example: about-us, 1134, Contact Us. Leave blank if you realy want to disable sticky sidebar for all posts.</span>', 'mystickymenu');
820
 
821
  }
822
 
@@ -884,7 +868,7 @@ class MyStickyMenuFrontend
884
  };
885
 
886
  if ( $mysticky_options['myfixed_cssstyle'] == "" ) {
887
- echo '#mysticky-nav.wrapfixed { } #mysticky-nav.wrapfixed.up { } #mysticky-nav.wrapfixed.down { } #mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }';
888
  }
889
 
890
 
3
  Plugin Name: myStickymenu
4
  Plugin URI: http://wordpress.transformnews.com/plugins/mystickymenu-simple-sticky-fixed-on-top-menu-implementation-for-twentythirteen-menu-269
5
  Description: Simple sticky (fixed on top) menu implementation for navigation menu. After install go to Settings / myStickymenu and change Sticky Class to .your_navbar_class or #your_navbar_id.
6
+ Version: 2.0.5
7
  Author: m.r.d.a
8
  Author URI: http://wordpress.transformnews.com/
9
  Text Domain: mystickymenu
12
  */
13
 
14
  defined('ABSPATH') or die("Cannot access pages directly.");
15
+ define( 'MYSTICKY_VERSION', '2.0.5' );
16
 
17
  class MyStickyMenuBackend
18
  {
19
 
20
  private $options;
21
+
22
+
23
 
24
  public function __construct()
25
+ {
26
+
27
+
28
  add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
29
  add_action( 'admin_init', array( $this, 'mysticky_load_transl') );
30
  add_action( 'admin_init', array( $this, 'page_init' ) );
31
  add_action( 'admin_init', array( $this, 'mysticky_default_options' ) );
32
 
33
+ //add_action( 'admin_enqueue_scripts', array( $this, 'mysticky_enqueue_color_picker' ) );
34
+ //add_action( 'admin_head', array( $this, 'mysticky_admin_script' ) );
35
+ add_action( 'admin_enqueue_scripts', array( $this, 'mysticky_admin_script' ) );
36
+
37
+ add_filter( 'plugin_action_links_mystickymenu/mystickymenu.php', array( $this, 'mystickymenu_settings_link' ) );
38
+
39
+
40
  }
41
+
42
+ public function mystickymenu_settings_link($links){
43
+ $settings_link = '<a href="options-general.php?page=my-stickymenu-settings">Settings</a>';
44
+ array_unshift($links, $settings_link);
45
+ return $links;
46
+ }
47
 
48
 
 
 
 
 
 
 
 
49
 
50
+
51
+
52
+ public function mysticky_admin_script($hook) {
53
+ if ($hook != 'settings_page_my-stickymenu-settings') {
54
+ return;
55
+ }
56
+
57
+ wp_register_script('mystickymenuAdminScript', plugins_url('/js/mystickymenu-admin.js', __FILE__), array( 'jquery' ), MYSTICKY_VERSION);
58
+ wp_enqueue_script('mystickymenuAdminScript');
59
+
60
+ wp_register_style('mystickymenuAdminStyle', plugins_url('/css/mystickymenu-admin.css', __FILE__) );
61
+ wp_enqueue_style('mystickymenuAdminStyle');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
+ wp_enqueue_style( 'wp-color-picker' );
64
+ wp_enqueue_script( 'my-script-handle', plugins_url('js/iris-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
65
+ }
66
+
67
+ /*
68
+ public function mysticky_enqueue_color_picker( )
69
  {
70
+ wp_enqueue_style( 'wp-color-picker' );
71
+ wp_enqueue_script( 'my-script-handle', plugins_url('js/iris-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
72
+
73
+ }
74
+
75
+ */
76
+
77
+
78
+
79
+ public function mysticky_load_transl(){
80
  load_plugin_textdomain('mystickymenu', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
81
  }
82
 
83
+ public function add_plugin_page(){
 
84
  // This page will be under "Settings"
85
  add_options_page(
86
  'Settings Admin',
91
  );
92
  }
93
 
94
+ public function create_admin_page(){
 
95
  // Set class property
96
  $this->options = get_option( 'mysticky_option_name');
97
  ?>
98
+ <div id="mystickymenu" class="wrap">
99
 
100
  <h2><?php _e('myStickymenu', 'mystickymenu'); ?></h2>
101
+ <p><?php _e("Add sticky menu / header to any theme. <br />Simply change 'Sticky Class' to HTML element class desired to be sticky (div id can be used as well).", 'mystickymenu'); ?></p>
102
+
103
+ <div class="main-content">
104
 
105
 
106
 
184
 
185
 
186
  </div>
187
+
188
+
189
+ <div class="main-sidebar">
190
+
191
+ <h3><?php _e('Plugin info','mystickymenu'); ?></h3>
192
+
193
+ <div class="inner">
194
+ <ul>
195
+ <li><strong><?php _e('Author:','mystickymenu'); ?></strong> <a href="http://wordpress.transformnews.com" target="_blank">m.r.d.a</a></li>
196
+ <li><strong><?php _e('Version:','mystickymenu'); ?></strong> <?php echo MYSTICKY_VERSION; ?></li>
197
+ <li><strong><?php _e('Documentation:','mystickymenu'); ?></strong> <a href="http://wordpress.transformnews.com/plugins/mystickymenu-simple-sticky-fixed-on-top-menu-implementation-for-twentythirteen-menu-269" target="_blank">About Plugin</a> <a href="http://wordpress.transformnews.com/tutorials/mystickymenu-theme-support-682" target="_blank">Theme Support</a></li>
198
+ <li><strong><?php _e('Support Forum','mystickymenu'); ?></strong>: <a href="https://wordpress.org/support/plugin/mystickymenu" target="_blank">WordPress.org</a></li>
199
+ <!--<li><strong><?php _e('Donate:','mystickymenu'); ?></strong> <a href="" target="_blank">Soon</a></li>-->
200
+
201
+ </ul>
202
+ </div>
203
+
204
+ <p><a href="https://wordpress.org/support/plugin/mystickymenu/reviews/" target="_blank"><strong><?php _e('Add your own review','mystickymenu'); ?></strong></a></p>
205
+
206
+ </div>
207
+ </div>
208
  <?php
209
  }
210
 
333
 
334
  add_settings_field(
335
  'mysticky_disable_at_front_home',
336
+ __("Disable at", 'mystickymenu'),
337
  array( $this, 'mysticky_enable_callback' ),
338
  'my-stickymenu-settings',
339
  'setting_section_id'
340
  );
341
  add_settings_field(
342
  'mysticky_disable_at_blog',
343
+ __("Disable at", 'mystickymenu'),
344
  'my-stickymenu-settings',
345
  'setting_section_id'
346
  );
347
  add_settings_field(
348
  'mysticky_disable_at_page',
349
+ __("Disable at", 'mystickymenu'),
350
  'my-stickymenu-settings',
351
  'setting_section_id'
352
  );
353
  add_settings_field(
354
  'mysticky_disable_at_tag',
355
+ __("Disable at", 'mystickymenu'),
356
  'my-stickymenu-settings',
357
  'setting_section_id'
358
  );
359
  add_settings_field(
360
  'mysticky_disable_at_category',
361
+ __("Disable at", 'mystickymenu'),
362
  'my-stickymenu-settings',
363
  'setting_section_id'
364
  );
365
  add_settings_field(
366
  'mysticky_disable_at_single',
367
+ __("Disable at", 'mystickymenu'),
368
  'my-stickymenu-settings',
369
  'setting_section_id'
370
  );
371
  add_settings_field(
372
  'mysticky_disable_at_archive',
373
+ __("Disable at", 'mystickymenu'),
374
  'my-stickymenu-settings',
375
  'setting_section_id'
376
  );
377
  add_settings_field(
378
  'mysticky_enable_at_pages',
379
+ __(" ", 'mystickymenu'),
380
  'my-stickymenu-settings',
381
  'setting_section_id'
382
  );
383
  add_settings_field(
384
  'mysticky_enable_at_posts',
385
+ __(" ", 'mystickymenu'),
386
  'my-stickymenu-settings',
387
  'setting_section_id'
388
  );
389
  add_settings_field(
390
  'mysticky_disable_at_search',
391
+ __("Disable at", 'mystickymenu'),
392
  'my-stickymenu-settings',
393
  'setting_section_id'
394
  );
498
  'mysticky_active_on_height' => '0',
499
  'mysticky_active_on_height_home' => '0',
500
  'myfixed_fade' => 'on',
501
+ 'myfixed_cssstyle' => '#mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }'
502
  );
503
 
504
  if ( get_option('mysticky_option_name') == false ) {
516
 
517
 
518
 
519
+
 
 
 
 
 
520
 
521
  public function print_section_info()
522
  {
526
  public function mysticky_class_selector_callback()
527
  {
528
  printf(
529
+ '<p class="description"><input type="text" size="18" id="mysticky_class_selector" class="mystickyinput" name="mysticky_option_name[mysticky_class_selector]" value="%s" /> ',
530
  isset( $this->options['mysticky_class_selector'] ) ? esc_attr( $this->options['mysticky_class_selector']) : ''
531
  );
532
  echo __("menu or header element class or id.", 'mystickymenu');
663
  '<textarea type="text" rows="4" cols="60" id="myfixed_cssstyle" name="mysticky_option_name[myfixed_cssstyle]">%s</textarea> <br />',
664
  isset( $this->options['myfixed_cssstyle'] ) ? esc_attr( $this->options['myfixed_cssstyle']) : ''
665
  );
 
666
 
667
+ echo '<p>';
668
+ echo __("CSS ID's and Classes to use:", 'mystickymenu');
669
+ echo'</p>';
670
+
671
+ echo '<pre>#mysticky-wrap { }<br>';
672
+ echo '#mysticky-nav.wrapfixed { }<br>';
673
+ echo '#mysticky-nav.wrapfixed.up { }<br>';
674
+ echo '#mysticky-nav.wrapfixed.down { }<br>';
675
+ echo '#mysticky-nav ';
676
+ printf (
677
+ isset( $this->options['mysticky_class_selector'] ) ? esc_attr( $this->options['mysticky_class_selector']) : ''
678
+ );
679
+ echo ' { }<br>#mysticky-nav ';
680
+ printf (
681
+ isset( $this->options['mysticky_class_selector'] ) ? esc_attr( $this->options['mysticky_class_selector']) : ''
682
+ );
683
+ echo '.myfixed { }</pre>';
684
+ echo '<p class="description">';
685
+ echo __("Find examples <a href='http://wordpress.transformnews.com/tutorials/mystickymenu-extended-style-functionality-using-myfixed-sticky-class-403'>here</a>.", 'mystickymenu');
686
  echo'</p>';
687
  }
688
 
712
  public function mysticky_enable_callback()
713
  {
714
 
715
+
716
  printf(
717
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_front_home]" type="checkbox" %2$s /> ',
718
  'mysticky_disable_at_front_home',
719
  checked( isset( $this->options['mysticky_disable_at_front_home'] ), true, false )
720
  ) ;
721
+ _e('<span>front page </span>', 'mystickymenu');
722
+ printf('</div>');
723
  printf(
724
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_blog]" type="checkbox" %2$s /> ',
725
  'mysticky_disable_at_blog',
726
  checked( isset( $this->options['mysticky_disable_at_blog'] ), true, false )
727
  );
728
+ _e('<span>blog page </span>', 'mystickymenu');
729
+ printf('</div>');
730
+
731
  printf(
732
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_page]" type="checkbox" %2$s /> ',
733
  'mysticky_disable_at_page',
734
  checked( isset( $this->options['mysticky_disable_at_page'] ), true, false )
735
  );
736
+ _e('<span>pages </span>', 'mystickymenu');
737
+ printf('</div>');
738
+
739
  printf(
740
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_tag]" type="checkbox" %2$s /> ',
741
  'mysticky_disable_at_tag',
742
  checked( isset( $this->options['mysticky_disable_at_tag'] ), true, false )
743
  );
744
+ _e('<span>tags </span>', 'mystickymenu');
745
+ printf('</div>');
746
+
747
  printf(
748
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_category]" type="checkbox" %2$s /> ',
749
  'mysticky_disable_at_category',
750
  checked( isset( $this->options['mysticky_disable_at_category'] ), true, false )
751
  );
752
+ _e('<span>categories </span>', 'mystickymenu');
753
+ printf('</div>');
754
+
755
  printf(
756
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_single]" type="checkbox" %2$s /> ',
757
  'mysticky_disable_at_single',
758
  checked( isset( $this->options['mysticky_disable_at_single'] ), true, false )
759
  );
760
+ _e('<span>posts </span>', 'mystickymenu');
761
+ printf('</div>');
762
+
763
  printf(
764
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_archive]" type="checkbox" %2$s /> ',
765
  'mysticky_disable_at_archive',
766
  checked( isset( $this->options['mysticky_disable_at_archive'] ), true, false )
767
  );
768
+ _e('<span>archives </span>', 'mystickymenu');
769
+ printf('</div>');
770
 
 
771
  printf(
772
+ '<div><input id="%1$s" name="mysticky_option_name[mysticky_disable_at_search]" type="checkbox" %2$s /> ',
773
  'mysticky_disable_at_search',
774
  checked( isset( $this->options['mysticky_disable_at_search'] ), true, false )
775
  );
776
+ _e('<span>search </span>', 'mystickymenu');
777
+ printf('</div>');
778
 
779
  if (isset ( $this->options['mysticky_disable_at_page'] ) == true ) {
780
 
786
  isset( $this->options['mysticky_enable_at_pages'] ) ? esc_attr( $this->options['mysticky_enable_at_pages']) : ''
787
  );
788
 
789
+ _e('<span class="description">Comma separated list of pages to enable. It should be page name, id or slug. Example: about-us, 1134, Contact Us. Leave blank if you realy want to disable sticky menu for all pages.</span>', 'mystickymenu');
790
 
791
  }
792
 
800
  isset( $this->options['mysticky_enable_at_posts'] ) ? esc_attr( $this->options['mysticky_enable_at_posts']) : ''
801
  );
802
 
803
+ _e('<span class="description">Comma separated list of posts to enable. It should be post name, id or slug. Example: about-us, 1134, Contact Us. Leave blank if you realy want to disable sticky menu for all posts.</span>', 'mystickymenu');
804
 
805
  }
806
 
868
  };
869
 
870
  if ( $mysticky_options['myfixed_cssstyle'] == "" ) {
871
+ echo '#mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }';
872
  }
873
 
874
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpress.transformnews.com/contact
4
  Tags: sticky, menu, header, sticky menu, sticky header, floating, floating menu
5
  Requires at least: 3.5.1
6
  Tested up to: 4.9.3
7
- Stable tag: 2.0.4
8
  License: GPLv2 or later
9
 
10
  This lightweight plugin will made your menu or header sticky on top of page, after desired number of pixels when scrolled.
@@ -54,6 +54,10 @@ In some cases you can use the whole header div and than just style it different
54
 
55
 
56
  == Changelog ==
 
 
 
 
57
  = 2.0.4 =
58
  * Added: Hide for large screens
59
  = 2.0.3 =
4
  Tags: sticky, menu, header, sticky menu, sticky header, floating, floating menu
5
  Requires at least: 3.5.1
6
  Tested up to: 4.9.3
7
+ Stable tag: 2.0.5
8
  License: GPLv2 or later
9
 
10
  This lightweight plugin will made your menu or header sticky on top of page, after desired number of pixels when scrolled.
54
 
55
 
56
  == Changelog ==
57
+ = 2.0.5 =
58
+ * Added: Admin settings sidebar right
59
+ * Added: Admin separated js script
60
+ * Added: Admin separated css script
61
  = 2.0.4 =
62
  * Added: Hide for large screens
63
  = 2.0.3 =