Ejemplo n.º 1
0
 function display_feed_settings_page_links($params = array())
 {
     global $fwp_path;
     $params = wp_parse_args($params, array('before' => '', 'between' => ' | ', 'after' => '', 'long' => false, 'subscription' => $this->link));
     $sub = $params['subscription'];
     $links = array("Feed" => array('page' => 'feeds-page.php', 'long' => 'Feeds & Updates'), "Posts" => array('page' => 'posts-page.php', 'long' => 'Posts & Links'), "Authors" => array('page' => 'authors-page.php', 'long' => 'Authors'), 'Categories' => array('page' => 'categories-page.php', 'long' => 'Categories & Tags'));
     $link_id = NULL;
     if (is_object($sub)) {
         if (method_exists($sub, 'found')) {
             if ($sub->found()) {
                 $link_id = $sub->link->link_id;
             }
         } else {
             $link_id = $sub->link_id;
         }
     }
     print $params['before'];
     $first = true;
     foreach ($links as $label => $link) {
         if (!$first) {
             print $params['between'];
         }
         if (isset($link['url'])) {
             MyPHP::url($link['url'], array("link_id" => $link_id));
         } else {
             $url = $this->admin_page_href($link['page'], array(), $sub);
         }
         $url = esc_html($url);
         if ($link['page'] == basename($this->filename)) {
             print "<strong>";
         } else {
             print "<a href=\"{$url}\">";
         }
         if ($params['long']) {
             print esc_html(__($link['long']));
         } else {
             print esc_html(__($label));
         }
         if ($link['page'] == basename($this->filename)) {
             print "</strong>";
         } else {
             print "</a>";
         }
         $first = false;
     }
     print $params['after'];
 }
 public function get_categories()
 {
     $terms = wp_get_object_terms($this->post->ID, get_taxonomies(array('public' => true), 'names'), 'all');
     $rootUrl = get_bloginfo('url');
     $cats = array();
     foreach ($terms as $term) {
         $taxUrl = MyPHP::url($rootUrl, array("taxonomy" => $term->taxonomy));
         //array("taxonomy" => $term->taxonomy ));
         $cats[] = new SimplePie_Category($term->slug, $taxUrl, $term->name);
     }
     return $cats;
 }
Ejemplo n.º 3
0
 function row_actions($actions, $post)
 {
     if (is_syndicated($post->ID)) {
         $link = get_delete_post_link($post->ID, '', true);
         $link = MyPHP::url($link, array("fwp_post_delete" => "nuke"));
         $caption = 'Erase the record of this post (will be re-syndicated if it still appears on the feed).';
         $linktext = 'Erase/Resyndicate';
         $keys = array_keys($actions);
         $links = array();
         foreach ($keys as $key) {
             $links[$key] = $actions[$key];
             if ('trash' == $key) {
                 $links[$key] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash (will NOT be re-syndicated)')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash/Don&#8217;t Resyndicate') . "</a>";
                 // Placeholder.
                 $links['delete'] = '';
             }
         }
         $links['delete'] = '<a class="submitdelete" title="' . esc_attr(__($caption)) . '" href="' . $link . '">' . __($linktext) . '</a>';
         $actions = $links;
     }
     return $actions;
 }
Ejemplo n.º 4
0
 public function row_actions($actions, $post)
 {
     if (is_syndicated($post->ID) && current_user_can('edit_post', $post->ID)) {
         $link = get_delete_post_link($post->ID, '', true);
         $eraseLink = MyPHP::url($link, array("fwp_post_delete" => "nuke"));
         $caption = apply_filters('feedwordpress_ui_erase_link_caption', __('Erase the record of this post (will be re-syndicated if it still appears on the feed).'));
         $linktext = apply_filters('feedwordpress_ui_erase_link_text', __('Erase/Resyndicate'));
         $retireClass = NULL;
         if ($post->post_status == 'fwpzapped') {
             if (count(get_post_meta($post->ID, '_feedwordpress_zapped_blank_me')) > 0) {
                 $retireCap = 'Un-Zap this syndicated post (so it will appear on the site again)';
                 $retireText = 'Un-Zap &amp; Restore';
                 $retireLink = MyPHP::url($link, array("fwp_post_delete" => "unzap"));
             } else {
                 // No Un-Zap link for posts that have
                 // been blanked. You'll just have to
                 // Erase and hope you can resyndicate...
                 $retireLink = NULL;
             }
         } else {
             $retireCap = apply_filters('feedwordpress_ui_zap_link_caption', __('Zap this syndicated post (so it will not be re-syndicated if it still appears on the feed).'));
             $retireText = apply_filters('feedwordpress_ui_zap_link_text', __('Zap/Don&#8217;t Resyndicate'));
             $retireLink = MyPHP::url($link, array("fwp_post_delete" => "zap"));
             $retireClass = 'submitdelete';
         }
         $keys = array_keys($actions);
         $links = array();
         foreach ($keys as $key) {
             $links[$key] = $actions[$key];
             if ('trash' == $key) {
                 #$links[$key] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash (will NOT be re-syndicated)' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
                 // Placeholder.
                 if (!is_null($retireLink)) {
                     $links['zap trash'] = '';
                 }
                 $links['delete'] = '';
             }
         }
         if (!is_null($retireLink)) {
             $links['zap trash'] = '<a class="' . esc_attr($retireClass) . '" title="' . esc_attr(__($retireCap)) . '" href="' . $retireLink . '">' . __($retireText) . '</a>';
         }
         $links['delete'] = '<a class="submitdelete" title="' . esc_attr(__($caption)) . '" href="' . $eraseLink . '">' . __($linktext) . '</a>';
         $actions = $links;
     }
     return $actions;
 }