[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-settings/ -> bp-settings-template.php (source)

   1  <?php
   2  /**
   3   * BuddyPress Settings Template Functions.
   4   *
   5   * @package BuddyPress
   6   * @subpackage SettingsTemplate
   7   * @since 1.5.0
   8   */
   9  
  10  // Exit if accessed directly.
  11  defined( 'ABSPATH' ) || exit;
  12  
  13  /**
  14   * Output the settings component slug.
  15   *
  16   * @since 1.5.0
  17   *
  18   */
  19  function bp_settings_slug() {
  20      echo bp_get_settings_slug();
  21  }
  22      /**
  23       * Return the settings component slug.
  24       *
  25       * @since 1.5.0
  26       *
  27       * @return string
  28       */
  29  	function bp_get_settings_slug() {
  30  
  31          /**
  32           * Filters the Settings component slug.
  33           *
  34           * @since 1.5.0
  35           *
  36           * @param string $slug Settings component slug.
  37           */
  38          return apply_filters( 'bp_get_settings_slug', buddypress()->settings->slug );
  39      }
  40  
  41  /**
  42   * Output the settings component root slug.
  43   *
  44   * @since 1.5.0
  45   *
  46   */
  47  function bp_settings_root_slug() {
  48      echo bp_get_settings_root_slug();
  49  }
  50      /**
  51       * Return the settings component root slug.
  52       *
  53       * @since 1.5.0
  54       *
  55       * @return string
  56       */
  57  	function bp_get_settings_root_slug() {
  58  
  59          /**
  60           * Filters the Settings component root slug.
  61           *
  62           * @since 1.5.0
  63           *
  64           * @param string $root_slug Settings component root slug.
  65           */
  66          return apply_filters( 'bp_get_settings_root_slug', buddypress()->settings->root_slug );
  67      }
  68  
  69  /**
  70   * Add the 'pending email change' message to the settings page.
  71   *
  72   * @since 2.1.0
  73   */
  74  function bp_settings_pending_email_notice() {
  75      $pending_email = bp_get_user_meta( bp_displayed_user_id(), 'pending_email_change', true );
  76  
  77      if ( empty( $pending_email['newemail'] ) ) {
  78          return;
  79      }
  80  
  81      if ( bp_get_displayed_user_email() == $pending_email['newemail'] ) {
  82          return;
  83      }
  84  
  85      ?>
  86  
  87      <div id="message" class="bp-template-notice error">
  88          <p>
  89              <?php
  90              printf(
  91                  /* translators: %s: new email address */
  92                  __( 'There is a pending change of your email address to %s.', 'buddypress' ),
  93                  '<code>' . esc_html( $pending_email['newemail'] ) . '</code>'
  94              );
  95              ?>
  96              <br />
  97              <?php
  98              printf(
  99                  /* translators: 1: email address. 2: cancel email change url. */
 100                  __( 'Check your email (%1$s) for the verification link, or <a href="%2$s">cancel the pending change</a>.', 'buddypress' ),
 101                  '<code>' . esc_html( $pending_email['newemail'] ) . '</code>',
 102                  esc_url( wp_nonce_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/?dismiss_email_change=1', 'bp_dismiss_email_change' ) )
 103              );
 104              ?>
 105          </p>
 106      </div>
 107  
 108      <?php
 109  }
 110  add_action( 'bp_before_member_settings_template', 'bp_settings_pending_email_notice' );


Generated: Tue Jul 14 01:01:30 2020 Cross-referenced by PHPXref 0.7.1