How can I get all user options?
You will get all the meta for the user by using get_user_meta function $all_meta_for_user = get_user_meta( [user ID] ); echo “<pre>”; print_r( $all_meta_for_user );
You will get all the meta for the user by using get_user_meta function $all_meta_for_user = get_user_meta( [user ID] ); echo “<pre>”; print_r( $all_meta_for_user );
The generic way to do it, is by using the pre_option_{option} https://codex.wordpress.org/Plugin_API/Filter_Reference/pre_option_(option_name) filter to override the “local” settings and use the value being stored in your “main” sub site. something like add_filter( ‘pre_option_the_plugin_option_name’, function () { // Code assumes that “blog” 1 is the main one in which the relevant settings are stored. if (get_current_blog_id() … Read more
You can use this function: get_blog_option https://codex.wordpress.org/Function_Reference/get_blog_option Use get_sites function to retrieve blogs ID from your site.
Unfortunately, the html for those fields is hard-coded into the wp-admin/options-general.php file and there are no filters to keep them from being displayed. The next-best thing is probably to disable them. Here’s how I’d approach it: Step 1: Adding a bit of js/jQuery to the general options page that will target the inputs/selects you want … Read more
You are using get_option() wrong, first variant, so take another look at the get_option() documentation. Basically you can’t directly access an array element with the function, it just doesn’t support it. The second variant should be possible, but you need at least PHP 5.4 – if I’m not totally mistaken; I don’t know anything about … Read more
Front page template logic is horrendous legacy mess. While back I wrote a very thorough front page cheatsheet, I still can’t completely remember how it works. You are right to notice that theme in your case doesn’t behave in same way as other themes typically do. If you run down specific template being used (plugin … Read more
https://core.trac.wordpress.org/ticket/42345 After a lot of digging and following segfaults in strace and parsing out apache core dumps (and enlisting some outside help from a much more knowledgeable Linux guy) I dug this up on WordPress’s site. The short answer to the problem is that there is an issue with PHP5 and libssh2 that was introduced … Read more
First off, check if the theme is available in wordpress.org themes: http://wordpress.org/extend/themes/ If it’s not, find the name of the theme developer and contact them. Many developers of wordpress.com themes are happy for people to use their themes on self-hosted WordPress blogs. The developer’s name and contact details can be found by looking at style.css. … Read more
There are functions for saving and retrieving network-wide options: add_network_option(); update_network_option(); get_network_option(); The values of these options are stored in wp_sitemeta.
You just need to register_setting() on your setting and it will be saved automatically. See the Settings API for more info. Here’s a complete example: function spw_cb() { if( !($value = get_option(‘sprockets_per_widget’)) ) { $value = 7; } ?> <input type=”text” size=”3″ name=”sprockets_per_widget” value=”<?php echo $value; ?>” /> Numeric only! <?php } function spw_init() { … Read more