Skip to content

Instantly share code, notes, and snippets.

View webdevid's full-sized avatar
🎯
Focusing

dodi hidayatullah webdevid

🎯
Focusing
View GitHub Profile
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
/**
* @author Roman Ožana <[email protected]>
*/
class CountEmail {
/**
* @return MailFrom
*/
public static function init() {
<?php
/**
* Copyright (c) 2011 Roman Ožana. All rights reserved.
*
* @author Roman Ožana <[email protected]>
* @link www.omdesign.cz
*/
class WpSqlHelper {
/**
* @var \wpdb
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
/*
* 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
*/
<?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.",