public static function reply_body_callback()
    {
        $default = '{author} wrote:

{content}

Post Link: {url}

-----------

You are receiving this email because you subscribed to a forum topic.

Login and visit the topic to unsubscribe from these emails.';
        $message = bbp_get_form_option('_bbp_reply_notice_body', $default);
        ?>

		<textarea name="_bbp_reply_notice_body" class="large-text" rows="15" id="_bbp_reply_notice_body"><?php 
        echo esc_textarea($message);
        ?>
</textarea>
		<label for="_bbp_reply_notice_body"><?php 
        _e('Email message sent to topic subscribers when a new reply is posted', 'bbpress');
        ?>
</label>

	<?php 
    }
Ejemplo n.º 2
0
/**
 * Used to check if a bbPress slug conflicts with an existing known slug.
 *
 * @since 2.0.0 bbPress (r3306)
 *
 * @param string $slug
 * @param string $default
 *
 * @uses bbp_get_form_option() To get a sanitized slug string
 */
function bbp_form_slug_conflict_check($slug, $default)
{
    // Only set the slugs once ver page load
    static $the_core_slugs = array();
    // Get the form value
    $this_slug = bbp_get_form_option($slug, $default, true);
    if (empty($the_core_slugs)) {
        // Slugs to check
        $core_slugs = apply_filters('bbp_slug_conflict_check', array('post_base' => array('name' => __('Posts', 'bbpress'), 'default' => 'post', 'context' => 'WordPress'), 'page_base' => array('name' => __('Pages', 'bbpress'), 'default' => 'page', 'context' => 'WordPress'), 'revision_base' => array('name' => __('Revisions', 'bbpress'), 'default' => 'revision', 'context' => 'WordPress'), 'attachment_base' => array('name' => __('Attachments', 'bbpress'), 'default' => 'attachment', 'context' => 'WordPress'), 'nav_menu_base' => array('name' => __('Menus', 'bbpress'), 'default' => 'nav_menu_item', 'context' => 'WordPress'), 'tag_base' => array('name' => __('Tag base', 'bbpress'), 'default' => 'tag', 'context' => 'WordPress'), 'category_base' => array('name' => __('Category base', 'bbpress'), 'default' => 'category', 'context' => 'WordPress'), '_bbp_root_slug' => array('name' => __('Forums base', 'bbpress'), 'default' => 'forums', 'context' => 'bbPress'), '_bbp_topic_archive_slug' => array('name' => __('Topics base', 'bbpress'), 'default' => 'topics', 'context' => 'bbPress'), '_bbp_forum_slug' => array('name' => __('Forum slug', 'bbpress'), 'default' => 'forum', 'context' => 'bbPress'), '_bbp_topic_slug' => array('name' => __('Topic slug', 'bbpress'), 'default' => 'topic', 'context' => 'bbPress'), '_bbp_reply_slug' => array('name' => __('Reply slug', 'bbpress'), 'default' => 'reply', 'context' => 'bbPress'), '_bbp_user_slug' => array('name' => __('User base', 'bbpress'), 'default' => 'users', 'context' => 'bbPress'), '_bbp_view_slug' => array('name' => __('View base', 'bbpress'), 'default' => 'view', 'context' => 'bbPress'), '_bbp_topic_tag_slug' => array('name' => __('Topic tag slug', 'bbpress'), 'default' => 'topic-tag', 'context' => 'bbPress')));
        /** BuddyPress Core *******************************************************/
        if (defined('BP_VERSION')) {
            $bp = buddypress();
            // Loop through root slugs and check for conflict
            if (!empty($bp->pages)) {
                foreach ($bp->pages as $page => $page_data) {
                    $page_base = $page . '_base';
                    $page_title = sprintf(__('%s page', 'bbpress'), $page_data->title);
                    $core_slugs[$page_base] = array('name' => $page_title, 'default' => $page_data->slug, 'context' => 'BuddyPress');
                }
            }
        }
        // Set the static
        $the_core_slugs = apply_filters('bbp_slug_conflict', $core_slugs);
    }
    // Loop through slugs to check
    foreach ($the_core_slugs as $key => $value) {
        // Get the slug
        $slug_check = bbp_get_form_option($key, $value['default'], true);
        // Compare
        if ($slug !== $key && $slug_check === $this_slug) {
            ?>

			<span class="attention"><?php 
            printf(esc_html__('Possible %1$s conflict: %2$s', 'bbpress'), $value['context'], '<strong>' . $value['name'] . '</strong>');
            ?>
</span>

		<?php 
        }
    }
}