Admin wp_capabilities
wp_user_level
10
a:1:{s:13:"administrator";b:1;}
Contributor wp_capabilities
wp_user_level
1
<?php | |
add_filter( 'bbp_get_reply_author_link', 'my_append_badges_via_filter', 10, 2 ); | |
function my_append_badges_via_filter($author_link = '', $args) { | |
# Needed to get the user ID of the person intended to be displayed. | |
$user_id = bbp_get_reply_author_id( $args['post_id'] ); | |
#Construct your output here. | |
$badge_output = ''; |
<?php | |
/* Pull apart OEmbed video link to get thumbnails out*/ | |
function get_video_thumbnail_uri( $video_uri ) { | |
$thumbnail_uri = ''; | |
// determine the type of video and the video id | |
$video = parse_video_uri( $video_uri ); | |
// get youtube thumbnail |
function google_fonts() { | |
$query_args = array( | |
'family' => 'Open+Sans:400,700|Oswald:700' | |
'subset' => 'latin,latin-ext', | |
); | |
wp_register_style( 'google_fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null ); | |
} | |
add_action('wp_enqueue_scripts', 'google_fonts'); |
// Remove Access to the course linked to the subscription key | |
function remove_course_access( $user_id, $subscription_key ) { | |
// Get the course ID related to the subscription | |
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key ); | |
$courses_id = get_post_meta($subscription['product_id'], '_related_course', true); | |
// Update access to the courses | |
if ($courses_id && is_array($courses_id)) { | |
foreach ($courses_id as $course_id) { |
<?php | |
// To add custom data above add to cart button in woocommerce | |
// step 1 | |
add_action('wp_ajax_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback'); | |
add_action('wp_ajax_nopriv_wdm_add_user_custom_data_options', 'wdm_add_user_custom_data_options_callback'); | |
function wdm_add_user_custom_data_options_callback() |
<?php | |
// UPDATE: Stefan from Stack Overflow has explained a better way to handle cart item data. | |
// See http://stackoverflow.com/a/32327810/470480 | |
// ---------------------- | |
/* | |
Instructions: |
var gulp = require('gulp'), | |
debug = require('gulp-debug'), | |
size = require('gulp-filesize'), | |
clean = require('gulp-clean'), | |
coffee = require('gulp-coffee'), | |
coffeelint = require('gulp-coffeelint'), | |
gutil = require('gulp-util'), | |
sass = require('gulp-sass'), | |
imagemin = require('gulp-imagemin'), | |
changed = require('gulp-changed'), |
<?php | |
/** | |
* Gravity Forms Custom Activation Template | |
* http://gravitywiz.com/customizing-gravity-forms-user-registration-activation-page | |
*/ | |
add_action('wp', 'custom_maybe_activate_user', 9); | |
function custom_maybe_activate_user() { | |
$template_path = STYLESHEETPATH . '/gfur-activate-template/activate.php'; | |
$is_activate_page = isset( $_GET['page'] ) && $_GET['page'] == 'gf_activation'; |