Plugin Directory

Changeset 372730


Ignore:
Timestamp:
04/14/2011 12:01:01 AM (15 years ago)
Author:
johnleblanc
Message:

added upgrade notice

Location:
docs-auto-tags/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • docs-auto-tags/trunk/docs-auto-tags.php

    r372721 r372730  
    5656    if ( intval($post->ID) > 0 ) {
    5757        $options = get_option( 'docs_autotags' );
    58         foreach ( $options as $pattern => $tags ) {
    59             if ( strpos($post->post_content, $pattern) )
    60                 wp_set_post_tags( $post->ID, $tags, TRUE ); // TRUE means append
     58        if ( count($options) > 0 ) {
     59            foreach ( $options as $pattern => $tags ) {
     60                if ( strpos($post->post_content, $pattern) )
     61                    wp_set_post_tags( $post->ID, $tags, TRUE ); // TRUE means append
     62            }
    6163        }
    6264    }
     
    6668// add options page
    6769function jpl_docs_autotags_options_page() {
    68     if ( !current_user_can( 'manage_options' ) ) {
     70    if ( !current_user_can('manage_options') ) {
    6971        // Doc might include profanity, but he can manage his own language file
    7072        wp_die( __('You do not have sufficient permissions to access this page.') );
     
    7375
    7476    <div class="wrap">
    75         <h2><?php _e("Doc's Autotags") ?></h2>
     77        <h2><?php _e("Doc's Auto-Tags") ?></h2>
    7678        <p><?php _e('Posts that include the (case-sensitive) string patterns defined below will be assigned the specified tag(s) when saved.') ?></p>
    7779        <form method="post" action="">
     
    8284            if ( isset($_POST['pattern']) ) {
    8385                $i = 0;
    84                 while ( $i <= count($_POST['pattern']) ) {
    85                     if ( strlen(trim($_POST['pattern'][$i])) > 0 && strlen(trim($_POST['tags'][$i])) > 0 )
     86                while ( $i <= count( $_POST['pattern'] ) ) {
     87                    if ( strlen( trim($_POST['pattern'][$i]) ) > 0 && strlen( trim($_POST['tags'][$i]) ) > 0 )
    8688                        $options[$_POST['pattern'][$i]] = $_POST['tags'][$i];
    8789                    $i++;
     
    9496
    9597            <?php $i=0; ?>
    96             <?php foreach ( $options as $pattern => $tags ) :?>
     98            <?php if ( count($options) > 0 ): ?>
     99            <?php foreach ( $options as $pattern => $tags ) : ?>
    97100                <div id="rule-<?php echo $i ?>">
    98101                    <p>
     
    104107                <?php $i++; ?>
    105108            <?php endforeach; ?>
     109            <?php endif; ?>
    106110
    107111            <div id="rule-new">
  • docs-auto-tags/trunk/readme.txt

    r372726 r372730  
    1515== Installation ==
    1616
    17 1. Install from the Plugins page within the dashboard. For those with too much free time, download from the [plugin page](http://wordpress.org/extend/plugins/docs-auto-tags/) or [subversion repository](http://plugins.svn.wordpress.org/docs-auto-tags/). Upload `docs-auto-tags` to your plugins directory (usually `/wp-content/plugins/` unless you've defined custom value for WP_PLUGINS_DIR).
     171. Install from the Plugins page within the Dashboard. For those with too much free time, download from the [plugin page](http://wordpress.org/extend/plugins/docs-auto-tags/) or [subversion repository](http://plugins.svn.wordpress.org/docs-auto-tags/) and upload `docs-auto-tags` to your plugins directory (usually `/wp-content/plugins/` unless you've defined custom value for WP_PLUGINS_DIR).
    18181. Activate the plugin through the 'Plugins' menu in WordPress
    19191. Configure your settings within the 'Tools' area in the Dashboard
Note: See TracChangeset for help on using the changeset viewer.