AI助手支持GPT4.0
WordPress plugin that helps to serve content through REST routes and gives
WordPress插件,可帮助通过REST路由提供内容并提供
customizability to developers through filters.
通过过滤器对开发人员的可定制性。 p>
/wp-json/arha/v1/post
/ wp-json / arha / v1 / post code> li>/wp-json/arha/v1/page / wp-json / arha / v1 / page code> li>/wp-json/arha/v1/options / wp-json / arha / v1 / options code> li>/wp-json/arha/v1/archive / wp-json / arha / v1 / archive code> li>
/wp-json/arha/v1/page
/ wp-json / arha / v1 / page code> li>/wp-json/arha/v1/options / wp-json / arha / v1 / options code> li>/wp-json/arha/v1/archive / wp-json / arha / v1 / archive code> li>
/wp-json/arha/v1/options
/ wp-json / arha / v1 / options code> li>/wp-json/arha/v1/archive / wp-json / arha / v1 / archive code> li>
/wp-json/arha/v1/archive
/ wp-json / arha / v1 / archive code> li>
ul>
/wp-json/arha/v1/post?post_type=POST_TYPE&slug=SLUG
/ wp-json / arha / v1 / post?post_type = POST_TYPE&slug = SLUG code> li>/wp-json/arha/v1/page?path=PATH / wp-json / arha / v1 / page?path = PATH code> li>/wp-json/arha/v1/options / wp-json / arha / v1 / options code> li>/wp-json/arha/v1/archive?post_type=POST_TYPE&posts_per_page=POSTS_PER_PAGE&paged=PAGED&orderby=ORDERBY&order=ORDER / wp-json / arha / v1 / archive?post_type = POST_TYPE&posts_per_page = POSTS_PER_PAGE&paged = PAGED&orderby = ORDERBY&order = ORDER code> li>
/wp-json/arha/v1/page?path=PATH
/ wp-json / arha / v1 / page?path = PATH code> li>/wp-json/arha/v1/options / wp-json / arha / v1 / options code> li>/wp-json/arha/v1/archive?post_type=POST_TYPE&posts_per_page=POSTS_PER_PAGE&paged=PAGED&orderby=ORDERBY&order=ORDER / wp-json / arha / v1 / archive?post_type = POST_TYPE&posts_per_page = POSTS_PER_PAGE&paged = PAGED&orderby = ORDERBY&order = ORDER code> li>
/ wp-json / arha / v1 / options code> li>/wp-json/arha/v1/archive?post_type=POST_TYPE&posts_per_page=POSTS_PER_PAGE&paged=PAGED&orderby=ORDERBY&order=ORDER / wp-json / arha / v1 / archive?post_type = POST_TYPE&posts_per_page = POSTS_PER_PAGE&paged = PAGED&orderby = ORDERBY&order = ORDER code> li>
/wp-json/arha/v1/archive?post_type=POST_TYPE&posts_per_page=POSTS_PER_PAGE&paged=PAGED&orderby=ORDERBY&order=ORDER
/ wp-json / arha / v1 / archive?post_type = POST_TYPE&posts_per_page = POSTS_PER_PAGE&paged = PAGED&orderby = ORDERBY&order = ORDER code> li>
tax_query
new WP_Query()
支持
tax_query code>,它可以在 new WP_Query() code> li>中为其构建查询tax_query value needs to be passed in as stringified json tax_query code>值需要作为字符串化的json传入 li>
new WP_Query() code> li>中为其构建查询tax_query value needs to be passed in as stringified json tax_query code>值需要作为字符串化的json传入 li>
tax_query code>值需要作为字符串化的json传入 li>
https://stackoverflow.com/a/9547490
https://stackoverflow.com/a/9547490 li>
To exclude querying specific post types from post– and archive-routes, you
post
archive
要从 post code> –和 archive code>-路由中排除查询特定帖子类型,请can use following filters:可以使用以下过滤器: p>add_filter('arha_routes/archive_excluded_post_types', 'exclude_post_types'); add_filter('arha_routes / archive_excluded_post_types','exclude_post_types'); add_filter('arha_routes/post_excluded_post_types', 'exclude_post_types');add_filter('arha_routes / post_excluded_post_types','exclude_post_types'); function exclude_post_types($excluded_post_types) {函数exclude_post_types($ excluded_post_types){$excluded_post_types = ['post'];$ excluded_post_types = ['post']; return $excluded_post_types;返回$ excluded_post_types; }} code> p>
post code> –和 archive code>-路由中排除查询特定帖子类型,请can use following filters:可以使用以下过滤器: p>add_filter('arha_routes/archive_excluded_post_types', 'exclude_post_types'); add_filter('arha_routes / archive_excluded_post_types','exclude_post_types'); add_filter('arha_routes/post_excluded_post_types', 'exclude_post_types');add_filter('arha_routes / post_excluded_post_types','exclude_post_types'); function exclude_post_types($excluded_post_types) {函数exclude_post_types($ excluded_post_types){$excluded_post_types = ['post'];$ excluded_post_types = ['post']; return $excluded_post_types;返回$ excluded_post_types; }} code> p>
archive code>-路由中排除查询特定帖子类型,请can use following filters:可以使用以下过滤器: p>add_filter('arha_routes/archive_excluded_post_types', 'exclude_post_types'); add_filter('arha_routes / archive_excluded_post_types','exclude_post_types'); add_filter('arha_routes/post_excluded_post_types', 'exclude_post_types');add_filter('arha_routes / post_excluded_post_types','exclude_post_types'); function exclude_post_types($excluded_post_types) {函数exclude_post_types($ excluded_post_types){$excluded_post_types = ['post'];$ excluded_post_types = ['post']; return $excluded_post_types;返回$ excluded_post_types; }} code> p>
can use following filters:
可以使用以下过滤器: p>
add_filter('arha_routes/archive_excluded_post_types', 'exclude_post_types'); add_filter('arha_routes / archive_excluded_post_types','exclude_post_types'); add_filter('arha_routes/post_excluded_post_types', 'exclude_post_types');add_filter('arha_routes / post_excluded_post_types','exclude_post_types'); function exclude_post_types($excluded_post_types) {函数exclude_post_types($ excluded_post_types){$excluded_post_types = ['post'];$ excluded_post_types = ['post']; return $excluded_post_types;返回$ excluded_post_types; }} code> p>
add_filter('arha_routes / archive_excluded_post_types','exclude_post_types'); add_filter('arha_routes/post_excluded_post_types', 'exclude_post_types');add_filter('arha_routes / post_excluded_post_types','exclude_post_types'); function exclude_post_types($excluded_post_types) {函数exclude_post_types($ excluded_post_types){$excluded_post_types = ['post'];$ excluded_post_types = ['post']; return $excluded_post_types;返回$ excluded_post_types; }
add_filter('arha_routes/post_excluded_post_types', 'exclude_post_types');
add_filter('arha_routes / post_excluded_post_types','exclude_post_types');
function exclude_post_types($excluded_post_types) {
函数exclude_post_types($ excluded_post_types){
$excluded_post_types = ['post'];
$ excluded_post_types = ['post'];
return $excluded_post_types;
返回$ excluded_post_types;
}
} code> p>
li>
To format post-route’s post before it’s served to client, use arha_routes/format_post-filter
arha_routes/format_post
要在将 post code> -route的帖子提供给客户之前对其进行格式化,请使用 arha_routes / format_post code> -filter p>add_filter('arha_routes/format_post', 'format_post'); add_filter('arha_routes / format_post','format_post'); function format_post($post) {函数format_post($ post){return $post;返回$ post; }} code> p>
post code> -route的帖子提供给客户之前对其进行格式化,请使用 arha_routes / format_post code> -filter p>add_filter('arha_routes/format_post', 'format_post'); add_filter('arha_routes / format_post','format_post'); function format_post($post) {函数format_post($ post){return $post;返回$ post; }} code> p>
arha_routes / format_post code> -filter p>add_filter('arha_routes/format_post', 'format_post'); add_filter('arha_routes / format_post','format_post'); function format_post($post) {函数format_post($ post){return $post;返回$ post; }} code> p>
add_filter('arha_routes/format_post', 'format_post'); add_filter('arha_routes / format_post','format_post'); function format_post($post) {函数format_post($ post){return $post;返回$ post; }} code> p>
add_filter('arha_routes / format_post','format_post'); function format_post($post) {函数format_post($ post){return $post;返回$ post; }
function format_post($post) {
函数format_post($ post){
return $post;
返回$ post;
To format page-route’s post before it’s served to client, use arha_routes/format_page-filter
page
arha_routes/format_page
要在发送给客户之前格式化 page code> -route的帖子,请使用 arha_routes / format_page code> -filter p>add_filter('arha_routes/format_page', 'format_page'); add_filter('arha_routes / format_page','format_page'); function format_page($page) {函数format_page($ page){return $page;返回$ page; }} code> p>
page code> -route的帖子,请使用 arha_routes / format_page code> -filter p>add_filter('arha_routes/format_page', 'format_page'); add_filter('arha_routes / format_page','format_page'); function format_page($page) {函数format_page($ page){return $page;返回$ page; }} code> p>
arha_routes / format_page code> -filter p>add_filter('arha_routes/format_page', 'format_page'); add_filter('arha_routes / format_page','format_page'); function format_page($page) {函数format_page($ page){return $page;返回$ page; }} code> p>
add_filter('arha_routes/format_page', 'format_page'); add_filter('arha_routes / format_page','format_page'); function format_page($page) {函数format_page($ page){return $page;返回$ page; }} code> p>
add_filter('arha_routes / format_page','format_page'); function format_page($page) {函数format_page($ page){return $page;返回$ page; }
function format_page($page) {
函数format_page($ page){
return $page;
返回$ page;
To format archive-route’s posts before they are served to client, use arha_routes/format_archive_post-filter
arha_routes/format_archive_post
要在将存档 code> -route的帖子提供给客户之前对其进行格式化,请使用 arha_routes / format_archive_post code> -filter p>add_filter('arha_routes/format_archive_post', 'format_archive_post'); add_filter('arha_routes / format_archive_post','format_archive_post'); function format_archive_post($post) {函数format_archive_post($ post){return $post;返回$ post; }} code> p>
存档 code> -route的帖子提供给客户之前对其进行格式化,请使用 arha_routes / format_archive_post code> -filter p>add_filter('arha_routes/format_archive_post', 'format_archive_post'); add_filter('arha_routes / format_archive_post','format_archive_post'); function format_archive_post($post) {函数format_archive_post($ post){return $post;返回$ post; }} code> p>
arha_routes / format_archive_post code> -filter p>add_filter('arha_routes/format_archive_post', 'format_archive_post'); add_filter('arha_routes / format_archive_post','format_archive_post'); function format_archive_post($post) {函数format_archive_post($ post){return $post;返回$ post; }} code> p>
add_filter('arha_routes/format_archive_post', 'format_archive_post'); add_filter('arha_routes / format_archive_post','format_archive_post'); function format_archive_post($post) {函数format_archive_post($ post){return $post;返回$ post; }} code> p>
add_filter('arha_routes / format_archive_post','format_archive_post'); function format_archive_post($post) {函数format_archive_post($ post){return $post;返回$ post; }
function format_archive_post($post) {
函数format_archive_post($ post){
options-route returns empty result by default.
options
选项 code> -route默认情况下返回空结果。To add content to it, use arha_routes/format_options-filter要向其中添加内容,请使用 arha_routes / format_options code> -filter p>add_filter('arha_routes/format_options', 'format_options'); add_filter('arha_routes / format_options','format_options'); function format_options($options) {函数format_options($ options){return $options;返回$ options; }} code> p>
To add content to it, use arha_routes/format_options-filter
arha_routes/format_options
要向其中添加内容,请使用 arha_routes / format_options code> -filter p>add_filter('arha_routes/format_options', 'format_options'); add_filter('arha_routes / format_options','format_options'); function format_options($options) {函数format_options($ options){return $options;返回$ options; }} code> p>
arha_routes / format_options code> -filter p>add_filter('arha_routes/format_options', 'format_options'); add_filter('arha_routes / format_options','format_options'); function format_options($options) {函数format_options($ options){return $options;返回$ options; }} code> p>
add_filter('arha_routes/format_options', 'format_options'); add_filter('arha_routes / format_options','format_options'); function format_options($options) {函数format_options($ options){return $options;返回$ options; }} code> p>
add_filter('arha_routes / format_options','format_options'); function format_options($options) {函数format_options($ options){return $options;返回$ options; }
function format_options($options) {
函数format_options($ options){
return $options;
返回$ options;
Arha Routes supports SearchWP-plugin, which lets WP users to make keyword search engine for their content.
Arha Routes支持SearchWP插件,该插件使WP用户可以为其内容创建关键字搜索引擎。 p>
Activating SearchWP-plugin adds optional keyword-search functionality to archive-route.
激活SearchWP插件会将可选的关键字搜索功能添加到 archive code> -route。This is done by adding s=KEYWORD to the route这是通过将 s = KEYWORD code>添加到路由来完成的– Example: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&s=monitor–示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&s = monitor code> p>Polylang Polylang h3>Arha Routes supports Polylang-plugin, which allows users to create content in multiple languages. Arha Routes支持Polylang插件,该插件允许用户创建多种语言的内容。 p>Activating Polylang changes how endpoints work:激活Polylang会更改端点的工作方式: p>All routes require additional lang-param所有路线都需要附加的 lang code> -paramExample: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li> ul> li>page-route doesn’t support language prefix in path 页面 code> -route路径中不支持语言前缀Example: Permalink /zh/info, use like this /wp-json/arha/v1/page?path=/info&lang=zh示例:永久链接 / zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li> ul> li>options-route passes lang-param forward to arha_routes/format_options-filter 选项 code> -route将 lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }} code> li> ul>Polylang + SearchWP Polylang + SearchWP h3>In order to make these two plugins work together, you need to add extra plugin to WP installation.为了使这两个插件协同工作,您需要在WP安装中添加额外的插件。 p>https://searchwp.com/extensions/polylang-integration/ https://searchwp.com/extensions/polylang-integration/ p>
archive code> -route。This is done by adding s=KEYWORD to the route这是通过将 s = KEYWORD code>添加到路由来完成的– Example: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&s=monitor–示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&s = monitor code> p>Polylang Polylang h3>Arha Routes supports Polylang-plugin, which allows users to create content in multiple languages. Arha Routes支持Polylang插件,该插件允许用户创建多种语言的内容。 p>Activating Polylang changes how endpoints work:激活Polylang会更改端点的工作方式: p>All routes require additional lang-param所有路线都需要附加的 lang code> -paramExample: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li> ul> li>page-route doesn’t support language prefix in path 页面 code> -route路径中不支持语言前缀Example: Permalink /zh/info, use like this /wp-json/arha/v1/page?path=/info&lang=zh示例:永久链接 / zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li> ul> li>options-route passes lang-param forward to arha_routes/format_options-filter 选项 code> -route将 lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }} code> li> ul>Polylang + SearchWP Polylang + SearchWP h3>In order to make these two plugins work together, you need to add extra plugin to WP installation.为了使这两个插件协同工作,您需要在WP安装中添加额外的插件。 p>https://searchwp.com/extensions/polylang-integration/ https://searchwp.com/extensions/polylang-integration/ p>
This is done by adding s=KEYWORD to the route
s=KEYWORD
这是通过将 s = KEYWORD code>添加到路由来完成的– Example: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&s=monitor–示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&s = monitor code> p>Polylang Polylang h3>Arha Routes supports Polylang-plugin, which allows users to create content in multiple languages. Arha Routes支持Polylang插件,该插件允许用户创建多种语言的内容。 p>Activating Polylang changes how endpoints work:激活Polylang会更改端点的工作方式: p>All routes require additional lang-param所有路线都需要附加的 lang code> -paramExample: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li> ul> li>page-route doesn’t support language prefix in path 页面 code> -route路径中不支持语言前缀Example: Permalink /zh/info, use like this /wp-json/arha/v1/page?path=/info&lang=zh示例:永久链接 / zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li> ul> li>options-route passes lang-param forward to arha_routes/format_options-filter 选项 code> -route将 lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }} code> li> ul>Polylang + SearchWP Polylang + SearchWP h3>In order to make these two plugins work together, you need to add extra plugin to WP installation.为了使这两个插件协同工作,您需要在WP安装中添加额外的插件。 p>https://searchwp.com/extensions/polylang-integration/ https://searchwp.com/extensions/polylang-integration/ p>
s = KEYWORD code>添加到路由来完成的– Example: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&s=monitor–示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&s = monitor code> p>Polylang Polylang h3>Arha Routes supports Polylang-plugin, which allows users to create content in multiple languages. Arha Routes支持Polylang插件,该插件允许用户创建多种语言的内容。 p>Activating Polylang changes how endpoints work:激活Polylang会更改端点的工作方式: p>All routes require additional lang-param所有路线都需要附加的 lang code> -paramExample: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li> ul> li>page-route doesn’t support language prefix in path 页面 code> -route路径中不支持语言前缀Example: Permalink /zh/info, use like this /wp-json/arha/v1/page?path=/info&lang=zh示例:永久链接 / zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li> ul> li>options-route passes lang-param forward to arha_routes/format_options-filter 选项 code> -route将 lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }} code> li> ul>Polylang + SearchWP Polylang + SearchWP h3>In order to make these two plugins work together, you need to add extra plugin to WP installation.为了使这两个插件协同工作,您需要在WP安装中添加额外的插件。 p>https://searchwp.com/extensions/polylang-integration/ https://searchwp.com/extensions/polylang-integration/ p>
– Example: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&s=monitor
/wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&s=monitor
–示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&s = monitor code> p>Polylang Polylang h3>Arha Routes supports Polylang-plugin, which allows users to create content in multiple languages. Arha Routes支持Polylang插件,该插件允许用户创建多种语言的内容。 p>Activating Polylang changes how endpoints work:激活Polylang会更改端点的工作方式: p>All routes require additional lang-param所有路线都需要附加的 lang code> -paramExample: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li> ul> li>page-route doesn’t support language prefix in path 页面 code> -route路径中不支持语言前缀Example: Permalink /zh/info, use like this /wp-json/arha/v1/page?path=/info&lang=zh示例:永久链接 / zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li> ul> li>options-route passes lang-param forward to arha_routes/format_options-filter 选项 code> -route将 lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }} code> li> ul>Polylang + SearchWP Polylang + SearchWP h3>In order to make these two plugins work together, you need to add extra plugin to WP installation.为了使这两个插件协同工作,您需要在WP安装中添加额外的插件。 p>https://searchwp.com/extensions/polylang-integration/ https://searchwp.com/extensions/polylang-integration/ p>
/ wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&s = monitor code> p>Polylang Polylang h3>Arha Routes supports Polylang-plugin, which allows users to create content in multiple languages. Arha Routes支持Polylang插件,该插件允许用户创建多种语言的内容。 p>Activating Polylang changes how endpoints work:激活Polylang会更改端点的工作方式: p>All routes require additional lang-param所有路线都需要附加的 lang code> -paramExample: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li> ul> li>page-route doesn’t support language prefix in path 页面 code> -route路径中不支持语言前缀Example: Permalink /zh/info, use like this /wp-json/arha/v1/page?path=/info&lang=zh示例:永久链接 / zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li> ul> li>options-route passes lang-param forward to arha_routes/format_options-filter 选项 code> -route将 lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }} code> li> ul>Polylang + SearchWP Polylang + SearchWP h3>In order to make these two plugins work together, you need to add extra plugin to WP installation.为了使这两个插件协同工作,您需要在WP安装中添加额外的插件。 p>https://searchwp.com/extensions/polylang-integration/ https://searchwp.com/extensions/polylang-integration/ p>
Arha Routes supports Polylang-plugin, which allows users to create content in multiple languages.
Arha Routes支持Polylang插件,该插件允许用户创建多种语言的内容。 p>
Activating Polylang changes how endpoints work:
激活Polylang会更改端点的工作方式: p>
lang
lang code> -paramExample: /wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en示例: / wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li> ul>
/wp-json/arha/v1/archive?post_type=products&posts_per_page=10&paged=1&orderby=date&order=ASC&lang=en
/ wp-json / arha / v1 / archive?post_type = products&posts_per_page = 10&paged = 1&orderby = date&order = ASC&lang = zh_CN code> li>
页面 code> -route路径中不支持语言前缀Example: Permalink /zh/info, use like this /wp-json/arha/v1/page?path=/info&lang=zh示例:永久链接 / zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li> ul>
/zh/info
/wp-json/arha/v1/page?path=/info&lang=zh
/ zh / info code>,像这样 / wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li>
/ wp-json / arha / v1 / page?path = / info&lang = zh code> li>Example: Permalink /en/info/test, use like this /wp-json/arha/v1/page?path=/info/test&lang=zh<示例:固定链接 / en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li>
/en/info/test
/wp-json/arha/v1/page?path=/info/test&lang=zh
/ en / info / test code>,像这样 / wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li>
/ wp-json / arha / v1 / page?path = / info / test&lang = zh code> < /li>/ li>
/li>
/ li>
选项 code> -route将 lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }
lang code> -param传递给 arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }
arha_routes / format_options code> -filter add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }
add_filter('arha_routes/format_options', 'format_options', 10, 2); add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }
add_filter('arha_routes / format_options','format_options',10,2); function format_options($options, $lang) {函数format_options($ options,$ lang){return $options;返回$ options; }
function format_options($options, $lang) {
函数format_options($ options,$ lang){
} code> li>
In order to make these two plugins work together, you need to add extra plugin to WP installation.
为了使这两个插件协同工作,您需要在WP安装中添加额外的插件。 p>
https://searchwp.com/extensions/polylang-integration/
https://searchwp.com/extensions/polylang-integration/ p>
原文出处:http://www.sanshu.cn/a/2751.html
群主管理都是支付大佬