diff --git a/get_stories.php b/get_stories.php index 2e7deae..d407c2a 100644 --- a/get_stories.php +++ b/get_stories.php @@ -175,14 +175,16 @@ public function __construct() { return; } add_action( 'admin_menu', array( &$this, 'admin_menu' ) ); - add_action( 'load-posts_page_get-npr-stories', array( $this, 'load_page_hook' ) ); } /** - * Register the admin menu for "Get NPR Stories" + * Register the admin menu for "Get NPR Stories" for the post type assigned as the "Pull Post Type" */ public function admin_menu() { - add_posts_page( 'Get NPR Stories', 'Get NPR Stories', 'edit_posts', 'get-npr-stories', 'nprstory_get_stories' ); + $pull_post_type = $this->nprstory_get_pull_post_type(); + $slug_args = ( $pull_post_type != 'post' ) ? "?post_type=$pull_post_type" : ''; + $hook_suffix = add_submenu_page( "edit.php$slug_args", 'Get NPR Stories', 'Get NPR Stories', 'edit_posts', 'get-npr-stories', 'nprstory_get_stories' ); + add_action( 'load-' . $hook_suffix, array( $this, 'load_page_hook' ) ); } } diff --git a/get_stories_ui.php b/get_stories_ui.php index f8f2c74..f9d4431 100644 --- a/get_stories_ui.php +++ b/get_stories_ui.php @@ -32,7 +32,9 @@ function nprstory_update_column_content ( $column_name, $post_ID ) { $retrieved = get_post_meta( $post_ID, NPR_RETRIEVED_STORY_META_KEY, true ); if ($retrieved) { $api_id = get_post_meta( $post_ID, NPR_STORY_ID_META_KEY, TRUE ); - echo ( ' Update ' ); + $pull_post_type = DS_NPR_API::nprstory_get_pull_post_type(); + $post_type_arg = ($pull_post_type != 'post') ? "&post_type=$pull_post_type" : ''; + echo ( ' Update ' ); } } }