运维日志
-
WordPress更新文章元数据函数:update_post_meta
WordPress函数update_post_meta用于更新文章元数据。 update_post_meta( int $post_id, string $meta_key, mi…
-
WordPress获取文章元数据函数:get_post_meta
WordPress函数get_post_meta用于获取文章元数据。 get_post_meta( int $post_id, string $key = ''…
-
JS获取DPI解决打印页面像素计算问题
一般电脑默认96DPI或72DPI,JS可以通过以下方法获取DPI的值: function get_dpi() { for (var i = 56; i < 2000; i+…
-
WordPress插入文章函数:wp_insert_post
WordPress函数wp_insert_post用于插入一篇新的文章。 wp_insert_post( array $postarr, bool $wp_error = fals…
-
WordPress更新文章函数:wp_update_post
WordPress函数wp_update_post用于更新现有的文章 wp_update_post( array|object $postarr = array(), bool $…
-
WordPress修改文章状态为公开:wp_publish_post
WordPress函数wp_publish_post用于修改文章的状态为publish wp_publish_post( int|WP_Post $post ) 函数参数 $pos…
-
WordPress获取所有页面ID函数:get_all_page_ids
WordPress函数get_all_page_ids用于获取所有页面的ID,以数组的形式返回结果,该函数没有任何参数。 get_all_page_ids() 函数使用示例 以下示…
-
WordPress获取祖先ID函数:get_ancestors
WordPress函数get_ancestors可以用于获取分类的祖先ID,或页面的祖先ID,包括所有的上级。 get_ancestors( int $object_id, str…
-
WordPress获取页面链接函数:get_page_link
WordPress函数get_page_link用于获取指定页面的链接 get_page_link( int|WP_Post $post = false, bool $leaven…
-
WordPress根据页面路径获取页面对象函数:get_page_by_path
WordPress函数get_page_by_path根据页面路径获取页面对象 get_page_by_path( string $page_path, string $outpu…