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
@icetee
icetee / wp_ext_pll_functions.php
Last active March 20, 2023 12:54
Polylang function_exists (active the plugin) - WordPress - Paste the code into functions.php
/*
* Polylang Language API functions tester - WordPress
* Github: https://gist.github.com/icetee/fbbfef5534fead58611e
*
*/
function ex_pll_the_languages($arg = '') {
if ( function_exists('pll_the_languages') ) {
return pll_the_languages($arg);
}
@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()
@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
@paaljoachim
paaljoachim / add-link-top-admin-menu.php
Last active March 25, 2022 07:50
Adjusting the WordPress top admin toolbar
@BFTrick
BFTrick / woocommerce-settings-tab-demo.php
Last active March 26, 2024 10:48
A plugin demonstrating how to add a WooCommerce settings tab.
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@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 …
@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;
@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){
@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()) );
*/
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/