当前位置: 首页 > 知识库问答 >
问题:

wordpress这类描述的api怎么传参?小白看不懂啊?

齐兴运
2023-07-16

文档没写个代码真让小白抓狂啊

共有1个答案

邢永安
2023-07-16

官网上有这样一个栏目:“User Contributed Notes”,里面有用户贡献的一些代码片段:

  • User Contributed Notes | next_post_link() | Function | WordPress Developer Resources
  • User Contributed Notes | the_shortlink() | Function | WordPress Developer Resources

或者,你只需将函数定义那行复制下来,在他后面加个分号(;),然后在两边分别加上 <?php?>,再把红色的类型删掉,把等号后面的黑色的值换成你想要的值(注意要符合类型),就可以了。

diff --git a/example.php b/example.phpindex 0000001..0000002 100644--- a/example.php+++ b/example.php@@ -0,0 +1 @@+next_post_link( string $format = '%link &raquo;', string $link = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' )
diff --git a/example.php b/example.phpindex 0000002..0000003 100644--- a/example.php+++ b/example.php@@ -1 +1 @@-next_post_link( string $format = '%link &raquo;', string $link = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' )+next_post_link( string $format = '%link &raquo;', string $link = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' );
diff --git a/example.php b/example.phpindex 0000003..0000004 100644--- a/example.php+++ b/example.php@@ -1 +1 @@-next_post_link( string $format = '%link &raquo;', string $link = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' );+<?php next_post_link( string $format = '%link &raquo;', string $link = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' ); ?>
diff --git a/example.php b/example.phpindex 0000004..0000005 100644--- a/example.php+++ b/example.php@@ -1 +1 @@-<?php next_post_link( string $format = '%link &raquo;', string $link = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' ); ?>+<?php next_post_link( $format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ); ?>
diff --git a/example.php b/example.phpindex 0000005..0000006 100644--- a/example.php+++ b/example.php@@ -1 +1 @@-<?php next_post_link( $format = '%link &raquo;', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ); ?>+<?php next_post_link( $format = 'CHANGE_ME', $link = 'CHANGE_ME', $in_same_term = trueORfalse, $excluded_terms = 'CHANGE_ME', $taxonomy = 'CHANGE_ME' ); ?>
 类似资料:
  • 描述符的定义: https://python-reference.readthedocs.io/en/latest/docs/dunder... In general, a descriptor is an object attribute with “binding behavior”, one whose attribute access has been overridden by meth

  • 在google protobuf v3中,有一种类型可以让你序列化识别消息的名称/url(https://developers.google.com/protocol-buffers/docs/proto3#any, https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto). 有没有可能描述这个构造并

  • 我从此链接中获得了以下代码片段:https://www.gkogan.co/blog/save-url-parameters/ 简而言之,此代码旨在获取链接参数(如utm_source)并将其保存到sessionStorage中。我不明白的是教程没有解释的以下行: 此语法是什么意思?

  • 我正在使用wordpress,并尝试为类别页面创建自定义描述。 我修改了它的header.php文件,以响应自定义标题和描述。但是Wordpress正在用第一篇文章的元描述替换我的元描述。 我怎样才能阻止这一切? 我的代码: 我使用电子电影主题:http://fthemes.com/emovies-free-wordpress-theme/ 我的网站类别链接:http://www.raagalu.

  • 问题内容: 什么是类描述符? 它是特定类的对象吗? 问题答案: 是的,对象是某个“类”的类描述符。 从API中: 此类的实例表示正在运行的Java应用程序中的类和接口。枚举是一种类,注释是一种接口。每个数组还属于一个反映为Class对象的类,该类对象由元素类型和维数相同的所有数组共享。原始Java类型(布尔型,字节型,字符型,短型,整型,长型,浮点型和双精度型)以及关键字void也都表示为对象。

  • 我正在寻找一种方法来上传多个图像的描述。用户将从摄像头上传1-10张相当大的图片,所以最好在上传前调整图片大小。 要求: 浏览器兼容(包括手机浏览器和IE),可以依靠JavaScript(jQuery) 多个文件作为本机文件管理器中多个文件的选择,或者至少必须单击某个按钮来输入另一个文件 给每个文件添加一个描述 上传前调整文件大小(不需要与浏览器兼容) 上传提交 保留EXIF信息或至少提取GPS坐