Created
April 25, 2012 17:51
-
-
Save aforwark/2491641 to your computer and use it in GitHub Desktop.
flash panel plugin
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: Flash Panels | |
Description: This plugin handles the flash panels that can be used on SheKnows Blogs | |
*/ | |
class FlashPanelPostType | |
{ | |
private $args = array( | |
'labels' => array(), | |
'hierarchical' => true, | |
'supports' => array( 'title', 'editor', 'author', 'revisions', 'thumbnail'), | |
'taxonomies' => array( 'category', 'post_tag', 'page-category' ), | |
'public' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'menu_position' => 5, | |
'show_in_nav_menus' => true, | |
'publicly_queryable' => true, | |
'exclude_from_search' => false, | |
'has_archive' => true, | |
'query_var' => true, | |
'can_export' => true, | |
'rewrite' => true, | |
'capability_type' => 'post' | |
); | |
public function init() | |
{ | |
$this->args['labels'] = array( | |
'name' => _x( 'Flash Panels', 'flash_panel' ), | |
'singular_name' => _x( 'Flash Panel', 'flash_panel' ), | |
'add_new' => _x( 'Add New', 'flash_panel' ), | |
'add_new_item' => _x( 'Add New flash panel', 'flash_panel' ), | |
'edit_item' => _x( 'Edit flash panel', 'flash_panel' ), | |
'new_item' => _x( 'New flash panel', 'flash_panel' ), | |
'view_item' => _x( 'View flash panel', 'flash_panel' ), | |
'search_items' => _x( 'Search flash panels', 'flash_panel' ), | |
'not_found' => _x( 'No flash panels found', 'flash_panel' ), | |
'not_found_in_trash' => _x( 'No flash panels found in Trash', 'flash_panel' ), | |
'parent_item_colon' => _x( 'Parent flash panel:', 'flash_panel' ), | |
'menu_name' => _x( 'Flash Panels', 'flash_panel' ), | |
); | |
register_post_type( 'flashpanel', $this->args ); | |
} | |
} | |
$_fp = new FlashPanelPostType(); | |
add_action('init', array($_fp, 'init')); | |
function get_flashpanels($limit = 9) { | |
$flashpanels = new WP_Query(array( | |
'post_type' => array('flash_panel'), | |
'orderby' => 'menu_order', | |
'order' => 'ASC', | |
'nopaging' => true | |
)); | |
echo 'test'; | |
while ($flashpanels->have_posts()): $flashpanels->the_post(); | |
?> | |
<li> | |
<div class="entry-excerpt"> | |
<a href="<?php echo the_permalink(); ?>"><?php the_title(); ?></a> | |
<span class="bubble"></span> | |
</div> | |
</li> | |
<?php | |
endwhile; wp_reset_query(); // Important! Omitting this borks the main loop. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment