最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Prefixing widget_posts_args Hook

programmeradmin4浏览0评论

I am working on a theme that I am trying to submit to wordpress. I tested the code with theme sniffer plugin and I have the following error:

Hook names invoked by a theme/plugin should start with the theme/plugin prefix. 
Found: "widget_posts_args".

My code is the following:

    $nasio_r = new WP_Query( apply_filters( 'widget_posts_args', array(
        'posts_per_page'      => 3,
        'no_found_rows'       => true,
        'post_status'         => 'publish',
        'ignore_sticky_posts' => true
    ) ) );

How should I add the prefix without breaking the code?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论