Skip to content

Instantly share code, notes, and snippets.

View gmatta01's full-sized avatar
🏠
Working from home

G Matta gmatta01

🏠
Working from home
  • 04:43 (UTC +05:30)
View GitHub Profile
<?php
/**
* The plugin bootstrap file
*
* @wordpress-plugin
* Plugin Name: AcfRepeater
* Description: Add acf-repeater dynamic tag
* Version: 1.0.0
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@gmatta01
gmatta01 / PHP Set Timezone By Offset
Created April 24, 2020 04:05 — forked from kyleweiner/PHP Set Timezone By Offset
PHP: A snippet for setting the default timezone using a GMT offset.
// Set the default timezone using a GMT offset
$offset = -5; // GMT offset
$is_DST = FALSE; // observing daylight savings?
$timezone_name = timezone_name_from_abbr('', $offset * 3600, $is_DST); // e.g. "America/New_York"
date_default_timezone_set($timezone_name);
@gmatta01
gmatta01 / wpum_conditional_role_redirect_after_login.php
Created November 6, 2019 14:10 — forked from wp-user-manager/wpum_conditional_role_redirect_after_login.php
WP User Manager - Redirect users to different pages after login based on use role
<?php
function wpum_set_logged_in_user( $user_login, $user ) {
if ( ! defined( 'WPUM_VERSION' ) || version_compare( WPUM_VERSION, '2.1.12', '>' ) ) {
return;
}
wp_set_current_user( $user->ID );
}
add_action( 'wp_login', 'wpum_set_logged_in_user', 10, 2 );
<?php
/**
* Plugin Name: AffWP Custom Meta Box Example
* Plugin URI: https://affiliatewp.com
* Description: AffWP Custom Meta Box Example
* Author: AffiliateWP, LLC
* Author URI: https://affiliatewp.com
* Version: 1.0
* Text Domain: affwp-custom-meta-box-example
* */