Skip to content

Instantly share code, notes, and snippets.

View webdevid's full-sized avatar
🎯
Focusing

dodi hidayatullah webdevid

🎯
Focusing
View GitHub Profile
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-site.com', 'http://www.new-site.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-site.com','http://www.new-site.com');
UPDATE wp_posts SET post_content = replace(post_content, ' http://www.ancien-site.com ', ' http://www.nouveau-site.com ');
<?php
/**
* Copyright (c) 2011 Roman Ožana. All rights reserved.
*
* @author Roman Ožana <[email protected]>
* @link www.omdesign.cz
*/
class WpSqlHelper {
/**
* @var \wpdb
<?php
/**
* @author Roman Ožana <[email protected]>
*/
class CountEmail {
/**
* @return MailFrom
*/
public static function init() {
function rh_get_widget_data_for($sidebar_name) {
global $wp_registered_sidebars, $wp_registered_widgets;
// Holds the final data to return
$output = array();
// Loop over all of the registered sidebars looking for the one with the same name as $sidebar_name
$sibebar_id = false;
foreach( $wp_registered_sidebars as $sidebar ) {
if( $sidebar['name'] == $sidebar_name ) {
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@webdevid
webdevid / sc-jp.html
Last active August 29, 2015 14:25 — forked from miduku/sc-jp.html
<!-- JSPLAYER -->
<div id="jquery_jplayer_1" class="jp-jplayer">
</div><!-- jquery_jplayer_1 -->
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-playlist">
<div class="cover">
<a href="#"><img src="#.jpg" alt="#"></a>
<div class="jp-gui">
<div class="jp-interface">
@webdevid
webdevid / php-html-css-js-minifier.php
Created October 13, 2016 02:07 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* ----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/engine/plug/converter.php`
* ----------------------------------------------------------------------------------------
*/