This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add content into the post | |
*/ | |
function acrosswp_nouveau_ajax_post_update_custom() { | |
if ( ! is_user_logged_in() || empty( $_POST['_wpnonce_post_update'] ) || ! wp_verify_nonce( $_POST['_wpnonce_post_update'], 'post_update' ) ) { | |
wp_send_json_error(); | |
} | |
// check activity toolbar options if one of them is set, activity can be empty. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ld_group_id = bp_ld_sync( 'buddypress' )->helpers->getLearndashGroupId( bp_get_current_group_id() ); | |
if ( $ld_group_id ) { | |
$post_label_prefix = 'group'; | |
$meta = learndash_get_setting( $ld_group_id ); | |
$post_price_type = ( isset( $meta[ $post_label_prefix . '_price_type' ] ) ) ? $meta[ $post_label_prefix . '_price_type' ] : ''; | |
$post_price = ( isset( $meta[ $post_label_prefix . '_price' ] ) ) ? $meta[ $post_label_prefix . '_price' ] : ''; | |
// format the Course price to be proper XXX.YY no leading dollar signs or other values. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove the new filter that is been added into BuddyPress 2.4.11 | |
*/ | |
function awp_bp_init_bb_platform_issue() { | |
remove_filter( 'bp_activity_set_just-me_scope_args', 'bp_activity_filter_just_me_scope', 10 ); | |
} | |
add_action( 'bp_init', 'awp_bp_init_bb_platform_issue' ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filter to run the shortcode into the formds | |
*/ | |
function bbp_get_topic_content_callback( $content ) { | |
return do_shortcode( $content ); | |
} | |
add_filter( 'bbp_get_topic_content', 'bbp_get_topic_content_callback', 100000 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Temp patch for Group Menu issue in the BB theme version: 2.4.01 | |
*/ | |
function awp_add_boss_menu_js_functions() { | |
if( | |
function_exists( 'bp_get_group_current_admin_tab' ) | |
&& in_array( bp_get_group_current_admin_tab(), array( 'edit-details', 'group-settings', 'group-avatar', 'group-cover-image', 'manage-members', 'membership-requests', 'delete-group', 'forum' ), true ) | |
) { | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WordPress function for redirecting users on login based on user role | |
*/ | |
function awp_login_redirect_callback( $url, $request, $user ) { | |
/* | |
* Add your custom url | |
*/ | |
$url = home_url( '/cart/' ); | |
return $url; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Print custom text on the profile page after the nickname | |
*/ | |
function awp_bp_before_member_header_meta_callback() { | |
echo "Custom Text"; | |
} | |
add_action( 'bp_before_member_header_meta', 'awp_bp_before_member_header_meta_callback' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change the default template to elementor_header_footer for new page and post | |
*/ | |
function bb_rest_set_default_page_template( $data, $post ) { | |
if ( | |
0 != count( get_page_templates( $post ) ) | |
&& get_option( 'page_for_posts' ) != $post->ID | |
&& '' == $data->data['template'] | |
) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function use_block_editor_for_post_disable_gutenberg( $can_edit, $post ) { | |
if( $post->ID == '247' ) { | |
return false; | |
} | |
return true; | |
} | |
add_filter( 'use_block_editor_for_post', 'use_block_editor_for_post_disable_gutenberg', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bp_member_options_nav_custom_link() { | |
?> | |
<li id="custom-link-li" class="bp-personal-tab"> | |
<a href="/members/admin/invites/" id="custom-link" class=""> | |
<div class="bb-single-nav-item-point">Custom Text</div> | |
</a> | |
</li> | |
<?php | |
} | |
add_action( 'bp_member_options_nav', 'bp_member_options_nav_custom_link', 100 ); //Priority must be higher than 10 |