View Twitter like post load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_ajax_and_action', 'add_next_post'); | |
function add_next_post() | |
{ | |
$query_string = $_POST['query_string']; | |
$offset = $_POST['paged'] * get_settings('posts_per_page'); | |
$per_page = get_settings('posts_per_page'); | |
query_posts("$query_string&offset=$offset&posts_per_page=$per_page"); |
View gist:2057532
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('admin_init', 'add_meta_boxes', 1); | |
function add_meta_boxes() { | |
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high'); | |
} | |
function repeatable_meta_box_display() { | |
global $post; |
View gist:2253622
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_meta_boxes() { | |
wp_enqueue_style( 'mytabs-css', get_bloginfo( 'stylesheet_directory' ). '/tab/metabox-tabs.css'); | |
wp_enqueue_script( 'mytabs', get_bloginfo( 'stylesheet_directory' ). '/tab/mytabs.js', array( 'jquery-ui-tabs' ) ); | |
add_meta_box( | |
'repeatable-fields', | |
'Playlist', | |
'repeatable_meta_box_display', | |
'post', |
View gist:2416044
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('.metabox_submit').click(function(e) { | |
e.preventDefault(); | |
$('#publish').click(); | |
}); | |
$('#add-row').on('click', function() { | |
var row = $('.empty-row.screen-reader-text').clone(true); | |
row.removeClass('empty-row screen-reader-text'); | |
row.insertBefore('#repeatable-fieldset-one tbody>tr:last'); | |
return false; |
View gist:2416055
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_meta_boxes() { | |
wp_enqueue_style( 'mytabs-css', get_bloginfo( 'stylesheet_directory' ). '/tab/metabox-tabs.css'); | |
wp_enqueue_script( 'mytabs', get_bloginfo( 'stylesheet_directory' ). '/tab/mytabs.js', array( 'jquery-ui-tabs' ) ); | |
add_meta_box( | |
'repeatable-fields', | |
'Playlist', | |
'repeatable_meta_box_display', | |
'post', |
View gist:2416071
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('.repeatable-add').click(function() { | |
field = jQuery(this).closest('td').find('.custom_repeatable li:last').clone(true); | |
fieldLocation = jQuery(this).closest('td').find('.custom_repeatable li:last'); | |
jQuery('input', field).val('').attr('name', function(index, name) { | |
return name.replace(/(\d+)/, function(fullMatch, n) { | |
return Number(n) + 1; | |
}); | |
}) | |
field.insertAfter(fieldLocation, jQuery(this).closest('td')) | |
return false; |
View gist:2551561
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_meta_boxes() { | |
wp_enqueue_style( 'mytabs-css', get_bloginfo( 'stylesheet_directory' ). '/tab/metabox-tabs.css'); | |
wp_enqueue_script( 'mytabs', get_bloginfo( 'stylesheet_directory' ). '/tab/mytabs.js', array( 'jquery-ui-tabs' ) ); | |
add_meta_box( | |
'repeatable-fields', | |
'Playlist', | |
'repeatable_meta_box_display', | |
'post', |
View wordpress auto backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Backup the database of a given WordPress site. | |
using http://www.bin-co.com/blog/2008/10/remote-database-backup-wordpress-plugin/ | |
*/ | |
$site_url = 'http://yoursite.com'; //The URL of the online wordpress site | |
$username = 'admin'; // Admin username | |
$password = 'not_my_password'; // Admin password |
View export.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress Export Administration API | |
* | |
* @package WordPress | |
* @subpackage Administration | |
*/ | |
/** | |
* Version number for the export format. |
View gist:6668055
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if($type == 'youtube'){ | |
$playlist_id = $_POST['convert']; | |
if($old !== 'Data'){ | |
$url = "https://gdata.youtube.com/feeds/api/playlists/".$playlist_id."?v=2&alt=json&max-results=50"; | |
$data = json_decode(file_get_contents($url),true); | |
$info = $data["feed"]; | |
$video = $info["entry"]; | |
for($i=0;$i<count($video);$i++){ | |
if($video[$i]['link'][0]['href'] != ""){ | |
$text_title = str_replace("'", '', $video[$i]['title']['$t']); |
OlderNewer