Esempio n. 1
0
 public static function action_links($links, $record)
 {
     if ($sidebar = mainwp_wp_stream_get_meta($record->ID, 'sidebar_id', true)) {
         global $wp_registered_sidebars;
         if (array_key_exists($sidebar, $wp_registered_sidebars)) {
             $links[__('Edit Widget Area', 'mainwp-child-reports')] = admin_url('widgets.php#' . $sidebar);
             // xss ok (@todo fix WPCS rule)
         }
     }
     return $links;
 }
 public static function action_links($links, $record)
 {
     if ('wordpress' === $record->context && 'updated' === $record->action) {
         global $wp_version;
         $version = mainwp_wp_stream_get_meta($record->ID, 'new_version', true);
         if ($version === $wp_version) {
             $links[__('About', 'mainwp-child-reports')] = admin_url('about.php?updated');
         }
         $links[__('View Release Notes', 'mainwp-child-reports')] = esc_url(sprintf('http://codex.wordpress.org/Version_%s', $version));
     }
     return $links;
 }
Esempio n. 3
0
 public static function action_links($links, $record)
 {
     if (current_user_can('edit_theme_options')) {
         $file_name = mainwp_wp_stream_get_meta($record->ID, 'file', true);
         $theme_slug = mainwp_wp_stream_get_meta($record->ID, 'theme_slug', true);
         if ('' !== $file_name && '' !== $theme_slug) {
             $links[__('Edit File', 'mainwp-child-reports')] = admin_url(sprintf('theme-editor.php?theme=%s&file=%s', $theme_slug, $file_name));
             $links[__('Edit Theme', 'mainwp-child-reports')] = admin_url(sprintf('themes.php?theme=%s', $theme_slug));
         }
     }
     return $links;
 }
    public static function widget_row($item, $i = null)
    {
        require_once MainWP_WP_STREAM_INC_DIR . 'class-wp-stream-author.php';
        $author_meta = mainwp_wp_stream_get_meta($item->ID, 'author_meta', true);
        $author = new MainWP_WP_Stream_Author((int) $item->author, $author_meta);
        $time_author = sprintf(_x('%1$s ago by <a href="%2$s">%3$s</a>', '1: Time, 2: User profile URL, 3: User display name', 'stream'), human_time_diff(strtotime($item->created)), esc_url($author->get_records_page_url()), esc_html($author->get_display_name()));
        if ($author->get_agent()) {
            $time_author .= sprintf(' %s', MainWP_WP_Stream_Author::get_agent_label($author->get_agent()));
        }
        $class = isset($i) && $i % 2 ? 'alternate' : '';
        ob_start();
        ?>
<li class="<?php 
        echo esc_html($class);
        ?>
" data-id="<?php 
        echo esc_html($item->ID);
        ?>
">
			<div class="record-avatar">
				<a href="<?php 
        echo esc_url($author->get_records_page_url());
        ?>
">
					<?php 
        echo $author->get_avatar_img(72);
        // xss ok
        ?>
				</a>
			</div>
			<span class="record-meta"><?php 
        echo $time_author;
        // xss ok
        ?>
</span>
			<br />
			<?php 
        echo esc_html($item->summary);
        ?>
		</li><?php 
        return ob_get_clean();
    }
Esempio n. 5
0
 public static function action_links($links, $record)
 {
     $post = get_post($record->object_id);
     if ($post && $post->post_status === mainwp_wp_stream_get_meta($record->ID, 'new_status', true)) {
         $post_type_name = self::get_post_type_name(get_post_type($post->ID));
         if ('trash' === $post->post_status) {
             $untrash = wp_nonce_url(add_query_arg(array('action' => 'untrash', 'post' => $post->ID), admin_url('post.php')), sprintf('untrash-post_%d', $post->ID));
             $delete = wp_nonce_url(add_query_arg(array('action' => 'delete', 'post' => $post->ID), admin_url('post.php')), sprintf('delete-post_%d', $post->ID));
             $links[sprintf(esc_html_x('Restore %s', 'Post type singular name', 'mainwp-child-reports'), $post_type_name)] = $untrash;
             $links[sprintf(esc_html_x('Delete %s Permenantly', 'Post type singular name', 'mainwp-child-reports'), $post_type_name)] = $delete;
         } else {
             $links[sprintf(esc_html_x('Edit %s', 'Post type singular name', 'mainwp-child-reports'), $post_type_name)] = get_edit_post_link($post->ID);
             if ($view_link = get_permalink($post->ID)) {
                 $links[esc_html__('View', 'default')] = $view_link;
             }
             if ($revision_id = mainwp_wp_stream_get_meta($record->ID, 'revision_id', true)) {
                 $links[esc_html__('Revision', 'default')] = get_edit_post_link($revision_id);
             }
         }
     }
     return $links;
 }