Creating Admin Options Page where users can make changes to a theme

I need help to finish this last bit of php code. I’m trying to create an admin options page similar to in admin>settings>discussions like how a user can select an avatar, but instead of selecting an avatar, the user selects a style option that makes a change to the theme (by enqueueing a CSS file … Read more

Performance of several get_option() calls

I am currently working on my first WordPress plugin. To save and output certain settings I use the native Settings API. Now the question arises, how performant are several calls of the get_option() function. Since I work object-oriented I use a function which returns the options: private function get_settings() { $styles = get_option(“style_settings”); return $styles; … Read more

How to update selective options on plugin settings page

I write a wordpress plugin. My plugin has options. All options are in one group, ‘pluginname-settings’. All option names are uniform and look like “pluginname-settings[‘option-name’]”. Some code to illustrate my case: register_setting( ‘pluginname_options’, ‘pluginname-settings’, ‘pluginname_validate’ ); add_settings_section( ‘section-one’, ‘Name of Section One’, ‘section_one_callback’, ‘pluginname_options-sectionname’ ); add_settings_field( ‘optionname’, ‘First Option’, ‘my_text_input’, ‘pluginname_options-sectionname’, ‘section-button’, array( ‘name’ => … Read more

What is the correct form action URL for network options pages?

Referring to Settings API in Multisite – Missing update message It states that: For network option pages the correct form action URL is: wp-admin/network/edit.php?action=your_option_name Note: without a “https://wordpress.stackexchange.com/” in front Okay. Let’s try it: <form method=”post” action=”wp-admin/network/edit.php?action=your_option_page”> Obviously, my options form actually gets submitted to: http://yourdomain.com/wp-admin/network/wp-admin/network/edit.php?action=your_option_page Now, adding a “https://wordpress.stackexchange.com/” in front: <form method=”post” action=”/wp-admin/network/edit.php?action=your_option_page”> … Read more