This file contains 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
/*-- BBpress User Favorites Shortcode [bbp-user-favorites] --*/ | |
function bbp_user_favorites_shortcode( $atts ) { | |
$user_id = get_current_user_id(); | |
ob_start(); | |
if ( bbp_get_user_favorites( $user_id ) ) { | |
//bbp_get_template_part( 'pagination', 'topics' ); | |
bbp_get_template_part( 'loop', 'topics' ); | |
bbp_get_template_part( 'pagination', 'topics' ); | |
} else { ?> | |
<aside class="bp-feedback bp-messages info"> |
This file contains 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 | |
/** | |
* Core: Plugin Bootstrap | |
* | |
* @package AffiliateWP Leaderboard | |
* @subpackage Core | |
* @copyright Copyright (c) 2021, Sandhills Development, LLC | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* @since 1.1 | |
*/ |
This file contains 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
//redirect any draft/trashed posts to custom postmeta field: redirect_url_on_draft | |
add_action('wp', 'custom_redirect_on_draft'); | |
function custom_redirect_on_draft(){ | |
if ( !current_user_can( 'edit_pages' ) ) { | |
if (is_404()){ | |
global $wp_query, $wpdb; | |
$page_id = $wpdb->get_var( $wp_query->request ); | |
$post_status = get_post_status( $page_id ); | |
$post_redirect = get_post_meta( $page_id, 'redirect_url_on_draft', true ); | |
if(($post_status == 'trash' || $post_status == 'draft') && $post_redirect){ |
This file contains 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
/** | |
* MyBookTable: use book image as post thumbnail | |
*/ | |
//Find Book Image ID | |
add_filter( 'get_post_metadata', 'mbt_use_book_image_as_thumbnail', 10, 4 ); | |
function mbt_use_book_image_as_thumbnail( $null, $object_id, $meta_key, $single ) { | |
if ( '_thumbnail_id' !== $meta_key ) { | |
return $null; | |
} |
This file contains 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_filter('learndash_user_can_bypass', 'custom_bypass_video_progression', 10, 4); | |
function custom_bypass_video_progression( $can_bypass, $user_id, $context, $args ){ | |
if( $context == 'learndash_video_progression'){ | |
$can_bypass = true; | |
} | |
return $can_bypass; | |
} |
This file contains 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 | |
// Add Forum Stickers | |
if( !empty( bbp_get_topic_forum_title()) ) { ?> | |
<span class="color bs-meta-item <?php echo ( bbp_is_single_forum() ) ? esc_attr( 'no-action' ) : ''; ?>" style="background: <?php echo color2rgba( textToColor( bbp_get_topic_forum_title() ), 0.6 ); ?>"> | |
<?php if ( bbp_is_single_forum() ) { | |
?> <span class="no-links"><?php echo bbp_get_topic_forum_title(); ?></span> <?php | |
} else { | |
?> <a href="<?php echo esc_url( bbp_get_forum_permalink( bbp_get_topic_forum_id() ) ); ?>"><?php echo bbp_get_topic_forum_title(); ?></a> | |
<?php } ?> | |
</span> |
This file contains 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 | |
$get_last_reply_id = bbp_get_topic_last_reply_id( bbp_get_topic_id() ); | |
echo bbp_get_author_link( array( 'post_id' => $get_last_reply_id,'size' => '180' ) ); | |
?> |
This file contains 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
$is_more_link = count( array_filter( $original_option_values ) ) > 10; |
This file contains 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 found here: https://github.com/wp-premium/woocommerce-subscriptions/blob/master/templates/myaccount/subscription-details.php | |
add_filter('wcs_subscription_details_table_dates_to_display', 'wc_remove_end_date_column', 10, 2); | |
function wc_remove_end_date_column($rows, $subscription){ | |
unset($rows['end']); | |
return $rows; | |
} |
This file contains 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
/************************************** | |
* VC ACF GRID ITEM W/ RELATIONSHIP | |
***************************************/ | |
add_filter( 'vc_grid_item_shortcodes', 'vc_grid_item_shortcode_acf_extra' ); | |
function vc_grid_item_shortcode_acf_extra( $shortcodes ) { | |
$groups = function_exists( 'acf_get_field_groups' ) ? acf_get_field_groups() : apply_filters( 'acf/get_field_groups', array() ); | |
$groups_param_values = $fields_params = array(); | |
foreach ( $groups as $group ) { | |
$id = isset( $group['id'] ) ? 'id' : ( isset( $group['ID'] ) ? 'ID' : 'id' ); | |
$groups_param_values[ $group['title'] ] = $group[ $id ]; |