Editorial Calendar - Version 3.1

Version Description

The calendar now adds the category slugs for each post as a class for the line of that post in the calendar.

The calendar has a new option called edcal_custom_posts_public to control if the calendar shows for private custom posts or not.

Download this release

Release Info

Developer zgrossbart
Plugin Icon wp plugin Editorial Calendar
Version 3.1
Comparing to
See all releases

Code changes from version 3.0 to 3.1

Files changed (4) hide show
  1. edcal.js +1 -1
  2. edcal.min.js +1 -1
  3. edcal.php +10 -4
  4. readme.txt +9 -3
edcal.js CHANGED
@@ -1644,7 +1644,7 @@ var edcal = {
1644
  if (edcal.isPostMovable(post)) {
1645
  return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
1646
  'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
1647
- 'id="post-' + post.id + '" class="post ' + post.status + ' ' + edcal.getPostEditableClass(post) + '"><div class="postlink ' + classString + '">' +
1648
  '<span>' + posttitle + '</span>' +
1649
  '</div>' +
1650
  '<div class="postactions">' +
1644
  if (edcal.isPostMovable(post)) {
1645
  return '<li onmouseover="edcal.showActionLinks(\'post-' + post.id + '\');" ' +
1646
  'onmouseout="edcal.hideActionLinks(\'post-' + post.id + '\');" ' +
1647
+ 'id="post-' + post.id + '" class="post ' + post.status + ' ' + edcal.getPostEditableClass(post) + post.slugs + '"><div class="postlink ' + classString + '">' +
1648
  '<span>' + posttitle + '</span>' +
1649
  '</div>' +
1650
  '<div class="postactions">' +
edcal.min.js CHANGED
@@ -35,7 +35,7 @@ edcal.posts[a];if(50>c.length)for(a=0;a<c.length;a++)c[a]&&(b+=edcal.getPostItem
35
  a);if(!edcal.inDrag&&edcal.isPostEditable(b)){var c=jQuery("#"+a+" > div.postactions");edcal.actionLinksElem&&edcal.actionLinksElem.get(0)!==c.get(0)&&edcal.actionLinksElem.slideUp();edcal.actionLinksElem=c;edcal.actionTimer=setTimeout(function(){c.slideDown();if(c.parent().position().top+c.parent().height()>c.parent().parent().height()){var b=jQuery("#"+a+" > div.postactions").parent().parent();b.scrollTop(b.scrollTop()+45)}},250)}},hideActionLinks:function(a){edcal.actionTimer&&clearTimeout(edcal.actionTimer);
36
  edcal.actionTimer=setTimeout(function(){jQuery("#"+a+" > div.postactions").slideUp();edcal.actionLinksElem=null},1E3)},isPostMovable:function(a){return a.editlink&&"publish"!==a.status},isPostEditable:function(a){return a.editlink},getPostEditableClass:function(a){return a.editlink?"":"readonly"},getPostItemString:function(a){var b=a.title;""===b&&(b="[No Title]");edcal.statusPref&&("draft"===a.status&&"1"===a.sticky?b+=edcal.str_draft_sticky:"pending"===a.status&&"1"===a.sticky?b+=edcal.str_pending_sticky:
37
  "1"===a.sticky?b+=edcal.str_sticky:"pending"===a.status?b+=edcal.str_pending:"draft"===a.status?b+=edcal.str_draft:"publish"!==a.status&&("future"!==a.status&&"pending"!==a.status)&&(b+=" ["+a.status+"]"));edcal.timePref&&(b='<span class="posttime">'+a.formattedtime+"</span> "+b);edcal.authorPref&&(b=sprintf(edcal.str_by,b,'<span class="postauthor">'+a.author+"</span>"));return edcal.isPostMovable(a)?"<li onmouseover=\"edcal.showActionLinks('post-"+a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+
38
- a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_edit+'</a> | <a href="#" onclick="edcal.editPost('+a.id+'); return false;">'+edcal.str_quick_edit+'</a> | <a href="'+a.dellink+'" onclick="return edcal.confirmDelete(\''+a.title+"');\">"+edcal.str_del+'</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>":"<li onmouseover=\"edcal.showActionLinks('post-"+
39
  a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_republish+'</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>"},setClassforToday:function(){jQuery("#"+Date.today().toString(edcal.internalDateFormat)).addClass("today")},getCalHeight:function(){var a=jQuery(window).height()-jQuery("#footer").height()-
40
  jQuery("#wphead").height()-150;return Math.max(a,500)},move:function(a,b,c){if(!jQuery("#edcal_quickedit").is(":visible")){edcal.currentDirection!==b&&(edcal._wDate=b?edcal._wDate.add(7*(edcal.weeksPref+7)).days():edcal._wDate.add(-(7*(edcal.weeksPref+7))).days(),edcal.steps=0,edcal.moveDate=edcal._wDate);edcal.currentDirection=b;var d;if(b)for(d=0;d<a;d++)jQuery("#cal > div:first").remove(),edcal.createRow(jQuery("#cal"),!0),edcal._wDate.add(7).days();else for(d=0;d<a;d++)jQuery("#cal > div:last").remove(),
41
  edcal.createRow(jQuery("#cal"),!1),edcal._wDate.add(-7).days();edcal.alignCal();edcal.setClassforToday();edcal.setDateLabel();edcal.steps+=a;edcal.tID?clearTimeout(edcal.tID):edcal.moveDate=edcal._wDate;edcal.tID=setTimeout(function(){b?edcal.getPosts(edcal._wDate.clone().add(-7*(edcal.steps+1)).days(),edcal._wDate.clone(),c):edcal.getPosts(edcal._wDate.clone(),edcal._wDate.clone().add(7*(edcal.steps+1)).days(),c);edcal.steps=0;edcal.tID=null;edcal.moveDate=edcal._wDate},1E3);b?jQuery.cookie("edcal_date",
35
  a);if(!edcal.inDrag&&edcal.isPostEditable(b)){var c=jQuery("#"+a+" > div.postactions");edcal.actionLinksElem&&edcal.actionLinksElem.get(0)!==c.get(0)&&edcal.actionLinksElem.slideUp();edcal.actionLinksElem=c;edcal.actionTimer=setTimeout(function(){c.slideDown();if(c.parent().position().top+c.parent().height()>c.parent().parent().height()){var b=jQuery("#"+a+" > div.postactions").parent().parent();b.scrollTop(b.scrollTop()+45)}},250)}},hideActionLinks:function(a){edcal.actionTimer&&clearTimeout(edcal.actionTimer);
36
  edcal.actionTimer=setTimeout(function(){jQuery("#"+a+" > div.postactions").slideUp();edcal.actionLinksElem=null},1E3)},isPostMovable:function(a){return a.editlink&&"publish"!==a.status},isPostEditable:function(a){return a.editlink},getPostEditableClass:function(a){return a.editlink?"":"readonly"},getPostItemString:function(a){var b=a.title;""===b&&(b="[No Title]");edcal.statusPref&&("draft"===a.status&&"1"===a.sticky?b+=edcal.str_draft_sticky:"pending"===a.status&&"1"===a.sticky?b+=edcal.str_pending_sticky:
37
  "1"===a.sticky?b+=edcal.str_sticky:"pending"===a.status?b+=edcal.str_pending:"draft"===a.status?b+=edcal.str_draft:"publish"!==a.status&&("future"!==a.status&&"pending"!==a.status)&&(b+=" ["+a.status+"]"));edcal.timePref&&(b='<span class="posttime">'+a.formattedtime+"</span> "+b);edcal.authorPref&&(b=sprintf(edcal.str_by,b,'<span class="postauthor">'+a.author+"</span>"));return edcal.isPostMovable(a)?"<li onmouseover=\"edcal.showActionLinks('post-"+a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+
38
+ a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+a.slugs+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_edit+'</a> | <a href="#" onclick="edcal.editPost('+a.id+'); return false;">'+edcal.str_quick_edit+'</a> | <a href="'+a.dellink+'" onclick="return edcal.confirmDelete(\''+a.title+"');\">"+edcal.str_del+'</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>":"<li onmouseover=\"edcal.showActionLinks('post-"+
39
  a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_republish+'</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>"},setClassforToday:function(){jQuery("#"+Date.today().toString(edcal.internalDateFormat)).addClass("today")},getCalHeight:function(){var a=jQuery(window).height()-jQuery("#footer").height()-
40
  jQuery("#wphead").height()-150;return Math.max(a,500)},move:function(a,b,c){if(!jQuery("#edcal_quickedit").is(":visible")){edcal.currentDirection!==b&&(edcal._wDate=b?edcal._wDate.add(7*(edcal.weeksPref+7)).days():edcal._wDate.add(-(7*(edcal.weeksPref+7))).days(),edcal.steps=0,edcal.moveDate=edcal._wDate);edcal.currentDirection=b;var d;if(b)for(d=0;d<a;d++)jQuery("#cal > div:first").remove(),edcal.createRow(jQuery("#cal"),!0),edcal._wDate.add(7).days();else for(d=0;d<a;d++)jQuery("#cal > div:last").remove(),
41
  edcal.createRow(jQuery("#cal"),!1),edcal._wDate.add(-7).days();edcal.alignCal();edcal.setClassforToday();edcal.setDateLabel();edcal.steps+=a;edcal.tID?clearTimeout(edcal.tID):edcal.moveDate=edcal._wDate;edcal.tID=setTimeout(function(){b?edcal.getPosts(edcal._wDate.clone().add(-7*(edcal.steps+1)).days(),edcal._wDate.clone(),c):edcal.getPosts(edcal._wDate.clone(),edcal._wDate.clone().add(7*(edcal.steps+1)).days(),c);edcal.steps=0;edcal.tID=null;edcal.moveDate=edcal._wDate},1E3);b?jQuery.cookie("edcal_date",
edcal.php CHANGED
@@ -18,7 +18,7 @@
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
  Description: The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
21
- Version: 3.0
22
  Author: Colin Vernon, Justin Evans, Joachim Kudish, Mary Vogt, and Zack Grossbart
23
  Author URI: http://www.zackgrossbart.com
24
  Plugin URI: http://stresslimitdesign.com/editorial-calendar-plugin
@@ -73,7 +73,7 @@ class EdCal {
73
  * This is the default time that posts get created at, for now
74
  * we are using 10am, but this could become an option later.
75
  */
76
- $this->default_time = get_option("edcal_default_time") != "" ? get_option("edcal_default_time") : '10:00';
77
 
78
  /*
79
  * We use these variables to hold the post dates for the filter when
@@ -96,7 +96,8 @@ class EdCal {
96
  $page = add_posts_page( __('Calendar', 'editorial-calendar'), __('Calendar', 'editorial-calendar'), 'edit_posts', 'cal', array(&$this, 'edcal_list_admin'));
97
  add_action( "admin_print_scripts-$page", array(&$this, 'edcal_scripts'));
98
 
99
- if( $this->supports_custom_types ) {
 
100
 
101
  /*
102
  * We add one calendar for Posts and then we add a separate calendar for each
@@ -107,7 +108,7 @@ class EdCal {
107
  * type and update the labels for each post type.
108
  */
109
  $args = array(
110
- 'public' => true,
111
  '_builtin' => false
112
  );
113
  $output = 'names'; // names or objects
@@ -804,6 +805,10 @@ class EdCal {
804
  $post_date_gmt = '00000000';
805
  }
806
 
 
 
 
 
807
 
808
  ?>
809
  {
@@ -819,6 +824,7 @@ class EdCal {
819
  "author" : <?php echo $this->edcal_json_encode(get_the_author()) ?>,
820
  "type" : "<?php echo get_post_type( $post ) ?>",
821
  "typeTitle" : "<?php echo $postTypeTitle ?>",
 
822
 
823
  <?php if ( current_user_can('edit_post', $post->ID) ) {?>
824
  "editlink" : "<?php echo get_edit_post_link($post->ID) ?>",
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
  Description: The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
21
+ Version: 3.1
22
  Author: Colin Vernon, Justin Evans, Joachim Kudish, Mary Vogt, and Zack Grossbart
23
  Author URI: http://www.zackgrossbart.com
24
  Plugin URI: http://stresslimitdesign.com/editorial-calendar-plugin
73
  * This is the default time that posts get created at, for now
74
  * we are using 10am, but this could become an option later.
75
  */
76
+ $this->default_time = get_option("edcal_default_time") != "" ? get_option("edcal_default_time") : '10:00';
77
 
78
  /*
79
  * We use these variables to hold the post dates for the filter when
96
  $page = add_posts_page( __('Calendar', 'editorial-calendar'), __('Calendar', 'editorial-calendar'), 'edit_posts', 'cal', array(&$this, 'edcal_list_admin'));
97
  add_action( "admin_print_scripts-$page", array(&$this, 'edcal_scripts'));
98
 
99
+ if ($this->supports_custom_types) {
100
+
101
 
102
  /*
103
  * We add one calendar for Posts and then we add a separate calendar for each
108
  * type and update the labels for each post type.
109
  */
110
  $args = array(
111
+ 'public' => get_option("edcal_custom_posts_public") != "" ? get_option("edcal_custom_posts_public") : true,
112
  '_builtin' => false
113
  );
114
  $output = 'names'; // names or objects
805
  $post_date_gmt = '00000000';
806
  }
807
 
808
+ $slugs = '';
809
+ foreach(get_the_category() as $category) {
810
+ $slugs .= $category->slug . ' ';
811
+ }
812
 
813
  ?>
814
  {
824
  "author" : <?php echo $this->edcal_json_encode(get_the_author()) ?>,
825
  "type" : "<?php echo get_post_type( $post ) ?>",
826
  "typeTitle" : "<?php echo $postTypeTitle ?>",
827
+ "slugs" : <?php echo $this->edcal_json_encode($slugs) ?>,
828
 
829
  <?php if ( current_user_can('edit_post', $post->ID) ) {?>
830
  "editlink" : "<?php echo get_edit_post_link($post->ID) ?>",
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Editorial Calendar ===
2
  Contributors: cvernon, justinstresslimit, jkudish, MaryVogt, zgrossbart
3
  Tags: posts, post, calendar, AJAX, admin, administration
4
- Requires at least: 2.8.5
5
- Tested up to: 3.8
6
- Stable tag: 3.0
7
 
8
  The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
9
 
@@ -173,6 +173,12 @@ Moving published posts can cause problems with some RSS feeds and is generally n
173
 
174
  == Changelog ==
175
 
 
 
 
 
 
 
176
  = 3.0 =
177
 
178
  This version makes a few small bug fixes to work well with WordPress 3.8. This includes showing the screen options with some better formatting and deleting posts from the drafts drawer properly.
1
  === Editorial Calendar ===
2
  Contributors: cvernon, justinstresslimit, jkudish, MaryVogt, zgrossbart
3
  Tags: posts, post, calendar, AJAX, admin, administration
4
+ Requires at least: 3.0
5
+ Tested up to: 3.8.1
6
+ Stable tag: 3.1
7
 
8
  The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
9
 
173
 
174
  == Changelog ==
175
 
176
+ = 3.1 =
177
+
178
+ The calendar now adds the category slugs for each post as a class for the line of that post in the calendar.
179
+
180
+ The calendar has a new option called edcal_custom_posts_public to control if the calendar shows for private custom posts or not.
181
+
182
  = 3.0 =
183
 
184
  This version makes a few small bug fixes to work well with WordPress 3.8. This includes showing the screen options with some better formatting and deleting posts from the drafts drawer properly.