This file contains hidden or 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
DELETE FROM wp_posts; | |
DELETE FROM wp_post_meta; | |
TRUNCATE TABLE wp_posts; | |
TRUNCATE TABLE wp_post_meta; |
This file contains hidden or 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 | |
/* | |
Plugin Name: Admin Filter BY Custom Fields | |
Plugin URI: http://en.bainternet.info | |
Description: Filter posts or pages in admin by custom fields (post meta) | |
Version: 1.0 | |
Author: Bainternet | |
Author URI: http://en.bainternet.info | |
*/ |
This file contains hidden or 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
protected void Application_Error() | |
{ | |
var unhandledException = Server.GetLastError(); | |
var httpException = unhandledException as HttpException; | |
if (httpException == null) | |
{ | |
var innerException = unhandledException.InnerException; | |
httpException = innerException as HttpException; | |
} |
This file contains hidden or 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
# This is a template .gitignore file for git-managed WordPress projects. | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your | |
# content. Or see git's documentation for more info on .gitignore files: |
This file contains hidden or 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
add_action('init','add_categories_to_cpt', 200); | |
function add_categories_to_cpt(){ | |
register_taxonomy_for_object_type('search_tags', 'post_type'); | |
} |
This file contains hidden or 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
add_action( 'init', 'update_taxonomy'); | |
function update_taxonomy() { | |
$posts = get_posts( | |
array( | |
'post_type' => 'post', | |
'posts_per_page' => -1 | |
) | |
); |
This file contains hidden or 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
add_action( 'init', 'update_taxonomy'); | |
function update_taxonomy() { | |
$posts = get_posts( | |
array( | |
'post_type' => 'page', | |
'posts_per_page' => -1, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'content_category', |
This file contains hidden or 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
// Regex via http://stackoverflow.com/a/6582227/12442 | |
// jQuery Filter idea via http://stackoverflow.com/a/193787/12442 | |
jQuery(function() { | |
jQuery('a').filter(function() { | |
return this.href.match(/\.([0-9a-z]+)(?:[\?#]|$)/i); | |
}).prop('target', '_blank'); | |
}); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Simple KnockoutJS Paging With DataTables.net</title> | |
<!-- Bootstrap --> | |
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> |
This file contains hidden or 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
// create a new Post in WordPress | |
var post = new Post | |
{ | |
PostType = "post", // "post" or "page" | |
Title = "Using WordPressSharp", | |
Content = "WordPressSharp is a C# utility for interfacing with the WordPress XML-RPC API", | |
PublishDateTime = DateTime.Now, | |
Status = "publish" // "draft" or "publish" | |
}; |