Skip to content

Instantly share code, notes, and snippets.

View codehaiku's full-sized avatar
👋
Howdy!

Joseph G. codehaiku

👋
Howdy!
View GitHub Profile
add_filter( 'bp_nouveau_get_groups_filters', function( $filters, $context ){
return array_reverse( $filters, true );
},10,2);
@codehaiku
codehaiku / bp-prevent-profile-update.php
Created August 20, 2018 04:00
bp-prevent-profile-update.php
add_action('bp_nouveau_get_submit_button', function(){
?>
<div class="alert alert-danger mg-top-10">
<p>
Changing email and password is currently disabled by the Administrator
of this demo. This is to prevent other users from changing the demo password and preventing everyone
to access this demo site. Sorry for any inconvenience.
</p>
</div>
<p>
@codehaiku
codehaiku / show-all-hooks.php
Created August 20, 2018 03:52
WordPress Show All Hooks
<?php
add_action( 'all', function ( $tag ) {
global $debug_tags;
if ( in_array( $tag, $debug_tags ) ) {
return;
}
echo $tag;
$debug_tags[] = $tag;
} );
<?php
function my_bp_loop_querystring( $query_string, $object ) {
if ( ! empty( $query_string ) ) {
$query_string .= '&';
}
$query_string .= 'type=alphabetical';
@codehaiku
codehaiku / file-check.php
Created May 19, 2018 05:08
@http://php.net/manual/en/features.file-upload.php
<?php
try {
// Undefined | Multiple Files | $_FILES Corruption Attack
// If this request falls under any of them, treat it invalid.
if (
!isset($_FILES['upfile']['error']) ||
is_array($_FILES['upfile']['error'])
) {
@codehaiku
codehaiku / wie.js
Created June 7, 2017 09:54
Web Inspector Experiments
/**
* [EXPERIMENTS]
*/
var anchors = document.getElementsByTagName('a');
for ( key in anchors ) {
if ( anchors[key].nodeType == 1 ) {
anchors[key].addEventListener('click', function(event){
event.preventDefault();
});
<?php
function my_bp_activities_per_page_5( $retval, $bp_has_members = 'bp_has_members' ) {
global $wpdb;
$fields = array(
array(
'id' => 3,
'value' => 'male',
'relation' => 'LIKE'
@codehaiku
codehaiku / tf-theme-upload-checklist.txt
Last active January 28, 2017 12:40
themeforest theme upload checklist
Final Q.A (Demos)
1. Make sure everything works in the demo
2. Widgets are displaying properly
3. No spacing and typographical errors
4. Check all plugins
Before Theme Upload Checklist:
1. Make sure everything is working. No PHP Notices, Errors, and Warning.
@codehaiku
codehaiku / tf-purchase-link.txt
Created January 28, 2017 12:24
TF Purchase Link
@codehaiku
codehaiku / gist:eaf810380d99f1ced417fd137b29e5e9
Created December 9, 2016 16:40
Thrive Community Demo Text
[vc_row el_class="wide"][vc_column][rev_slider_vc alias="home-slider"][/vc_column][/vc_row][vc_row][vc_column][vc_custom_heading text="Our Community" font_container="tag:h3|font_size:3em|text_align:center|line_height:14px" use_theme_fonts="yes"][vc_column_text]
<p style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus eget ultrices sem, et rutrum lectus.</p>
[/vc_column_text][gears_bp_groups_grid type="popular" max_item="8" columns="4"][vc_btn title="View Groups" style="custom" custom_background="#827717" custom_text="#ffffff" shape="round" size="lg" align="center" i_type="openiconic" i_icon_openiconic="vc-oi vc-oi-chat-inv" css_animation="bottom-to-top" link="url:http%3A%2F%2Fthrive-demo.dunhakdis.me%2Fcommunity-demo%2Fgroups%2F|title:Visit%20Groups|" add_icon="true" css=".vc_custom_1445856876820{margin-top: 35px !important;margin-bottom: 35px !important;}"][/vc_column][/vc_row][vc_row full_width="stretch_row" css=".vc_custom_1445856471563{padding-top: 35px !important;