Plugin Directory

Changeset 1455710


Ignore:
Timestamp:
07/16/2016 12:13:03 PM (10 years ago)
Author:
getcopyfight
Message:

version 1.5.5

Location:
copyfight
Files:
66 added
4 edited

Legend:

Unmodified
Added
Removed
  • copyfight/trunk/class.copyfight-admin.php

    r1447113 r1455710  
    7474
    7575        add_action( 'admin_notices', array( COPYFIGHT_CLASS_ADMIN, 'copyfight_api_key_notice' ) );
     76        add_action( 'admin_notices', array( COPYFIGHT_CLASS_ADMIN, 'copyfight_activate_transient' ) );
    7677        add_action( 'admin_notices', array( COPYFIGHT_CLASS_ADMIN, 'copyfight_transient' ) );
    7778    }
     
    130131    }
    131132
     133    public static function copyfight_activate_transient() {
     134        $message = get_transient( 'copyfight_activate_transient' );
     135        delete_transient( 'copyfight_activate_transient' );
     136        $html = '';
     137        if ( $message ) {
     138            $html  = "<div class='error notice is-dismissible'><p>";
     139            $html .= "{$message}";
     140            $html .= "</p></div>";
     141        }
     142        echo $html;
     143    }
     144
    132145    public static function copyfight_transient() {
    133146        $post_id = get_transient( 'copyfight_transient' );
     
    167180            return $response->apikey;
    168181        } else {
     182            set_transient( 'copyfight_activate_transient', $response->error, 60 );
    169183            return '';
    170184        }
  • copyfight/trunk/class.copyfight.php

    r1447113 r1455710  
    3939        add_filter( 'the_content_feed', array( COPYFIGHT_CLASS, 'copyfight_the_content_feed' ) );
    4040        add_filter( 'the_excerpt_rss', array( COPYFIGHT_CLASS, 'copyfight_the_excerpt_rss' ) );
     41        add_filter( 'language_attributes', array( COPYFIGHT_CLASS, 'copyfight_language_attributes' ) );
    4142
    4243        add_shortcode( 'copyfight', array( COPYFIGHT_CLASS, 'copyfight_shortcode' ) );
     
    270271    }
    271272
     273    public static function copyfight_language_attributes( $content ) {
     274        global $post;
     275        $copyfight_content = get_post_meta( $post->ID, '_copyfight_content', true );
     276        $copyfight_status = get_post_meta( $post->ID, '_copyfight_status', true );
     277        if ( strlen( $copyfight_content ) && $copyfight_status == 'enabled' && is_singular() ) {
     278            $content = '';
     279        }
     280        return $content;
     281    }
     282
    272283    /**
    273284     * Copyfight shortcode
  • copyfight/trunk/copyfight.php

    r1447113 r1455710  
    44Plugin URI:         https://getcopyfight.com/
    55Description:        Copyright protection
    6 Version:            1.5.4
     6Version:            1.5.5
    77Author:             Copyfight
    88Author URI:         https://getcopyfight.com/
     
    3535add_action( 'plugins_loaded', 'copyfight_textdomain' );
    3636
    37 define( 'COPYFIGHT_VERSION', '1.5.4' );
     37define( 'COPYFIGHT_VERSION', '1.5.5' );
    3838define( 'COPYFIGHT_MINIMUM_WP_VERSION', '3.3.0' );
    3939define( 'COPYFIGHT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • copyfight/trunk/readme.txt

    r1447113 r1455710  
    77Requires at least:  3.3.0
    88Tested up to:       4.5.3
    9 Stable tag:         1.5.4
     9Stable tag:         1.5.5
    1010License:            GPLv2 or later
    1111License URI:        http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.