role_objects as $key => $role) { foreach($role->capabilities as $cap => $grant) { $capnames[$cap] = ucwords( str_replace('_', ' ', $cap) ); } } $capnames = apply_filters( 'powerpress_admin_capabilities', array_unique($capnames) ); $remove_keys = array('level_0', 'level_1', 'level_2', 'level_3', 'level_4', 'level_5', 'level_6', 'level_7', 'level_8', 'level_9', 'level_10'); foreach( $remove_keys as $null=> $key ) unset($capnames[ $key ]); asort($capnames); return $capnames; } // powerpressadmin_editfeed.php function powerpress_admin_editfeed($type='', $type_value = '', $feed_slug = false) { $SupportUploads = powerpressadmin_support_uploads(); $General = powerpress_get_settings('powerpress_general'); $FeedAttribs = array('type'=>$type, 'feed_slug'=>'', 'category_id'=>0, 'term_taxonomy_id'=>0, 'term_id'=>0, 'taxonomy_type'=>'', 'post_type'=>''); $cat_ID = false; $term_taxonomy_id = false; if (defined('WP_DEBUG')) { if (WP_DEBUG) { wp_register_style('powerpress_settings_style', powerpress_get_root_url() . 'css/settings.css', array(), POWERPRESS_VERSION); } else { wp_register_style('powerpress_settings_style', powerpress_get_root_url() . 'css/settings.min.css', array(), POWERPRESS_VERSION); } } else { wp_register_style('powerpress_settings_style', powerpress_get_root_url() . 'css/settings.min.css', array(), POWERPRESS_VERSION); } wp_enqueue_style("powerpress_settings_style"); $MultiSiteServiceSettings = false; if( is_multisite() ) { $MultiSiteSettings = get_site_option('powerpress_multisite'); if( !empty($MultiSiteSettings['services_multisite_only']) ) { $MultiSiteServiceSettings = true; } } $FeedTitle = __('Feed Settings', 'powerpress'); switch( $type ) { case 'channel': { $feed_slug = $type_value; $FeedAttribs['feed_slug'] = $type_value; $FeedSettings = powerpress_get_settings('powerpress_feed_'.$feed_slug); if( !$FeedSettings && $type_value == 'podcast' ) // We are editing the default podcast channel { $FeedSettings = powerpress_get_settings('powerpress_feed'); } if( !$FeedSettings ) { $FeedSettings = array(); $FeedSettings['title'] = ''; if( !empty($General['custom_feeds'][$feed_slug]) ) $FeedSettings['title'] = $General['custom_feeds'][$feed_slug]; } $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom'); if( !isset($General['custom_feeds'][$feed_slug]) ) $General['custom_feeds'][$feed_slug] = __('Podcast (default)', 'powerpress'); $FeedTitle = sprintf( 'Podcast Settings for Channel: %s', htmlspecialchars($General['custom_feeds'][$feed_slug]) ); echo sprintf('', $feed_slug); echo ''; }; break; case 'category': { $cat_ID = $type_value; $FeedAttribs['category_id'] = $type_value; $FeedSettings = powerpress_get_settings('powerpress_cat_feed_'.$cat_ID); $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom'); $category = get_category_to_edit($cat_ID); $FeedTitle = sprintf( __('Podcast Settings for Category: %s', 'powerpress'), htmlspecialchars($category->name) ); echo sprintf('', $cat_ID); echo ''; }; break; case 'ttid': { $term_taxonomy_id = $type_value; $FeedAttribs['term_taxonomy_id'] = $type_value; $FeedSettings = powerpress_get_settings('powerpress_taxonomy_'.$term_taxonomy_id); $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom'); global $wpdb; $term_info = $wpdb->get_results("SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = $term_taxonomy_id", ARRAY_A); if( !empty( $term_info[0]['term_id']) ) { $term_ID = $term_info[0]['term_id']; $taxonomy_type = $term_info[0]['taxonomy']; $FeedAttribs['term_id'] = $term_ID; $FeedAttribs['taxonomy_type'] = $taxonomy_type; $term_object = get_term_to_edit($term_ID, $taxonomy_type); $FeedTitle = sprintf( __('Podcast Settings for Taxonomy Term: %s', 'powerpress'), htmlspecialchars($term_object->name)); } else { $FeedTitle = sprintf( __('Podcast Settings for Taxonomy Term: %s', 'powerpress'), 'Term ID '.htmlspecialchars($term_taxonomy_id)); } echo sprintf('', $term_taxonomy_id); echo ''; }; break; case 'post_type': { $FeedAttribs['post_type'] = $type_value; $FeedAttribs['feed_slug'] = $feed_slug; $FeedSettingsArray = powerpress_get_settings('powerpress_posttype_'.$FeedAttribs['post_type']); if( !is_array($FeedSettingsArray[ $feed_slug ]) ) $FeedSettingsArray[ $feed_slug ] = array(); $FeedSettings = powerpress_default_settings($FeedSettingsArray[ $feed_slug ], 'editfeed_custom'); //$category = get_category_to_edit($cat_ID); $PostTypeTitle = $FeedAttribs['post_type']; // TODO: Get readable title of post type $FeedTitle = sprintf( __('Podcast Settings for Post Type %s with slug %s', 'powerpress'), htmlspecialchars($PostTypeTitle) , htmlspecialchars($feed_slug)); echo sprintf('', $FeedAttribs['post_type']); echo sprintf('', $feed_slug); echo ''; }; break; default: { $FeedSettings = powerpress_get_settings('powerpress_feed'); $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed'); echo ''; }; break; } echo '

'. $FeedTitle .'

'; if( $cat_ID && (isset($_GET['from_categories']) || isset($_POST['from_categories'])) ) { echo ''; } wp_enqueue_script('powerpress-admin', powerpress_get_root_url() . 'js/admin.js', array(), POWERPRESS_VERSION ); ?>








__('Special Podcast only Feed', 'powerpress') ); if( isset($General['custom_feeds']['podcast']) ) $Feeds = $General['custom_feeds']; else if( isset($General['custom_feeds'])&& is_array($General['custom_feeds']) ) $Feeds += $General['custom_feeds']; foreach( $Feeds as $feed_slug=> $feed_title ) { if( empty($feed_title) ) $feed_title = $feed_slug; $edit_link = admin_url( 'admin.php?page=powerpress/powerpressadmin_customfeeds.php&action=powerpress-editfeed&feed_slug=') . $feed_slug; ?>

- -

/>

/>

/>

/>

charset ) { ?>

/>


:

/>

/>

()

value="1" />
$FeedSettings['itunes_cat_1'], 'cat_2' => $FeedSettings['itunes_cat_2'], 'cat_3' => $FeedSettings['itunes_cat_3']); $mappings = array('01-00' => '01-00', '01-01' => '01-02', '01-02' => '01-03', '01-03' => '01-04', '01-04' => '01-01', '01-05' => '01-05', '01-06' => '01-06', '02-00' => '02-00', '02-02' => '02-01', '02-03' => '02-03', '03-00' => '03-00', '04-00' => '04-00', '04-04' => '04-03', '05-04' => '10-05', '07-00' => '07-00', '07-01' => '07-01', '07-04' => '07-06', '08-00' => '09-00', '09-00' => '11-00', '11-00' => '13-00', '11-01' => '13-01', '11-02' => '13-02', '11-03' => '13-03', '11-04' => '13-04', '11-05' => '13-05', '11-07' => '13-07', '12-02' => '14-06', '12-03' => '14-09', '13-00' => '15-00', '13-02' => '15-02', '13-03' => '15-03', '13-04' => '15-04','14-03' => '16-15', '15-00' => '17-00', '16-00' => '19-00'); foreach($CatArray as $key => $value) { if(empty($FeedSettings['apple_'.$key])) { if ($value === '02-01') { // Business > Business News (02-01) to News > Business News (11-01) $FeedSettings['apple_' . $key] = '12-01'; } else if ($value === '15-02') { // Technology > Tech News (15-02) to News > Tech News (11-07) $FeedSettings['apple_' . $key] = '12-07'; } else if ($value === '13-01') { // Society & Culture > History (13-01) to History (08-00) $FeedSettings['apple_' . $key] = '08-00'; } else if ($value === '12-01') { // Science & Medicine > Medicine (12-01) to Health > Medicine (07-03) $FeedSettings['apple_' . $key] = '07-03'; } else if($value === '05-01') { // Games & Hobbies > Automotive (05-01) to Leisure > Automotive (10-02) $FeedSettings['apple_'. $key] = '10-02'; } else if($value === '05-02') { // Games & Hobbies > Aviation (05-02) to Leisure > Aviation (10-03) $FeedSettings['apple_'. $key] = '10-03'; } else if($value == '05-03') { // Games & Hobbies > Hobbies (05-03) to Leisure > Hobbies (10-06) $FeedSettings['apple_'. $key] = '10-06'; } else if($value == '05-05') { // Games & Hobbies > Video Games (05-05) to Leisure > Video Games (10-08) $FeedSettings['apple_'. $key] = '10-08'; } else if (array_key_exists($value, $mappings)) { //Category has a 1:1 mapping $FeedSettings['apple_'. $key] = $mappings[$value]; } } } ?>


/>

/>

'; echo __('Please enter an Apple Podcasts category to prepare yourself for the new 2019 categories', 'powerpress'); echo '

'; } else { echo ''; } ?>

'; echo __('Please enter an Apple Podcasts category to prepare yourself for the new 2019 categories', 'powerpress'); echo '

'; } else { echo ''; } ?>

'; echo __('Please enter an Apple Podcasts category to prepare yourself for the new 2019 categories', 'powerpress'); echo '

'; } else { echo ''; } ?>


/>




all podcast clients including iTunes to your new feed address.', 'powerpress'); ?>

' ) ); ?>

name) ); if( !empty($General['cat_casting_podcast_feeds']) ) $FeedURL = get_category_feed_link($cat_ID, 'podcast'); else $FeedURL = get_category_feed_link($cat_ID); } else if( $feed_slug ) { if( !empty($General['custom_feeds'][ $feed_slug ]) ) $FeedName = $General['custom_feeds'][ $feed_slug ]; else $FeedName = __('Podcast', 'powerpress'); $FeedName = trim($FeedName).' '.__('feed', 'powerpress'); $FeedURL = get_feed_link($feed_slug); } else if( $FeedAttribs['type'] == 'ttid' ) { $term_object = get_term_to_edit($FeedAttribs['term_id'],$FeedAttribs['taxonomy_type']); $FeedName = sprintf( __('%s taxonomy term feed', 'powerpress'), htmlspecialchars($term_object->name) ); $FeedURL = get_term_feed_link($FeedAttribs['term_id'],$FeedAttribs['taxonomy_type'], 'rss2'); } echo sprintf(__('The New Feed URL value below will be applied to the %s (%s).', 'powerpress'), $FeedName, $FeedURL); ?>

:

'; echo esc_html( get_feed_link($feed_slug) ); echo ''; } else if( $cat_ID ) { if( !empty($General['cat_casting_podcast_feeds']) ) $feed_url = get_category_feed_link($cat_ID, 'podcast'); else $feed_url = get_category_feed_link($cat_ID); echo ''; echo esc_html( $feed_url ); echo ''; } else { echo ''; echo esc_html( get_feed_link('') ); echo ''; if( empty($General['custom_feeds']['podcast']) ) { echo '
'; echo esc_html( get_feed_link('podcast') ); echo ''; } } ?>

/>

/>