Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mertnuhoglu

    (@mertnuhoglu)

    I solved the problem. Here are the instructions if you need it:

    Inside wp-content/plugins/edit-flow/modules/dashboard/dashboard.php

    Find this line:

    wp_add_dashboard_widget( 'post_status_widget', __( 'Unpublished Content', 'edit-flow' ), array( $this, 'post_status_widget' ) );

    Add the following line below (inside if clause):

    wp_add_dashboard_widget( 'page_status_widget', __( 'Unpublished List Reviews', 'edit-flow' ), array( $this, 'page_status_widget' ) );

    Copy the following function:

    function post_status_widget

    Change the duplicated function’s name to:

    page_status_widget

    Inside that function find the following line:

    $post_count = wp_count_posts( 'post' );

    Change it to:

    $post_count = wp_count_posts( 'page' );

    This is enough. If you want to improve the styling as well, then open lib/dashboard.css under the current directory. Copy all the lines containing post_status_widget and change those selector names to page_status_widget.

    Thread Starter mertnuhoglu

    (@mertnuhoglu)

    One more change is required. Change the following line:

    $filter_link = $this->filter_posts_link( $status->slug )
    >
    $filter_link = $this->filter_posts_link( $status->slug, $post_type='page')

    Plugin Contributor Daniel Bachhuber

    (@danielbachhuber)

    Directly modifying the plugin isn’t the best idea because you’ll either need to reapply your changes on every update, or avoid updating the plugin.

    We have an existing issue open for this request. When we get to it, my preference will be to create a table in the existing widget.

    Dear Mertnuhoglu! This fixed it temporarily for my custom type too. @daniel, we will be eagerly waiting for the update — sorry for cross posting about this issue on Github.. as I just noticed this answer!

    Hey Guys! I tried to do the way you described, but I want to see all my different post types, not interested into “pages”. Is there a fix already?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dashboard Widget for Pages and Custom Post Types’ is closed to new replies.