Skip to content

Instantly share code, notes, and snippets.

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

Parsa Kafi parsakafi

🏠
Working from home
View GitHub Profile
@parsakafi
parsakafi / myplugin.php
Last active November 23, 2021 23:07
Example WordPress Options Page
<?php
/*
Plugin Name: MyPlugin
Plugin URI: http://parsa.ws
Description: MyPlugin
Author: Parsa Kafi
Version: 1.0
Author URI: http://parsa.ws
*/
@parsakafi
parsakafi / functions.php
Created October 31, 2017 22:25
WordPress current_user_can set array capability
function current_user_can_vy($caps, $all_capability = false)
{
if (is_array($caps)) {
foreach ($caps as $cap) {
$capability = current_user_can($cap);
if (!$all_capability && $capability)
return true;
elseif ($all_capability && !$capability)
return false;
}
@parsakafi
parsakafi / functions.php
Last active December 3, 2017 15:36
wp_dropdown_categories multi select
<?php
function wp_dropdown_categories_pk($name, $taxonomy, $selected = array())
{
$select = wp_dropdown_categories(array(
'name' => $name,
'show_option_none' => '- Category -',
'option_none_value' => '-1',
'taxonomy' => $taxonomy,
'hierarchical' => 1,
'echo' => false
@parsakafi
parsakafi / readme.txt
Last active November 14, 2016 09:32
t.co bypass
fairly self explanatory, but just in case, this package will replace t.co urls on twitter and tweetdeck by using other attributes in the anchor tag.
install in firefox with Greasmonkey addon and in google chrome with Tampermonkey
Install:
https://openuserjs.org/scripts/parsa-kafi/t.co_bypass
@parsakafi
parsakafi / index.html
Last active November 4, 2016 22:45
Fix Footer With CSS & Jquery/JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Fix Footer With CSS & Jquery/JS</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="public.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>