Skip to content

Instantly share code, notes, and snippets.

View FranciscoHV's full-sized avatar

Francisco FranciscoHV

  • Stgo. Chile
View GitHub Profile
@FranciscoHV
FranciscoHV / course_product.php
Created April 15, 2016 14:21 — forked from MrVibe/course_product.php
Course product shortcode
/*-----------------------------------------------------------------------------------*/
/* Course Product
/*
/* USAGE : xx is course id
/* [course_product id="xx" details="price"]
/* [course_product id="xx" details="sku"]
/* [course_product id="xx" details="sales"]
/* [course_product id="xx" details="note"]
/* Above shortcode can also be used on certificate pages and remove the id field:
---------------------bp-course-functions.php
global $post;
$val=5839;
$return ='<div class="course_details">
<ul>';
// $product_id = $post->ID;
?><div align=\"center\"><? $return .= do_shortcode('[product_sale id = "'.$val.'"]'); ?></div><?
global $wp_query, $post;
$post = get_post(5839);
@FranciscoHV
FranciscoHV / custom_bp_widgets.php
Created March 1, 2016 20:04
Backup Login sobre reestablecer contraseña
<?php
add_action( 'widgets_init', 'vibe_bp_widgets' );
function vibe_bp_widgets() {
register_widget('vibe_bp_login');
register_widget('vibe_course_categories');
register_widget('vibecertificatecode');
}
@FranciscoHV
FranciscoHV / Query.php
Last active February 23, 2016 15:57
Possible Query for get data in bp
$sql = array();
$total_sql = array();
$sql['select'] = "SELECT g.*, gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
$sql['select'] = "SELECT DISTINCT g.id as not_used, g.*, gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
$sql['from'] = " FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2,";
if ( ! empty( $r['user_id'] ) ) {
… …
// See #5099
@FranciscoHV
FranciscoHV / bp-groups-deprecated.php
Created February 23, 2016 13:04
This file contains functions that are deprecated. * You should not under any circumstance use these functions as they are * either no longer valid, or have been replaced with something much more awesome.
<?php
/***
* Deprecated Groups Functionality
*
* This file contains functions that are deprecated.
* You should not under any circumstance use these functions as they are
* either no longer valid, or have been replaced with something much more awesome.
*
* If you are using functions in this file you should slap the back of your head
* and then use the functions or solutions that have replaced them.