Changeset 9664
- Timestamp:
- 03/31/2015 04:19:19 AM (11 years ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 3 edited
-
bp-core-catchuri.php (modified) (12 diffs)
-
bp-core-filters.php (modified) (9 diffs)
-
classes/class-bp-core-notification.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-catchuri.php
r9559 r9664 56 56 $path = esc_url( $_SERVER['REQUEST_URI'] ); 57 57 58 // Filter the path 58 /** 59 * Filters the BuddyPress global URI path. 60 * 61 * @since BuddyPress (1.0.0) 62 * 63 * @param string $path Path to set. 64 */ 59 65 $path = apply_filters( 'bp_uri', $path ); 60 66 … … 328 334 $retval = true; 329 335 336 /** 337 * Filters whether or not root profiles are enabled and allowed. 338 * 339 * @since BuddyPress (1.6.0) 340 * 341 * @param bool $retval Whether or not root profiles are available. 342 */ 330 343 return apply_filters( 'bp_core_enable_root_profiles', $retval ); 331 344 } … … 371 384 } 372 385 373 // Filter the template locations so that plugins can alter where they are located 386 /** 387 * Filters the template locations. 388 * 389 * Allows plugins to alter where the template files are located. 390 * 391 * @since BuddyPress (1.1.0) 392 * 393 * @param string $template Located template path. 394 * @param array $filtered_templates Array of templates to attempt to load. 395 */ 374 396 $located_template = apply_filters( 'bp_located_template', $template, $filtered_templates ); 375 397 if ( !empty( $located_template ) ) { … … 380 402 $wp_query->is_404 = false; 381 403 404 /** 405 * Fires before the loading of a located template file. 406 * 407 * @since BuddyPress (1.6.0) 408 * 409 * @param string $located_template Template found to be loaded. 410 */ 382 411 do_action( 'bp_core_pre_load_template', $located_template ); 383 412 413 /** 414 * Filters the selected template right before loading. 415 * 416 * @since BuddyPress (1.1.0) 417 * 418 * @param string $located_template Template found to be loaded. 419 */ 384 420 load_template( apply_filters( 'bp_load_template', $located_template ) ); 385 421 422 /** 423 * Fires after the loading of a located template file. 424 * 425 * @since BuddyPress (1.6.0) 426 * 427 * @param string $located_template Template found that was loaded. 428 */ 386 429 do_action( 'bp_core_post_load_template', $located_template ); 387 430 … … 402 445 } 403 446 447 /** 448 * Fires if there are no found templates to load and theme compat is needed. 449 * 450 * @since BuddyPress (1.7.0) 451 */ 404 452 do_action( 'bp_setup_theme_compat' ); 405 453 } … … 411 459 function bp_core_catch_profile_uri() { 412 460 if ( !bp_is_active( 'xprofile' ) ) { 461 462 /** 463 * Filters the path to redirect users to if XProfile is not enabled. 464 * 465 * @since BuddyPress (1.0.0) 466 * 467 * @param string $value Path to redirect users to. 468 */ 413 469 bp_core_load_template( apply_filters( 'bp_core_template_display_profile', 'members/single/home' ) ); 414 470 } … … 473 529 474 530 $r = wp_parse_args( $args, $defaults ); 531 532 /** 533 * Filters the arguments used for user redirecting when visiting access controlled areas. 534 * 535 * @since BuddyPress (1.6.0) 536 * 537 * @param array $r Array of parsed arguments for redirect determination. 538 */ 475 539 $r = apply_filters( 'bp_core_no_access', $r ); 476 540 extract( $r, EXTR_SKIP ); … … 529 593 global $error; 530 594 595 /** 596 * Filters the error message for wp-login.php when needing to log in before accessing. 597 * 598 * @since BuddyPress (1.5.0) 599 * 600 * @param string $value Error message to display. 601 * @param string $value URL to redirect user to after successful login. 602 */ 531 603 $error = apply_filters( 'bp_wp_login_error', __( 'You must log in to access the page you requested.', 'buddypress' ), $_REQUEST['redirect_to'] ); 532 604 … … 555 627 function bp_redirect_canonical() { 556 628 629 /** 630 * Filters whether or not to do canonical redirects on BuddyPress URLs. 631 * 632 * @since BuddyPress (1.6.0) 633 * 634 * @param bool $value Whether or not to do canonical redirects. Default true. 635 */ 557 636 if ( !bp_is_blog_page() && apply_filters( 'bp_do_redirect_canonical', true ) ) { 558 637 // If this is a POST request, don't do a canonical redirect. … … 655 734 // the members directory to avoid redirect loops 656 735 } elseif ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) { 736 737 /** 738 * Filters the logged in register page redirect URL. 739 * 740 * @since BuddyPress (1.5.1) 741 * 742 * @param string $value URL to redirect logged in members to. 743 */ 657 744 $bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', bp_get_members_directory_permalink() ); 658 745 } … … 696 783 } 697 784 785 /** 786 * Filters the canonical url of the current page. 787 * 788 * @since BuddyPress (1.6.0) 789 * 790 * @param string $canonical_url Canonical URL of the current page. 791 * @param array $args Array of arguments to help determine canonical URL. 792 */ 698 793 return apply_filters( 'bp_get_canonical_url', $canonical_url, $args ); 699 794 } … … 714 809 } 715 810 811 /** 812 * Filters the URL as requested on the current page load by the user agent. 813 * 814 * @since BuddyPress (1.7.0) 815 * 816 * @param string $value Requested URL string. 817 */ 716 818 return apply_filters( 'bp_get_requested_url', $bp->canonical_stack['requested_url'] ); 717 819 } -
trunk/src/bp-core/bp-core-filters.php
r9471 r9664 95 95 $pages[] = $bp->pages->forums->id; 96 96 97 /** 98 * Filters specific pages that shouldn't show up on page listings. 99 * 100 * @since BuddyPress (1.5.0) 101 * 102 * @param array $pages Array of pages to exclude. 103 */ 97 104 return apply_filters( 'bp_core_exclude_pages', $pages ); 98 105 } … … 235 242 */ 236 243 function bp_core_email_from_name_filter() { 244 245 /** 246 * Filters the "From" name in outgoing email to the site name. 247 * 248 * @since BuddyPress (1.2.0) 249 * 250 * @param string $value Value to set the "From" name to. 251 */ 237 252 return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) ); 238 253 } … … 301 316 } 302 317 303 // Allow plugins to allow or disallow redirects, as desired 318 /** 319 * Filters whether or not to redirect. 320 * 321 * Allows plugins to have finer grained control of redirect upon login. 322 * 323 * @since BuddyPress (1.6.0) 324 * 325 * @param bool $value Whether or not to redirect. 326 * @param string $redirect_to Sanitized URL to be redirected to. 327 * @param string $redirect_to_raw Unsanitized URL to be redirected to. 328 * @param WP_User $user The WP_User object corresponding to a 329 * successfully logged in user. 330 */ 304 331 $maybe_redirect = apply_filters( 'bp_core_login_redirect', false, $redirect_to, $redirect_to_raw, $user ); 305 332 if ( false !== $maybe_redirect ) { … … 318 345 } 319 346 347 /** 348 * Filters the URL to redirect users to upon successful login. 349 * 350 * @since BuddyPress (1.9.0) 351 * 352 * @param string $value URL to redirect to. 353 */ 320 354 return apply_filters( 'bp_core_login_redirect_to', bp_get_root_domain() ); 321 355 } … … 415 449 $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Activate %s', 'buddypress' ), 'http://' . $domain . $path ) ) ); 416 450 417 // Email filters 451 /** 452 * Filters the email that the notification is going to upon successful registration with blog. 453 * 454 * @since BuddyPress (1.2.0) 455 * 456 * @param string $user_email The user's email address. 457 * @param string $domain The new blog domain. 458 * @param string $path The new blog path. 459 * @param string $title The site title. 460 * @param string $user The user's login name. 461 * @param string $user_email The user's email address. 462 * @param string $key The activation key created in wpmu_signup_blog(). 463 * @param array $meta Array of meta values for the created site. 464 */ 418 465 $to = apply_filters( 'bp_core_activation_signup_blog_notification_to', $user_email, $domain, $path, $title, $user, $user_email, $key, $meta ); 466 467 /** 468 * Filters the subject that the notification uses upon successful registration with blog. 469 * 470 * @since BuddyPress (1.2.0) 471 * 472 * @param string $subject The subject to use. 473 * @param string $domain The new blog domain. 474 * @param string $path The new blog path. 475 * @param string $title The site title. 476 * @param string $user The user's login name. 477 * @param string $user_email The user's email address. 478 * @param string $key The activation key created in wpmu_signup_blog(). 479 * @param array $meta Array of meta values for the created site. 480 */ 419 481 $subject = apply_filters( 'bp_core_activation_signup_blog_notification_subject', $subject, $domain, $path, $title, $user, $user_email, $key, $meta ); 482 483 /** 484 * Filters the message that the notification uses upon successful registration with blog. 485 * 486 * @since BuddyPress (1.2.0) 487 * 488 * @param string $message The message to use. 489 * @param string $domain The new blog domain. 490 * @param string $path The new blog path. 491 * @param string $title The site title. 492 * @param string $user The user's login name. 493 * @param string $user_email The user's email address. 494 * @param string $key The activation key created in wpmu_signup_blog(). 495 * @param array $meta Array of meta values for the created site. 496 */ 420 497 $message = apply_filters( 'bp_core_activation_signup_blog_notification_message', $message, $domain, $path, $title, $user, $user_email, $key, $meta ); 421 498 … … 426 503 $admin_email = bp_get_option( 'admin_email' ); 427 504 505 /** 506 * Fires after the sending of the notification to new users for successful registration with blog. 507 * 508 * @since BuddyPress (1.5.0) 509 * 510 * @param string $admin_email Admin Email address for the site. 511 * @param string $subject Subject used in the notification email. 512 * @param string $message Message used in the notification email. 513 * @param string domain The new blog domain. 514 * @param string $path The new blog path. 515 * @param string $title The site title. 516 * @param string $user The user's login name. 517 * @param string $user_email The user's email address. 518 * @param string $key The activation key created in wpmu_signup_blog(). 519 * @param array $meta Array of meta values for the created site. 520 */ 428 521 do_action( 'bp_core_sent_blog_signup_email', $admin_email, $subject, $message, $domain, $path, $title, $user, $user_email, $key, $meta ); 429 522 … … 480 573 $subject = bp_get_email_subject( array( 'text' => __( 'Activate Your Account', 'buddypress' ) ) ); 481 574 482 // Email filters 575 /** 576 * Filters the email that the notification is going to upon successful registration without blog. 577 * 578 * @since BuddyPress (1.2.0) 579 * 580 * @param string $user_email The user's email address. 581 * @param string $user The user's login name. 582 * @param string $user_email The user's email address. 583 * @param string $key The activation key created in wpmu_signup_blog(). 584 * @param array $meta Array of meta values for the created site. 585 */ 483 586 $to = apply_filters( 'bp_core_activation_signup_user_notification_to', $user_email, $user, $user_email, $key, $meta ); 587 588 /** 589 * Filters the subject that the notification uses upon successful registration without blog. 590 * 591 * @since BuddyPress (1.2.0) 592 * 593 * @param string $subject The subject to use. 594 * @param string $user The user's login name. 595 * @param string $user_email The user's email address. 596 * @param string $key The activation key created in wpmu_signup_blog(). 597 * @param array $meta Array of meta values for the created site. 598 */ 484 599 $subject = apply_filters( 'bp_core_activation_signup_user_notification_subject', $subject, $user, $user_email, $key, $meta ); 600 601 /** 602 * Filters the message that the notification uses upon successful registration without blog. 603 * 604 * @since BuddyPress (1.2.0) 605 * 606 * @param string $message The message to use. 607 * @param string $user The user's login name. 608 * @param string $user_email The user's email address. 609 * @param string $key The activation key created in wpmu_signup_blog(). 610 * @param array $meta Array of meta values for the created site. 611 */ 485 612 $message = apply_filters( 'bp_core_activation_signup_user_notification_message', $message, $user, $user_email, $key, $meta ); 486 613 … … 491 618 $admin_email = bp_get_option( 'admin_email' ); 492 619 620 /** 621 * Fires after the sending of the notification to new users for successful registration without blog. 622 * 623 * @since BuddyPress (1.5.0) 624 * 625 * @param string $admin_email Admin Email address for the site. 626 * @param string $subject Subject used in the notification email. 627 * @param string $message Message used in the notification email. 628 * @param string $user The user's login name. 629 * @param string $user_email The user's email address. 630 * @param string $key The activation key created in wpmu_signup_blog(). 631 * @param array $meta Array of meta values for the created site. Default empty array. 632 */ 493 633 do_action( 'bp_core_sent_user_signup_email', $admin_email, $subject, $message, $user, $user_email, $key, $meta ); 494 634 … … 624 764 $title = preg_replace( '|<span>[0-9]+</span>|', '', $title ); 625 765 766 /** 767 * Filters the page title for BuddyPress pages. 768 * 769 * @since BuddyPress (1.5.0) 770 * 771 * @param string $value Determined title for the current BuddyPress page. 772 * @param string $sep Separator used for the BuddyPress page title. 773 * @param string $seplocation Location to place the separator value. 774 */ 626 775 return apply_filters( 'bp_modify_page_title', $title . ' ' . $sep . ' ', $title, $sep, $seplocation ); 627 776 } -
trunk/src/bp-core/classes/class-bp-core-notification.php
r9486 r9664 16 16 * 17 17 * @package BuddyPress Core 18 * @deprecated since BuddyPress (1.9 )18 * @deprecated since BuddyPress (1.9.0) 19 19 */ 20 20 class BP_Core_Notification {
Note: See TracChangeset
for help on using the changeset viewer.