Can Settings API setting generate other settings?

I believe you should be able to use the update_option_{$option} hook: do_action( “update_option_{$option}”, $oldvalue, $_newvalue ); Something like: add_action( “update_option_youroptionname”, function ($oldvalue, $_newvalue) { // process your option value and update/insert options as needed // var_dump($oldvalue, $_newvalue); // debug // wp_die(); // debug }, 1,2 ); Be sure to replace “youroptionname” with the appropriate value.

How do I display a WP Option from an array?

I found a solution!!! <li class=”tweat”> <a href=”https://wordpress.stackexchange.com/questions/124927/<?php $globalOptions = get_option(“global_options_arraykey’); echo $globalOptions[‘twitterid’];?>”>Visit our twitter Account</a> </li> I got it from this site: Get Option for an Element in an array – WordPress-Hackers

Bring page from sub menu to admin menu in option tree

Add this to your functions.php file – add_filter(‘ot_theme_options_parent_slug’, ‘__return_false’); Basically it’s a filter (ot_theme_options_parent_slug) added by the plugin author and the usage is simple like I provided here. You may consider looking at this page for all available filters for “Option-Tree” plugin – https://github.com/valendesigns/option-tree/blob/master/includes/ot-functions-admin.php By adding this filter, you can pass any function and adjust … Read more

WordPress Theme Settings Page

This is wrong: add_theme_page(“Theme Panel”, “Theme Panel”, “manage_options”, “theme-panel”, “initialize_theme_options”, null, 99); The last two parameters shouldn’t be there. Check this function in codex here. EDIT: What’s more, the last parameter (which should be there) initialize_theme_options is wrong too, because it should be a callback to a function which would output a content. So for … Read more

How can I create a rearrangeable list of items like OptionTree offers with the Theme Customization API?

I suggest you take a look at the Kirki toolkit: https://github.com/aristath/kirki It has a “repeater” field that should do what you need. It’s still under heavy development and for the time being I’ve only added the ability to use a few field-types with it, so I guess it depends on what exactly the data you … Read more

How to use WP Theme Option: Custom_Backgrounds on specific element?

If your theme uses in-built custom-background callback then you can overwrite add_theme_support in your child theme. Yo do not need to use remove_theme_support. First add custom-background support with your callback function. $defaults_args = array( ‘wp-head-callback’ => ‘my_custom_background_cb’, ); add_theme_support( ‘custom-background’, $defaults_args ); In callback function specify div CSS class or ID function my_custom_background_cb() { $bg_image … Read more

Shorter admin url for options page

You mean, wp-admin/admin.php?page=options-page-slug? But yes, you can use the rewrite API: add_action( ‘init’, function () { // The following adds the rule into the database. add_rewrite_rule( ‘wp-admin/options-page-slug(/|$)’, ‘wp-admin/admin.php?page=options-page-slug’, ‘top’ ); } ); Or alternatively, just add this before the WordPress rules in your .htaccess file: RewriteRule ^wp-admin/options-page-slug(/|$) /wp-admin/admin.php?page=options-page-slug [QSA,L]

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)