bp_feed_settings_callback_post_type( $args )
Allow Post Type feed setting field
Description
Parameters
- $args
-
(Required) array
Source
File: bp-core/admin/bp-core-admin-settings.php
function bp_feed_settings_callback_post_type( $args ) { $post_type = $args['post_type']; $option_name = 'bp-feed-custom-post-type-' . $post_type; $post_type_obj = get_post_type_object( $post_type ); // Description for the last option of CPT if ( true === $args['description'] && 'post' !== $post_type ) { ?> <p class="description"><?php _e( 'Select which Custom Post Types (coming from your plugins) should be shown in the activity feed. For example, if using WooCommerce it could post into the activity feed every time someone creates a new product.', 'buddyboss' ); ?></p> <?php } ?> <input name="<?php echo $option_name ?>" id="<?php echo $option_name ?>" type="checkbox" value="1" <?php checked( bp_is_post_type_feed_enable( $post_type, false ) ) ?> /> <label for="<?php echo $option_name ?>"> <?php echo $post_type === 'post' ? esc_html__( 'Blog Posts', 'buddyboss' ) : $post_type_obj->labels->name ?> </label> <?php // Description for the WordPress Blog Posts if ( 'post' === $post_type ) { ?> <p class="description"><?php _e( 'When users publish new blog posts, show them in the activity feed.', 'buddyboss' ); ?></p> <?php } }
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.