Ticket #6341: 6341.r9125.diff
File 6341.r9125.diff, 4.7 KB (added by , 16 years ago) |
---|
-
plugin.php
16 16 * 17 17 * @package WordPress 18 18 * @subpackage Plugin 19 * @since 1.5 19 * @since 1.5.0 20 20 */ 21 21 22 22 /** … … 76 76 * 77 77 * @package WordPress 78 78 * @subpackage Plugin 79 * @since 2.5 79 * @since 2.5.0 80 80 * @global array $wp_filter Stores all of the filters 81 81 * 82 82 * @param string $tag The name of the filter hook. … … 186 186 * 187 187 * @package WordPress 188 188 * @subpackage Plugin 189 * @since 1.2 189 * @since 1.2.0 190 190 * 191 191 * @param string $tag The filter hook to which the function to be removed is hooked. 192 192 * @param callback $function_to_remove The name of the function which should be removed. … … 212 212 /** 213 213 * Remove all of the hooks from a filter. 214 214 * 215 * @since 2.7 215 * @since 2.7.0 216 216 * 217 217 * @param string $tag The filter to remove hooks from. 218 218 * @param int $priority The priority number to remove. … … 239 239 * 240 240 * @package WordPress 241 241 * @subpackage Plugin 242 * @since 2.5 242 * @since 2.5.0 243 243 * 244 244 * @return string Hook name of the current filter or action. 245 245 */ … … 261 261 * 262 262 * @package WordPress 263 263 * @subpackage Plugin 264 * @since 1.2 264 * @since 1.2.0 265 265 * 266 266 * @param string $tag The name of the action to which the $function_to_add is hooked. 267 267 * @param callback $function_to_add The name of the function you wish to be called. … … 288 288 * 289 289 * @package WordPress 290 290 * @subpackage Plugin 291 * @since 1.2 291 * @since 1.2.0 292 292 * @global array $wp_filter Stores all of the filters 293 293 * @global array $wp_actions Increments the amount of times action was triggered. 294 294 * … … 348 348 * 349 349 * @package WordPress 350 350 * @subpackage Plugin 351 * @since 2.1 351 * @since 2.1.0 352 352 * @global array $wp_actions Increments the amount of times action was triggered. 353 353 * 354 354 * @param string $tag The name of the action hook. … … 371 371 * 372 372 * @package WordPress 373 373 * @subpackage Plugin 374 * @since 2.1 374 * @since 2.1.0 375 375 * @global array $wp_filter Stores all of the filters 376 376 * @global array $wp_actions Increments the amount of times action was triggered. 377 377 * … … 423 423 * 424 424 * @package WordPress 425 425 * @subpackage Plugin 426 * @since 2.5 426 * @since 2.5.0 427 427 * @see has_filter() has_action() is an alias of has_filter(). 428 428 * 429 429 * @param string $tag The name of the action hook. … … 443 443 * 444 444 * @package WordPress 445 445 * @subpackage Plugin 446 * @since 1.2 446 * @since 1.2.0 447 447 * 448 448 * @param string $tag The action hook to which the function to be removed is hooked. 449 449 * @param callback $function_to_remove The name of the function which should be removed. … … 458 458 /** 459 459 * Remove all of the hooks from an action. 460 460 * 461 * @since 2.7 461 * @since 2.7.0 462 462 * 463 463 * @param string $tag The action to remove hooks from. 464 464 * @param int $priority The priority number to remove them from. … … 479 479 * 480 480 * @package WordPress 481 481 * @subpackage Plugin 482 * @since 1.5 483 * 482 * @since 1.5.0 483 * @uses WP_PLUGIN_DIR 484 484 * @access private 485 485 * 486 * @param string $file The filename ofplugin.486 * @param string $file The path to plugin. 487 487 * @return string The name of a plugin. 488 * @uses WP_PLUGIN_DIR489 488 */ 490 489 function plugin_basename($file) { 491 490 $file = str_replace('\\','/',$file); // sanitize for Win32 installs … … 497 496 } 498 497 499 498 /** 499 * Retrieve the plugin base URL directory. 500 * 501 * The path has the trailing slash, so it doesn't need to be added. 502 * 503 * @link http://trac.wordpress.org/ticket/6341 Reason for function. 504 * @since 2.7.0 505 * @uses plugin_basename() 506 * 507 * @param string $file The path to plugin. 508 * @return string Full URL path, including domain, to plugin base directory. 509 */ 510 function plugin_baseurl($file) { 511 $file = dirname($file); 512 $file = plugin_basename($file); 513 514 if ( empty( $file ) ) 515 return trailingslashit(WP_PLUGIN_URL); 516 517 return WP_PLUGIN_URL . '/'. trailingslashit($file); 518 } 519 520 /** 500 521 * Set the activation hook for a plugin. 501 522 * 502 523 * When a plugin is activated, the action 'activate_PLUGINNAME' hook is … … 510 531 * 511 532 * @package WordPress 512 533 * @subpackage Plugin 513 * @since 2.0 534 * @since 2.0.0 514 535 * 515 536 * @access private 516 537 * … … 537 558 * 538 559 * @package WordPress 539 560 * @subpackage Plugin 540 * @since 2.0 561 * @since 2.0.0 541 562 * 542 563 * @access private 543 564 * … … 569 590 * should always check for the 'WP_UNINSTALLING_PLUGIN' constant, before 570 591 * executing. 571 592 * 572 * @since 2.7 593 * @since 2.7.0 573 594 * 574 595 * @param string $file 575 596 * @param callback $callback The callback to run when the hook is called. … … 596 617 * 597 618 * @package WordPress 598 619 * @subpackage Plugin 599 * @since 2.5 620 * @since 2.5.0 600 621 * @access private 601 622 * 602 623 * @uses $wp_filter Used to process all of the functions in the 'all' hook