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 | |
/* | |
orphaned-post-types.php | |
View the list at http://yoursite.com/wp-admin/edit.php?orphans=true | |
In response to: http://lists.automattic.com/pipermail/wp-hackers/2010-November/035682.html | |
Not yet complete. |
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 | |
/* | |
PostsByTaxonomy class that extends WP_Query and filters to includes all posts that have any term of a taxonomy. | |
Author: Mike Schinkel (http://mikeschinkel.com) | |
This example works, just drop into the root of your website and call directly. | |
Use the class in your plugins or themes. | |
See: |
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 | |
/* | |
PostsOrderedByMetaQuery class that extends WP_Query and sorts posts meta_key | |
Author: Mike Schinkel (http://mikeschinkel.com) | |
This example works, just drop into the root of your website and call directly. | |
Use the class in your plugins or themes. | |
See: http://stackoverflow.com/questions/4111255/how-to-sort-a-query-posts-function-by-custom-field-while-limiting-posts-by-ano |
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 | |
/* | |
news-items-instead-of-posts.php | |
Changes WordPress "Posts" to be called "News Items" instead. | |
Copy this code into your theme's functions.php file. | |
See comments here: http://markjaquith.wordpress.com/2010/11/12/post-formats-vs-custom-post-types/ |
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 | |
/* | |
List_Custom_Post_Type_Posts_with_AJAX class. | |
Shows how to create a widget with a dropdown list of posts for a given post type and | |
then retrieve HTML specific to the selected post via AJAX to insert into the page. | |
Yes, the name of the class is insanely long in hopes that you'll be forced to think | |
about what would be a better name. |
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: Admin Parse Output | |
Description: Adds a 'admin_parse_output' hook to allow you to parse and modify the HTML generated by the admin when other hooks are not available. Starts HTML capture with the 'admin_init' hook and ends with the 'admin_footer' hook so it will miss anything that comes after 'admin_footer' (see the last lines of /wp-admin/admin-footer.php to see what this hook will miss.) | |
Version: 0.1 | |
Author: Mike Schinkel | |
Author URI: http://mikeschinkel.com | |
Notes: Written for http://lists.automattic.com/pipermail/wp-hackers/2010-November/036150.html | |
Example Usage: See https://gist.github.com/717515 | |
*/ |
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
/* | |
functions.php - Plugin that this example uses: https://gist.github.com/717514 | |
*/ | |
add_action('admin_parse_output', 'yoursite_admin_parse_output'); | |
function yoursite_admin_parse_output($html) { | |
global $pagenow; | |
if ($pagenow=='themes.php' && isset($_GET['page']) && $_GET['page']=='custom-header') { |
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 | |
/* | |
* This approach is what Andrew Nacin suggested[1] instead of [2] and requested via email by Steve Wolfson. | |
* Given it's complexity I can't advise te use of [1] and still recomment [2]. See also: [3][4]. | |
* | |
* Author: Mike Schinkel (http://mikeschinkel.com) | |
* | |
* [1] http://lists.automattic.com/pipermail/wp-hackers/2010-November/036172.html | |
* [2] http://lists.automattic.com/pipermail/wp-hackers/2010-November/036170.html | |
* [3] https://gist.github.com/717514 |