我希望使用一个只在特定自定义字段可用时运行的函数。
类似于:
if (custom_field_x_exists("name_of_the_custom_field")) :
<Do some things>;
endif;
怎么做呢?我希望使用一个只在特定自定义字段可用时运行的函数。
类似于:
if (custom_field_x_exists("name_of_the_custom_field")) :
<Do some things>;
endif;
怎么做呢?我想这应该会有帮助
if ( get_post_meta( $post->ID, \'name_of_the_custom_field\', true ) ) :
// Do something
endif;
我试图通过在is\\u admin条件中使用wp\\u重定向,将所有非管理员排除在Wordpress管理面板之外。问题是,如果非管理员不能在Wordpress中使用“admin ajax.php”文件进行ajax调用,那么这会产生副作用。看来a few people on the Wordpress forums 最近也有同样的问题。有没有人能解决这个问题?