[wordpress插件] Custom Options自订选项

wordpress 插件 文章 2020-04-08 20:30 562 0 全屏看文

AI助手支持GPT4.0

评分
20
描述

Allows you to create custom options that you can easily update via the Options administration panel and also allows you to use mentioned options in your theme using a simple PHP function:

允许您创建自定义选项,可以通过 Options 管理面板轻松更新这些选项,还可以使用简单的PHP函数在主题中使用上述选项:

get_custom_option ( $slug [, $default_value, $field ] )

  get_custom_option($ slug [,$ default_value,$ field])

By default, only Administrators can change Custom Options, however you can use the filter gsp_custom_options_capability to change that.

默认情况下,只有管理员可以更改“自定义选项”,但是您可以使用过滤器 gsp_custom_options_capability 进行更改。

For example, if you wish to allow Editors to use Custom Options you can add this to your functions.php file:

例如,如果您希望允许编辑者使用“自定义选项”,则可以将其添加到functions.php文件中:

function custom_options_capability ($capability) {    

  function custom_options_capability($ capability){    

return 'publish_pages';

返回'publish_pages';

}

}

add_filter ( 'gsp_custom_options_capability', 'custom_options_capability' );

add_filter('gsp_custom_options_capability','custom_options_capability');

Very simple, yet efficient.

非常简单,但高效。

安装步骤

    1. Upload the folder custom-options to the /wp-content/plugins/ directory
    2. 将文件夹 custom-options 上载到 / wp-content / plugins / 目录

    3. Activate the plugin through the Plugins menu in WordPress
    4. 通过WordPress中的 Plugins 菜单激活插件

    5. Update the plugin through the Options menu in WordPress
    6. 通过WordPress中的 Options 菜单更新插件

    7. Use Custom Options in your theme through the PHP function get_custom_option( $slug, $default_value )
    8. 通过PHP函数 get_custom_option($ slug,$ default_value) 在主题中使用自定义选项

    9. Don’t forget to precede the function by an echo if you want to output it
    10. 如果要输出该功能,请不要忘记在该功能之前加上 echo

下载地址
https://downloads.wordpress.org/plugin/custom-options.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Alink Tap链接水龙头
[wordpress插件] CoinMall硬币商城
[wordpress插件] Affiliate WooCommerce Coupons Integration会员WooCommerce优惠券集成
[wordpress插件] CampTix PayFast Payment GatewayCampTix PayFast付款网关
[wordpress插件] BNS Theme Add-InsBNS主题加载项
随便看看
微信开放平台跟公众平台有什么区别? 3608
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472