AI助手支持GPT4.0
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
允许您创建自定义选项,可以通过 Options code>管理面板轻松更新这些选项,还可以使用简单的PHP函数在主题中使用上述选项: p>get_custom_option ( $slug [, $default_value, $field ] ) get_custom_option($ slug [,$ default_value,$ field]) code> pre>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 code>进行更改。For example, if you wish to allow Editors to use Custom Options you can add this to your functions.php file:例如,如果您希望允许编辑者使用“自定义选项”,则可以将其添加到functions.php文件中: p>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'); code> pre>Very simple, yet efficient.非常简单,但高效。 p>
Options code>管理面板轻松更新这些选项,还可以使用简单的PHP函数在主题中使用上述选项: p>get_custom_option ( $slug [, $default_value, $field ] ) get_custom_option($ slug [,$ default_value,$ field]) code> pre>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 code>进行更改。For example, if you wish to allow Editors to use Custom Options you can add this to your functions.php file:例如,如果您希望允许编辑者使用“自定义选项”,则可以将其添加到functions.php文件中: p>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'); code> pre>Very simple, yet efficient.非常简单,但高效。 p>
get_custom_option ( $slug [, $default_value, $field ] ) get_custom_option($ slug [,$ default_value,$ field]) code> pre>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 code>进行更改。For example, if you wish to allow Editors to use Custom Options you can add this to your functions.php file:例如,如果您希望允许编辑者使用“自定义选项”,则可以将其添加到functions.php文件中: p>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'); code> pre>Very simple, yet efficient.非常简单,但高效。 p>
get_custom_option($ slug [,$ default_value,$ field])
code> pre>
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
默认情况下,只有管理员可以更改“自定义选项”,但是您可以使用过滤器 gsp_custom_options_capability code>进行更改。For example, if you wish to allow Editors to use Custom Options you can add this to your functions.php file:例如,如果您希望允许编辑者使用“自定义选项”,则可以将其添加到functions.php文件中: p>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'); code> pre>Very simple, yet efficient.非常简单,但高效。 p>
gsp_custom_options_capability code>进行更改。For example, if you wish to allow Editors to use Custom Options you can add this to your functions.php file:例如,如果您希望允许编辑者使用“自定义选项”,则可以将其添加到functions.php文件中: p>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'); code> pre>Very simple, yet efficient.非常简单,但高效。 p>
For example, if you wish to allow Editors to use Custom Options you can add this to your functions.php file:
例如,如果您希望允许编辑者使用“自定义选项”,则可以将其添加到functions.php文件中: p>
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'); code> pre>Very simple, yet efficient.非常简单,但高效。 p>
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');
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.
非常简单,但高效。 p>
custom-options
/wp-content/plugins/
custom-options code>上载到 / wp-content / plugins / code>目录 li>Activate the plugin through the Plugins menu in WordPress通过WordPress中的 Plugins code>菜单激活插件 li>Update the plugin through the Options menu in WordPress通过WordPress中的 Options code>菜单更新插件 li>Use Custom Options in your theme through the PHP function get_custom_option( $slug, $default_value )通过PHP函数 get_custom_option($ slug,$ default_value) code> li>在主题中使用自定义选项Don’t forget to precede the function by an echo if you want to output it如果要输出该功能,请不要忘记在该功能之前加上 echo code> li>
/ wp-content / plugins / code>目录 li>Activate the plugin through the Plugins menu in WordPress通过WordPress中的 Plugins code>菜单激活插件 li>Update the plugin through the Options menu in WordPress通过WordPress中的 Options code>菜单更新插件 li>Use Custom Options in your theme through the PHP function get_custom_option( $slug, $default_value )通过PHP函数 get_custom_option($ slug,$ default_value) code> li>在主题中使用自定义选项Don’t forget to precede the function by an echo if you want to output it如果要输出该功能,请不要忘记在该功能之前加上 echo code> li>
Plugins
Plugins code>菜单激活插件 li>Update the plugin through the Options menu in WordPress通过WordPress中的 Options code>菜单更新插件 li>Use Custom Options in your theme through the PHP function get_custom_option( $slug, $default_value )通过PHP函数 get_custom_option($ slug,$ default_value) code> li>在主题中使用自定义选项Don’t forget to precede the function by an echo if you want to output it如果要输出该功能,请不要忘记在该功能之前加上 echo code> li>
Options code>菜单更新插件 li>Use Custom Options in your theme through the PHP function get_custom_option( $slug, $default_value )通过PHP函数 get_custom_option($ slug,$ default_value) code> li>在主题中使用自定义选项Don’t forget to precede the function by an echo if you want to output it如果要输出该功能,请不要忘记在该功能之前加上 echo code> li>
get_custom_option( $slug, $default_value )
get_custom_option($ slug,$ default_value) code> li>在主题中使用自定义选项Don’t forget to precede the function by an echo if you want to output it如果要输出该功能,请不要忘记在该功能之前加上 echo code> li>
echo
echo code> li>
ol>
原文出处:http://www.sanshu.cn/a/9638.html
群主管理都是支付大佬