Changeset 1312268
- Timestamp:
- 12/19/2015 10:12:48 AM (10 years ago)
- Location:
- watchman
- Files:
-
- 27 added
- 5 edited
-
tags/0.7 (added)
-
tags/0.7/.editorconfig (added)
-
tags/0.7/LICENSE (added)
-
tags/0.7/lib (added)
-
tags/0.7/lib/class-wm-autoload.php (added)
-
tags/0.7/readme.md (added)
-
tags/0.7/readme.txt (added)
-
tags/0.7/revision (added)
-
tags/0.7/revision/class-wm-revision.php (added)
-
tags/0.7/settings (added)
-
tags/0.7/settings/class-wm-admin.php (added)
-
tags/0.7/settings/class-wm-settings.php (added)
-
tags/0.7/tests (added)
-
tags/0.7/tests/bootstrap.php (added)
-
tags/0.7/tests/tests (added)
-
tags/0.7/tests/tests/test-watchman.php (added)
-
tags/0.7/tests/wm-test-case.php (added)
-
tags/0.7/ui (added)
-
tags/0.7/ui/css (added)
-
tags/0.7/ui/css/watchman-icons.css (added)
-
tags/0.7/ui/fonts (added)
-
tags/0.7/ui/fonts/watchman.eot (added)
-
tags/0.7/ui/fonts/watchman.svg (added)
-
tags/0.7/ui/fonts/watchman.ttf (added)
-
tags/0.7/ui/fonts/watchman.woff (added)
-
tags/0.7/watchman.php (added)
-
trunk/readme.md (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/revision/class-wm-revision.php (modified) (2 diffs)
-
trunk/settings/class-wm-admin.php (added)
-
trunk/settings/class-wm-settings.php (modified) (3 diffs)
-
trunk/watchman.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
watchman/trunk/readme.md
r1312071 r1312268 5 5 6 6 **Contributors:** [desaiuditd](https://profiles.wordpress.org/desaiuditd) 7 **Tags:** [revision s](https://wordpress.org/plugins/tags/revisions), [post](https://wordpress.org/plugins/tags/post), [page](https://wordpress.org/plugins/tags/page), [custom post types](https://wordpress.org/plugins/tags/custom post types), [WordPress](https://wordpress.org/plugins/tags/WordPress), [history](https://wordpress.org/plugins/tags/history)7 **Tags:** [revision](https://wordpress.org/plugins/tags/revision), [revisions](https://wordpress.org/plugins/tags/revisions), [post](https://wordpress.org/plugins/tags/post), [posts](https://wordpress.org/plugins/tags/posts), [page](https://wordpress.org/plugins/tags/page), [pages](https://wordpress.org/plugins/tags/pages), [custom post types](https://wordpress.org/plugins/tags/custom post types), [custom post type](https://wordpress.org/plugins/tags/custom post type), [WordPress](https://wordpress.org/plugins/tags/WordPress), [history](https://wordpress.org/plugins/tags/history), [track](https://wordpress.org/plugins/tags/track), [track post](https://wordpress.org/plugins/tags/track post), [track posts](https://wordpress.org/plugins/tags/track posts), [edit flow](https://wordpress.org/plugins/tags/edit flow) 8 8 **Requires at least:** 3.6 9 9 **Tested up to:** 4.4 … … 66 66 67 67 Please visit [Watchman's Roadmap page](http://blog.incognitech.in/watchman/roadmap/ "Visit Watchman's Features page") to get some details about future releases. 68 ### 0.7 ### 69 * Fixes #12 - Revision Limit for Individual Posts 70 * Fixes #14 - User can stop saving revisions for post type with number 0 71 68 72 ### 0.6 December 18, 2015 ### 69 73 * Fixes #6 - Track Post Status 70 74 * Fixes #7 - Track Post Date 71 * Fixes #13 - Stops unnec cessary revisions getting created75 * Fixes #13 - Stops unnecessary revisions getting created 72 76 * Adds Settings link in Plugin Row Action 73 77 * Fixes few Translation Strings -
watchman/trunk/readme.txt
r1312071 r1312268 2 2 Contributors: desaiuditd 3 3 Donate Link: Paypal ID : [email protected] 4 Tags: revision s, post, page, custom post types, WordPress, history4 Tags: revision, revisions, post, posts, page, pages, custom post types, custom post type, WordPress, history, track, track post, track posts, edit flow 5 5 Requires at least: 3.6 6 6 Tested up to: 4.4 … … 72 72 Please visit [Watchman's Roadmap page](http://blog.incognitech.in/watchman/roadmap/ "Visit Watchman's Features page") to get some details about future releases. 73 73 74 = 0.7 = 75 * Fixes #12 - Revision Limit for Individual Posts 76 * Fixes #14 - User can stop saving revisions for post type with number 0 77 74 78 = 0.6 December 18, 2015 = 75 79 * Fixes #6 - Track Post Status 76 80 * Fixes #7 - Track Post Date 77 * Fixes #13 - Stops unnec cessary revisions getting created81 * Fixes #13 - Stops unnecessary revisions getting created 78 82 * Adds Settings link in Plugin Row Action 79 83 * Fixes few Translation Strings -
watchman/trunk/revision/class-wm-revision.php
r1312071 r1312268 29 29 30 30 /** 31 * This hook filters the number of revisions to keep for a specific post. 32 */ 33 add_filter( 'wp_revisions_to_keep', array( $this, 'filter_revisions_to_keep' ), 999, 2 ); 34 35 /** 31 36 * This hooks gets fired once a revision is stored in WP_Post table in DB. 32 37 * … … 58 63 */ 59 64 add_filter( 'wp_get_revision_ui_diff', array( $this, 'revision_ui_diff' ), 10, 3 ); 65 } 66 67 /** 68 * @param $num 69 * @param $post 70 * 71 * @return int 72 * @since 0.1 73 */ 74 function filter_revisions_to_keep( $num, $post ) { 75 76 // Check individual Post Limit 77 $revision_limit = get_post_meta( $post->ID, WM_Admin::$wm_revision_limit_meta_key, true ); 78 79 if ( '' !== $revision_limit ) { 80 81 if ( ! is_numeric( $revision_limit ) ) { 82 $num = - 1; 83 } else { 84 $num = intval( $revision_limit ); 85 } 86 } else { 87 88 $post_type = get_post_type( $post ); 89 90 $revision_limit = get_option( WM_Settings::$revision_limit_key . $post_type, false ); 91 92 if ( '' === $revision_limit || ! is_numeric( $revision_limit ) ) { 93 $num = - 1; 94 } else { 95 $num = intval( $revision_limit ); 96 } 97 } 98 99 return $num; 60 100 } 61 101 -
watchman/trunk/settings/class-wm-settings.php
r1312071 r1312268 27 27 add_action( 'admin_notices', array( $this, 'display_admin_notices' ) ); 28 28 29 add_filter( 'wp_revisions_to_keep', array( $this, 'filter_revisions_to_keep' ), 999, 2 );30 31 29 add_filter( 'plugin_action_links_' . WM_BASE_PATH, array( $this, 'plugin_actions' ), 10, 4 ); 32 30 } … … 37 35 38 36 return $actions; 39 }40 41 function filter_revisions_to_keep( $num, $post ) {42 43 $post_type = get_post_type( $post );44 45 $revision = get_option( self::$revision_limit_key . $post_type, false );46 47 if ( empty( $revision ) || ! is_numeric( $revision ) ) {48 $num = -1;49 } else {50 $num = intval( $revision );51 }52 53 return $num;54 37 } 55 38 … … 152 135 if ( ! empty( $value ) && ! is_numeric( $value ) ) { 153 136 add_settings_error( $option, 'watchman_errors', sprintf( __( 'You need to fill numeric value for %s revision limit.', WM_TEXT_DOMAIN ), '<strong>' . $labels->name . '</strong>' ) ); 154 } else {137 } else if ( '' !== $value ) { 155 138 $value = absint( $value ); 156 139 } -
watchman/trunk/watchman.php
r1312071 r1312268 4 4 * Plugin URI: http://blog.incognitech.in/watchman 5 5 * Description: A WordPress plugin to track revisions of your posts, pages and custom posts 6 * Version: 0. 66 * Version: 0.7 7 7 * Author: desaiuditd 8 8 * Author URI: http://blog.incognitech.in … … 86 86 // Defines WM_VERSION if it does not exits. 87 87 if ( ! defined( 'WM_VERSION' ) ) { 88 define( 'WM_VERSION', '0. 6' );88 define( 'WM_VERSION', '0.7' ); 89 89 } 90 90 … … 123 123 124 124 new WM_Settings(); 125 new WM_Admin(); 125 126 new WM_Revision(); 126 127 }
Note: See TracChangeset
for help on using the changeset viewer.