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 akv3_create_projects_terms() { | |
$terms = array( | |
'commercial' => 'Commercial', | |
'deprecated' => 'Deprecated', | |
'featured' => 'Featured', | |
'open-source' => 'Open Source', | |
'wordpress' => 'WordPress', | |
); |
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 akv3_touch_projects_terms() { | |
$projects = get_terms('projects'); | |
foreach ($projects as $project) { | |
wp_update_term($project->term_id, 'projects', array('slug' => $project->slug)); | |
} | |
} |
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 akv3_register_projects_tax() { | |
register_taxonomy( | |
'projects', | |
array('post'), | |
array( | |
'hierarchical' => true, | |
'labels' => array( | |
'name' => __('Projects', 'projects'), |
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 akv3_convert_to_projects() { | |
global $wpdb; | |
// convert categories | |
$wpdb->query(" | |
UPDATE wp_term_taxonomy | |
SET taxonomy = 'projects', | |
parent = 0 | |
WHERE term_id IN (13, 14, 15, 20, 22, 52, 53, 58, 59) |
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 akv3_add_projects_cat() { | |
// find all posts in converted categories and threads | |
$term_ids = array(400, 417, 438, 455, 13, 14, 15, 20, 22, 52, 53, 58, 59); | |
$query = new WP_Query(array( | |
'posts_per_page' => -1, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'projects', |
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 | |
// Create Project post type (bound to Projects taxonomy) to save meta | |
function akv3_projects_tax_bindings($configs) { | |
$configs[] = array( | |
'taxonomy' => 'projects', | |
'post_type' => array( | |
'project', | |
array( | |
'public' => true, |
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 | |
// simplistic way to force http for shortlinks | |
function akv3_get_shortlink($url) { | |
return str_replace('https://', 'http://', $url); | |
} | |
add_filter('get_shortlink', 'akv3_get_shortlink'); |
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 | |
/* | |
Plugin Name: AK.org Hide Post Format Tabs | |
Plugin URI: https://gist.github.com/alexkingorg/5557869 | |
Description: Reduce the footprint of the post format tabs in the WordPress admin UI. | |
Version: 1.0 | |
Author: Alex King | |
Author URI: http://alexking.org | |
License: GPL2 |
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 | |
/* | |
Plugin Name: AK.org Minimalist Post Format Tabs | |
Plugin URI: https://gist.github.com/alexkingorg/5557869 | |
Description: Reduce the footprint of the post format tabs in the WordPress admin UI. | |
Version: 1.0 | |
Author: Alex King | |
Author URI: http://alexking.org | |
License: GPL2 |