Skip to content

Instantly share code, notes, and snippets.

View chrisianfaith's full-sized avatar
💭
I may be slow to respond.

ChristianFaith chrisianfaith

💭
I may be slow to respond.
View GitHub Profile
@chrisianfaith
chrisianfaith / gist:e84dbf80f66374c40ee2d96c55604804
Created October 29, 2020 06:32
Custom CSS ( trabaho q now web )
a#new_searchicon {display:none;}
.content ul {list-style:disc;padding-left:15px;}
.content ol {list-style:decimal;padding-left:15px;}
@media only screen and (max-width: 576px) {
@chrisianfaith
chrisianfaith / gist:e7e8ea24e0d9096d9b25c39ce6e30465
Created October 28, 2020 15:07
Media Access ( snippets wordpress)
// Limit media library access
add_filter( 'ajax_query_attachments_args', 'wpb_show_current_user_attachments' );
function wpb_show_current_user_attachments( $query ) {
$user_id = get_current_user_id();
if ( $user_id && !current_user_can('activate_plugins') && !current_user_can('edit_others_posts
') ) {
$query['author'] = $user_id;
}
@chrisianfaith
chrisianfaith / gist:0459ec5a4409b9799be254e61fa7274c
Last active October 28, 2020 14:27
course-ajax.php (BB) bp-course-ajax.php
<?php
/**
* Ajax functions for Course Module
*
*/
if ( ! defined( 'ABSPATH' ) ) exit;
class BP_Course_Ajax{
add_action('wplms_before_single_assignment','wplms_check_wplms_assignment_submission2',10);
function wplms_check_wplms_assignment_submission2(){
if(is_user_logged_in()){
$user_id = get_current_user_ID();
$assignment_id = get_the_ID();
$status = get_post_meta($assignment_id,$user_id,true);