View rcp_restrict_activity.php
<?php | |
/** | |
* Require user to have access level to view BuddyPress page | |
*/ | |
add_filter( 'rcp_member_can_access', function ( $can_access ) { | |
$access_level = 4; | |
$page_slug = 'activity'; | |
$customer = rcp_get_customer_by_user_id( get_current_user_id() ); |
View pp_post_grid_a11y.js
function ppPostAria() { | |
let links = document.querySelectorAll('.pp-post-link'); | |
let titles = document.querySelectorAll('.pp-content-grid-title'); | |
for (let i = 0; i < links.length; i++) { | |
let title = titles[i].innerText; | |
links[i].setAttribute('aria-label', title); | |
} | |
} |
View view-limit-condition-example.php
/** | |
* If post ID is 25 then disable View Limit functionality | |
*/ | |
add_filter( 'skpvl_is_active', function ( $active ) { | |
global $post; | |
if ( 25 == $post->ID ) { | |
$active = false; | |
} |
View google_serp_extractor
javascript:(function(){output='<html><head><title>SEO SERP Extraction Tool</title><style type=\'text/css\'>body,table{font-family:Tahoma,Verdana,Segoe,sans-serif;font-size:11px;color:#000}h1,h2,th{color:#405850}th{text-align:left}h2{font-size:11px;margin-bottom:3px}</style></head><body>'; output+='<table><tbody><tr><td><h1>SEO%20SERP%20Extraction%20Tool</h1></td></tr></tbody></table>'; pageAnchors=document.getElementsByTagName('a'); divClasses=document.getElementsByTagName('div'); var%20linkcount=0;var%20linkLocation=''; var%20linkAnchorText=''; output+='<table><th>ID</th><th>Link</th><th>Anchor</th>'; for(i=0;i<pageAnchors.length;i++){ if(pageAnchors[i].parentNode.parentNode.getAttribute('class')!='_Rm'){ var%20anchorText%20=%20pageAnchors[i].textContent; var%20anchorLink%20=%20pageAnchors[i].href; var%20linkAnchor%20=%20anchorLink%20+%20'\t'+anchorText; var%20anchorID%20=%20pageAnchors[i].id; if(anchorLink!=''){ if(anchorLink.match(/^((?!google\.|cache|blogger.com|\.yahoo\.|youtube\.com\/\?gl=|youtube\.com\ |
View window_size_bookmark
javascript: (function () { | |
var v = window, d = document; | |
v.onresize = function () { | |
var w = v.innerWidth ? v.innerWidth : d.documentElement.clientWidth, | |
h = v.innerHeight ? v.innerHeight : d.documentElement.clientHeight, s = d.getElementById('WSPlgIn'), ss; | |
if (!s) { | |
s = d.createElement('div'); | |
s.id = 'WSPlgIn'; | |
d.body.appendChild(s); | |
s.onclick = function () { |
View gravity-field-template
add_filter( 'gform_form_post_get_meta_7', 'add_form_fields' ); | |
function add_form_fields( $form ) { | |
// Don't make the parent form messy | |
if ( ! GFCommon::is_form_editor() ) { | |
// form we are adding fields to | |
$parent_id = $form['id']; | |
// template form ID | |
$childId = 5; |
View custom_set_limit.php
function custom_set_limit( $at_limit, $user_id ) { | |
if ( is_user_logged_in() && ! current_user_can( 'administrator' ) ) { | |
if ( empty( $user_id ) ) { | |
$user_id = get_current_user_id(); | |
} | |
$resume_args = array( | |
'post_type' => 'resume', |
View bp_reg_assign_users
/** | |
* Assign users to groups upon registration | |
*/ | |
function group_user_activate( $user_id ) { | |
if ( ! function_exists( 'groups_join_group' ) ) { | |
return; | |
} | |
if ( is_page( 'registration' ) || is_page( 'other-registration' ) ) { |
View bp_assignuser_forum
/** | |
* Assign users to forums upon registration | |
*/ | |
function sc_user_activate_forum( $user_id ) { | |
$current_user = get_user_by( 'ID', $user_id ); | |
// Subscribe to forums in listed IDs | |
if ( groups_is_user_member( $user_id, 7 ) ) { | |
$forum_ids = array( | |
997, | |
1070, |
NewerOlder