Skip to content

Instantly share code, notes, and snippets.

View tejasbusiness's full-sized avatar

Tejas Gandhi tejasbusiness

View GitHub Profile
@tejasbusiness
tejasbusiness / functions.php
Created December 4, 2020 20:23 — forked from alexander-young/functions.php
Cleanup WordPress plugin admin
// Removing plugin controls from admin
function remove_plugin_controls($actions, $plugin_file, $plugin_data, $context){
if (array_key_exists('edit', $actions)) {
unset($actions['edit']);
}
if (array_key_exists('deactivate', $actions)) {
@tejasbusiness
tejasbusiness / my_pmproal_before_level_member_badge.php
Created May 30, 2017 03:36 — forked from strangerstudios/my_pmproal_before_level_member_badge.php
Show the Member Badge for each level on the 3 column layout Membership Levels page
<?php
/*
Sample method to show a level's Member Badge on the three column layout of the
Membership Levels page when using the Advanced Levels Page Shortcode Add On.
*/
function my_pmproal_before_level_member_badge( $level_id, $layout ) {
if( function_exists( 'pmpromb_getBadgeForLevel' ) ) {
$image = pmpromb_getBadgeForLevel($level_id);
if( ! empty( $image ) && $layout == '3col' ) {
echo '<img class="pmpro_member_badge" src="' . esc_url($image) . '" border="0" />';