Plugin Directory

Changeset 535009


Ignore:
Timestamp:
04/23/2012 09:53:54 AM (14 years ago)
Author:
maxemil
Message:
 
Location:
re-wp-short-theme-descriptions/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • re-wp-short-theme-descriptions/trunk/re-wp-themes-short-descriptions.php

    r510062 r535009  
    33Plugin Name: wp themes short descriptions
    44Plugin URI: http://oneconsult.dk/wordpress
    5 Description: Makes theme desctiptions short (like excerpt), mouseover theme to see full descriptions.
    6 Version: 1.1
    7 Author: Emil Vang Arffmann
     5Description: For WP 3.3 and less, this is no longer needed for WP > 3.4... Makes theme desctiptions short (like excerpt), mouseover theme to see full descriptions.
     6Version: 1.2
     7Author: maxemil
    88Author URI: http://oneconsult.dk
    99*/
     
    1717    wp_enqueue_script( 'rewptsd', plugins_url('rewptsd.js', __FILE__), array( 'jquery' ), '1.0', true);
    1818
    19     $myStyleUrl = plugins_url('rewptsd.css', __FILE__);
    20     $myStyleFile = WP_PLUGIN_DIR . '/re-wp-themes-short-descriptions/rewptsd.css';
    21     if ( file_exists($myStyleFile) )
     19    $rewptsdStyleUrl = plugins_url('rewptsd.css', __FILE__);
     20    $rewptsdStyleFile = WP_PLUGIN_DIR . '/re-wp-themes-short-descriptions/rewptsd.css';
     21    if ( file_exists($rewptsdStyleFile) )
    2222    {
    23       wp_register_style('rewptsd', $myStyleUrl);
     23      wp_register_style('rewptsd', $rewptsdStyleUrl);
    2424      wp_enqueue_style( 'rewptsd');
    2525    }
    2626  }
    2727}
     28
     29// 1.2 - detect WP version, if 3.4 or better, autodisable plugin.
     30add_action( 'admin_init', 'rewptsd_deactivate_plugin_conditional' );
     31function rewptsd_deactivate_plugin_conditional()
     32{
     33  global $wp_version;
     34  $thiswpver = substr($wp_version, 0, 3); // substring because BETA versions have version format like "3.4-beta3"
     35  if ( version_compare( $thiswpver, '3.5', '>=' ) )
     36  {
     37    if ( is_plugin_active( 're-wp-themes-short-descriptions/re-wp-themes-short-descriptions.php') )
     38    {
     39      deactivate_plugins( 're-wp-themes-short-descriptions/re-wp-themes-short-descriptions.php' );
     40    }
     41  }
     42}
     43
     44
     45// remove option to activate plugin on 3.4+
     46register_activation_hook( __file__, 'rewptsd_register_activation_hook' );
     47function rewptsd_register_activation_hook()
     48{
     49  global $wp_version;
     50  $thiswpver = substr($wp_version, 0, 3); // substring because BETA versions have version format like "3.4-beta3"
     51  if ( version_compare( $thiswpver, '3.5', '>=' ) )
     52  {
     53    echo '<br/>is activating.. and version is too high<br/>';
     54    deactivate_plugins(basename(__FILE__)); // Deactivate ourself
     55    wp_die("This Plugin is depricated for WP version less than 3.4!");
     56  }
     57}
     58
    2859?>
  • re-wp-short-theme-descriptions/trunk/readme.txt

    r510070 r535009  
    1 === re wp themes short descriptions ===
    2 Contributors: Emil Vang Arffmann
    3 Donate link: http://recreative.dk
    4 Tags: theme desciption, short theme description,
     1=== wp themes short descriptions ===
     2Contributors: maxemil
     3Donate link: http://oneconsult.dk
     4Tags: theme desciption, short theme description, theme overview, depricated
    55Requires at least: 2.8
    66Tested up to: 3.3
     
    88
    99Shortens the theme descriptions in the theme overview of your wordpress installation.
    10 Mouse over to expand all descriptions again.
     10Mouse over to expand all descriptions again. For WP 3.3 and less. not for 3.4+
    1111
    1212== Description ==
     
    1616Install this plugin to make the theme descriptions short.
    1717You can simpy disable the plugin if you at some point want to read all the info again.
     18
     19Since WP 3.4 the developers have reorganized the theme overview screen, rendering this plugin depricated.
     20Only install if you still run 3.3 or below, and dislike long theme descriptions :)
    1821
    1922
     
    3942
    4043* Added jquery effect on mouseover to show full description.
     44
     451.2
     46
     47* Auto disables plugin if you use WP 3.4, no longer needed - thank you WP devs :)
Note: See TracChangeset for help on using the changeset viewer.