WordPress.org

Plugin Directory

Changeset 209498


Ignore:
Timestamp:
02/23/10 16:59:06 (4 years ago)
Author:
Latz
Message:

Fixed: Name collisions with other plugins (added 'pagebar_' to all global functions).

Location:
pagebar/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pagebar/trunk/pagebar2.php

    r186094 r209498  
    55Plugin URI: http://www.elektroelch.de/hacks/wp/pagebar 
    66Description: Adds an advanced page navigation to Wordpress. 
    7 Version: 2.56 
     7Version: 2.57 
    88Author: Lutz Schröer 
    99Author URI: http://elektroelch.de/blog 
     
    6666/* -------------------------------------------------------------------------- */ 
    6767 
    68 function registerStylesheet($url, $handle, $pluginurl = "") { 
     68function pagebar_registerStylesheet($url, $handle, $pluginurl = "") { 
    6969    wp_register_style($handle, $pluginurl . $url); 
    7070    wp_enqueue_style($handle); 
     
    7272} 
    7373/* -------------------------------------------------------------------------- */ 
    74 function addUserStylesheet() { 
     74function pagebar_addUserStylesheet() { 
    7575  global $pbOptions; 
    7676    if ($pbOptions["stylesheet"] != "styleCss") 
    77         registerStylesheet(get_bloginfo('stylesheet_directory') 
     77        pagebar_registerStylesheet(get_bloginfo('stylesheet_directory') 
    7878                                             . '/' . $pbOptions["cssFilename"], 
    7979                                             'pagebar-stylesheet'); 
     
    8585/* -------------------------------------------------------------------------- */ 
    8686/* add Settings link to plugin page                                           */ 
    87 function addConfigureLink( $links ) {  // add Settings link to plugin page 
     87function pagebar_addConfigureLink( $links ) {  // add Settings link to plugin page 
    8888  $settings_link = '<a href="options-general.php?page=pagebar_options.php">'. __('Settings').'</a>'; 
    8989  array_unshift( $links, $settings_link ); 
     
    9494// necessary. 
    9595 
    96 $min_php = '5.0.0'; 
    97 $min_wp  = '2.7'; 
    98  
    99 function plugin_prevent_upgrade($opt) { 
     96function pagebar_plugin_prevent_upgrade($opt) { 
    10097    global $wp_version, $min_wp, $min_php; 
     98        $min_php = '5.0.0'; 
     99        $min_wp  = '2.7'; 
    101100        if ( (version_compare(PHP_VERSION, $min_php, '<')) || (version_compare($wp_version, $min_wp, '<')) ) { 
    102101                $plugin = plugin_basename(__FILE__); 
     
    106105 
    107106                        //Now we've prevented the upgrade taking place, It might be worth to give users a note that theres an update available: 
    108                         add_action("after_plugin_row_$plugin", 'plugin_update_disabled_notice'); 
     107                        add_action("after_plugin_row_$plugin", 'pagebar_plugin_update_disabled_notice'); 
    109108                } //if 
    110109        } //if 
     
    112111}  //plugin_prevent_update() 
    113112/* -------------------------------------------------------------------------- */ 
    114 function plugin_update_disabled_notice() { 
     113function pagebar_plugin_update_disabled_notice() { 
    115114        global $wp_version, $min_wp, $min_php; 
    116115        echo '<tr><td class="plugin-update" colspan="5">'; 
     
    189188        //$pagebaroptions->pb_load_jquery(); 
    190189        $plugin = plugin_basename(__FILE__); 
    191         add_filter("plugin_action_links_$plugin", 'addConfigureLink' ); 
     190        add_filter("plugin_action_links_$plugin", 'pagebar_addConfigureLink' ); 
    192191        add_action('admin_init', 'register_pagebar_settings'); 
    193192} 
     
    195194// add filter to prevent updates if PHP<5 and Wp<2.7 
    196195if (in_array($pagenow, array("plugins.php"))) 
    197   add_filter('option_update_plugins', 'plugin_prevent_upgrade'); 
     196  add_filter('option_update_plugins', 'pagebar_plugin_prevent_upgrade'); 
    198197 
    199198// we need to load the postbar option outside the classes since the actions 
     
    206205// register_activation_hook( __FILE__, 'pagebar_activate' ); 
    207206 
    208 add_action ( 'wp_head', 'addUserStylesheet'); 
     207add_action ( 'wp_head', 'pagebar_addUserStylesheet'); 
    209208 
    210209if ($pbOptions ['auto'] && in_array($pagenow, array("index.php"))) { 
  • pagebar/trunk/readme.txt

    r186094 r209498  
    44Tags: navigation, navi, page, comments 
    55Requires at least: 2.7 
    6 Tested up to: 2.9 
     6Tested up to: 2.9.2 
    77Stable tag: trunk 
    88 
     
    196196+ Joern of diekretschmars.de for his various comments and ideas. 
    197197+ Marco of mafia-daily.com for pointing out problem with theme editor. 
     198+ Thomas (koehntopp.com) for his bug report on name collisions. 
    198199 
    199200== Changelog == 
     201 
     202= 2.57 = 
     203* Fixed: Name collisions with other plugins (added 'pagebar_' to all global functions). 
    200204 
    201205= 2.56 = 
Note: See TracChangeset for help on using the changeset viewer.