0

我创建了 wordpress 仪表板小部件来显示来自我运行的另一个站点的提要。我想按照发布日期的修改日期订购它。我可以想象这可能是不可能的,我至少可以显示修改后的日期吗?谢谢

function dashboard_custom_feed_changelog() {
    $feeds = array(
        array(
          'url' => 'https://website.com/tag/changelog/feed/',
          'title' => 'Feed Title',
          'items' => 20,
          'show_summary' => 1,
          'show_author' => 0,
          'show_date' => 1,
          'orderby' => 'post_modified' 
     ));
        ob_start(); 
    wp_dashboard_primary_output( 'dw_dashboard_widget_onion', $feeds );
    $buffer = ob_get_clean(); 

    $result = str_replace("<a class='rsswidget'",
                          "<a class='rsswidget' target='_blank'", $buffer);
    echo $result;

}
add_action('wp_dashboard_setup', 'wpc_dashboard_widgets'); ````
4

0 回答 0