Changeset 1166454
- Timestamp:
- 05/24/2015 12:09:01 AM (11 years ago)
- Location:
- auto-more-tag
- Files:
-
- 5 added
- 2 edited
-
tags/4.0.0 (added)
-
tags/4.0.0/auto-more-options-page.php (added)
-
tags/4.0.0/auto-more.php (added)
-
tags/4.0.0/readme.txt (added)
-
tags/4.0.0/screenshot-1.png (added)
-
trunk/auto-more.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
auto-more-tag/trunk/auto-more.php
r773978 r1166454 3 3 /* 4 4 Plugin Name: Auto More Tag 5 Plugin URI: https://github.com/ toubsen/wp-auto-more-tag5 Plugin URI: https://github.com/anubisthejackle/wp-auto-more-tag 6 6 Description: Automatically add a More tag to your posts upon publication. No longer are you required to spend your time figuring out the perfect position for the more tag, you can now set a rule and this plugin will--to the best of it's abilities--add a proper more tag at or at the nearest non-destructive location. 7 7 Author: Travis Weston, Tobias Vogel 8 8 Author URI: https://github.com/anubisthejackle 9 Version: 3.2.29 Version: 4.0.0 10 10 */ 11 11 … … 30 30 31 31 public static function addTag($data, $arr = array()) { 32 global $post; 32 global $post, $pages, $page; 33 34 if( $page > count( $pages ) ) 35 $page = count( $pages ); 36 37 $data = $pages[ $page - 1 ]; 38 33 39 $options = get_option('tw_auto_more_tag'); 34 40 … … 52 58 switch ($options['units']) { 53 59 case 1: 54 returnself::$_instance->byCharacter($data, $length, $breakOn);60 $data = self::$_instance->byCharacter($data, $length, $breakOn); 55 61 break; 56 62 57 63 case 2: 58 64 default: 59 returnself::$_instance->byWord($data, $length, $breakOn);65 $data = self::$_instance->byWord($data, $length, $breakOn); 60 66 break; 61 67 62 68 case 3: 63 returnself::$_instance->byPercent($data, $length, $breakOn);69 $data = self::$_instance->byPercent($data, $length, $breakOn); 64 70 break; 65 71 } 72 73 $pages[ $page - 1 ] = $data; 74 return get_the_content(); 75 66 76 } 67 77 … … 234 244 235 245 private function updateAll() { 236 246 return; 237 247 $posts = get_posts(array( 238 248 'numberposts' => '-1', … … 262 272 add_action('admin_init', array($tw_auto_more_tag, 'initOptionsPage')); 263 273 add_action('admin_menu', array($tw_auto_more_tag, 'addPage')); 264 add_filter(' content_save_pre', 'tw_auto_more_tag::addTag', '1', 2);274 add_filter('the_content', 'tw_auto_more_tag::addTag', '-1', 2); 265 275 add_shortcode('amt_override', array($tw_auto_more_tag, 'manualOverride')); 266 276 -
auto-more-tag/trunk/readme.txt
r773978 r1166454 3 3 Tags: more, tag, content, development, travis, weston 4 4 Requires at least: 3.2.1 5 Tested up to: 3.5.26 Stable tag: 3.2.25 Tested up to: 4.2 6 Stable tag: 4.0.0 7 7 8 8 Allows you to add a More tag to your post automatically upon publication. … … 37 37 == Changelog == 38 38 39 = 4.0.0 = 40 * Alters the way the tag is added. Instead of saving the tag into the content at post save, the more tag is now added on page load. 41 39 42 = 3.2.2 = 40 43 * Integrated fix for repeated content on short posts … … 42 45 = 3.2.1 = 43 46 * Version bump in php files + readme for wordpress auto update 44 45 47 = 3.2 = 46 48 * Made the plugin multibyte aware / safe (UTF-8)
Note: See TracChangeset
for help on using the changeset viewer.