Skip to content

Instantly share code, notes, and snippets.

View mahdiyazdani's full-sized avatar
:bowtie:
Still Rocking!

Mahdi Yazdani mahdiyazdani

:bowtie:
Still Rocking!
View GitHub Profile
@w3guy
w3guy / gist:09a4c5258f75e97f78e1
Created June 17, 2015 15:47
BBPress login, registration, password reset link integration to forum
<?php
/**
* Plugin Name: Bbpress Login Register Links On Forum Topic Pages
* Plugin URI: http://tomas.zhu.bz/bbpress-plugin-bbpress-login-register-links-on-forum-page-and-topic.html/
* Description: Add bbpress login link, register links, on forum pages or topic pages so users can use our forums more easier. Any feature request is welcome to support to our <a href='http://tomas.zhu.bz/forums/forum/bbpress-notification-plugin-support/'>Support Forum</a>, like our plugin? <a href='https://wordpress.org/support/view/plugin-reviews/bbpress-login-register-links-on-forum-topic-pages/'>Submit a review</a>
* Author: Tomas Zhu
* Author URI: http://tomas.zhu.bz
* Version: 1.1.0
*/
function bbpressLoginRegisterLinksOnForumPage()
@cramdesign
cramdesign / gallery-style.css
Created April 16, 2014 23:50
WordPress 3.9 ships with the ability to add HTML5 support for galleries which will now use figure and figcaption to display images. This is a huge change for the better! Bonus: br tag used for clearing rows has been cleaned out as well. While all of this is good news for more semantic markup, one might now be left wondering how to style the new …
@gilbitron
gilbitron / wp-updates-theme.php
Created September 4, 2012 14:12
WPUpdates Theme Updater Class (with Envato API verification)
<?php
/*
WPUpdates Theme Updater Class (with Envato API verification)
http://wp-updates.com
v1.1
Example Usage:
require_once('wp-updates-theme.php');
new WPUpdatesThemeUpdater( 'http://wp-updates.com/api/1/theme', 1, basename(get_template_directory()) );
*/
@appastair
appastair / jsonp.js
Last active August 23, 2020 17:52
Cross-domain JSONP Example (jQuery/PHP)
jQuery(function($){
$.ajax({
type: 'GET',
url: '//remote.org/jsonp.php',
data: {
field: 'value'
},
dataType: 'jsonp'
crossDomain: true,
}).done(function(response){
@pejantantangguh
pejantantangguh / Bacs default to pending Payment.php
Last active November 6, 2020 14:44
Plugins to overide Bank Transfer from on Hold to Pending Payment WooCommerce
<?php
/*
Plugin Name: bacs-to-pending-payment
Description: Change bank transfer default order status from on Hold to pending payment
Version: 1.0.0
Contributors: Suherman Ng
Author: Suherman NG
Author URI:
License: GPLv2 or later
Text Domain: CAF website
@paaljoachim
paaljoachim / add-link-top-admin-menu.php
Last active March 25, 2022 07:50
Adjusting the WordPress top admin toolbar
@shizhua
shizhua / category_add_form_fields.php
Last active July 19, 2022 03:23
Add custom field to Category and taxonomies
<?php
// Add the field to the Add New Category page
add_action( 'category_add_form_fields', 'pt_taxonomy_add_new_meta_field', 10, 2 );
function pt_taxonomy_add_new_meta_field() {
// this will add the custom meta field to the add new term page
?>
<div class="form-field">
<label for="term_meta[cat_icon]"><?php _e( 'Font Awesome Icons', 'pt' ); ?></label>
<input type="text" name="term_meta[cat_icon]" id="term_meta[cat_icon]" value="">
@helen
helen / repeatable-fields-metabox.php
Created January 11, 2012 04:42
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@Tabrisrp
Tabrisrp / gist:13348dbcd2bbb0d9406f
Created April 14, 2015 14:32
WordPress customizer custom tinymce control
class Text_Editor_Custom_Control extends WP_Customize_Control
{
public $type = 'textarea';
/**
** Render the content on the theme customizer page
*/
public function render_content() { ?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php
@hlashbrooke
hlashbrooke / class.php
Created February 28, 2014 08:37
A complete, versatile options page class for any WordPress plugin
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
class WordPress_Plugin_Template_Settings {
private $dir;
private $file;
private $assets_dir;
private $assets_url;
private $settings_base;