小编sof*_*dev的帖子

为什么the_title()过滤器也适用于菜单标题?

我创建了以下功能来隐藏页面标题.但是当我执行它时,它也隐藏了菜单名称.任何人都可以帮助,我们将非常感谢.

function wsits_post_page_title( $title ) {
              if( is_admin())

        return $title;

    $selected_type  =   get_option('wsits_page_show_hide');

    if(!is_array($selected_type)) return $title;

    if ( ( in_array(get_post_type(), $selected_type ) ) &&  get_option('wsits_page_show_hide') ) 
    {
        $title = '';
    }
    return $title;
}
add_filter( 'the_title', array($this, 'wsits_post_page_title') );
Run Code Online (Sandbox Code Playgroud)

php wordpress themes filter

11
推荐指数
2
解决办法
5500
查看次数

什么时候wp-cron.php在Wordpress中运行?

我需要有关wp-cron的详细信息.我用它wp_schedule_event 来自动发送电子邮件.

wp_schedule_event仅在用户访问我们的网站时触发.如何让cron自动运行?

wordpress cron cron-task

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

wordpress ×2

cron ×1

cron-task ×1

filter ×1

php ×1

themes ×1