Plugin Directory

Changeset 1166454


Ignore:
Timestamp:
05/24/2015 12:09:01 AM (11 years ago)
Author:
anubisthejackle
Message:

Version bump to 4.0.0. Change more tag filtering so tag is added on page load not post save.

Location:
auto-more-tag
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • auto-more-tag/trunk/auto-more.php

    r773978 r1166454  
    33/*
    44  Plugin Name: Auto More Tag
    5   Plugin URI: https://github.com/toubsen/wp-auto-more-tag
     5  Plugin URI: https://github.com/anubisthejackle/wp-auto-more-tag
    66  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.
    77  Author: Travis Weston, Tobias Vogel
    88  Author URI: https://github.com/anubisthejackle
    9   Version: 3.2.2
     9  Version: 4.0.0
    1010 */
    1111
     
    3030
    3131        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
    3339            $options = get_option('tw_auto_more_tag');
    3440
     
    5258            switch ($options['units']) {
    5359                case 1:
    54                     return self::$_instance->byCharacter($data, $length, $breakOn);
     60                    $data = self::$_instance->byCharacter($data, $length, $breakOn);
    5561                    break;
    5662
    5763                case 2:
    5864                default:
    59                     return self::$_instance->byWord($data, $length, $breakOn);
     65                    $data = self::$_instance->byWord($data, $length, $breakOn);
    6066                    break;
    6167
    6268                case 3:
    63                     return self::$_instance->byPercent($data, $length, $breakOn);
     69                    $data = self::$_instance->byPercent($data, $length, $breakOn);
    6470                    break;
    6571            }
     72
     73            $pages[ $page - 1 ] = $data;
     74            return get_the_content();
     75
    6676        }
    6777
     
    234244
    235245        private function updateAll() {
    236 
     246            return;
    237247            $posts = get_posts(array(
    238248                'numberposts' => '-1',
     
    262272    add_action('admin_init', array($tw_auto_more_tag, 'initOptionsPage'));
    263273    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);
    265275    add_shortcode('amt_override', array($tw_auto_more_tag, 'manualOverride'));
    266276
  • auto-more-tag/trunk/readme.txt

    r773978 r1166454  
    33Tags: more, tag, content, development, travis, weston
    44Requires at least: 3.2.1
    5 Tested up to: 3.5.2
    6 Stable tag: 3.2.2
     5Tested up to: 4.2
     6Stable tag: 4.0.0
    77
    88Allows you to add a More tag to your post automatically upon publication.
     
    3737== Changelog ==
    3838
     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
    3942= 3.2.2 =
    4043* Integrated fix for repeated content on short posts
     
    4245= 3.2.1 =
    4346* Version bump in php files + readme for wordpress auto update
    44 
    4547= 3.2 =
    4648* Made the plugin multibyte aware / safe (UTF-8)
Note: See TracChangeset for help on using the changeset viewer.