Skip to content

Instantly share code, notes, and snippets.

function is_site_admin(){
return in_array('administrator', wp_get_current_user()->roles);
}
if (is_site_admin()) {
add_filter('wcfm_marketplace_settings_fields_general', 'add_vendor_verified', 10, 2);
add_action( 'wcfm_vendor_settings_update', 'fn_wcfm_vendor_settings_storetype_update', 30, 2);
}
function add_vendor_verified($settings_fields_general, $vendor_id){
@faceonline
faceonline / wp-auto-login-single-user.php
Last active January 15, 2024 05:35 — forked from cliffordp/functions.php
Automatically login a single WordPress user upon arrival to a specific page. Redirect to home page once logged in. Prevent viewing the login page. Tested with WP 3.9.1. Used in functions.php
<?php
//Automatically login a single WordPress user upon arrival to a specific page.
//Redirect to home page once logged in and prevent viewing of the login page.
//Tested with WP 3.9.1. Used in functions.php
//Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
//From http://tourkick.com/2014/wordpress-demo-multisite-db-reset/
function auto_login() {
//change these 2 items
$loginpageid = '1234'; //Page ID of your login page