插件如下:https://wordpress.org/plugins/content-warning-v2/
我不想为登录用户显示它。
插件开发人员告诉我:https://wordpress.org/support/topic/how-to-dont-show-this-box-to-logged-in-users/#post-8411866
基本上,不用检查post ID,而是查看用户是否登录。
在此代码上:
/**
* Maybe Show Dialog
* @param bool $bool Default true
* @param WP_Post $post_ob A WP_Post object
* @return bool True to show the dialog, false to hide it.
*/
function maybe_show_dialog( $bool = true, $post_ob = null ) {
if ( isset( $post_obj->ID ) && 1 == $post_obj->ID ) {
return false;
}
return $bool;
}
add_filter( \'cwv3_should_gate\', \'maybe_show_dialog\', 10, 2 );
那么,我该怎么做呢?如何更改对登录上述代码的用户的post id php代码的查找?