Selecting multiple options onclick

this isn’t a WordPress thing, just an issue with your JS. this: jQuery(“select[name^=’post_author’]”).attr(‘selectedIndex’,selected); should be: jQuery(“select[name^=’post_author’]”).val(selected).attr(‘selected’,’selected’);

How can you store your option at the permalink settings page?

I ran into this very same issue and I have a workaround. Hopefully it will be fixed in the upcoming 3.3 release as this trac ticket suggests. The workaround basically replicates the important bits of the wp-admin/options.php file where settings registered via the settings API are processed. The reason additional permalink settings do not currently … Read more

update_option creates an option, which empties on a blog reload

Where are you calling wp_applugin_options_process()? If you call it, and $_POST[“excludeid”] isn’t set, then you’re effectively calling: update_option(“wp_applugin_excludeids”, null ); So if you’re calling this function on every page load, or even just when your admin page is loaded, then you’re automatically deleting your option. You should put a check in your function to make … Read more

How to add a custom form to a plugin’s setting page

The fourth parameter of add_menu_page is the menu slug. Hence the form action should start with: admin.php?page=vsp_settings_page, if you want to stay on said page. If your form is correctly written, it should populate the query string in the URL. You should have probably posted all your form’s markup. Is there something along the lines … Read more

If option: show this. Else show nothing

Try this: <?php $options = get_option( ‘schema_theme_options’ ); $meta_desc = $options[‘metadescription’]; ?> <?php if( ( is_home() || is_front_page() ) && ” !== $meta_desc ) : ?> <meta name=”description” content=”<?php echo $meta_desc; ?>”> <?php endif; ?> It’s a bit neater and a bit more foolproof than the other proposed solution.

formatting horizontal and vertical images in Settings?

I would not alter the core intermediate image sizes. If you have custom image sizes, register them using add_image_size(). e.g. function mytheme_add_custom_image_sizes() { // Add “vertical” image add_image_size( ‘vertical-a’, 95, 117, true ); add_image_size( ‘vertical-b’, 130, 160, true ); // Add “horizontal” image add_image_size( ‘horizontal-a’, 440, 304, true ); add_image_size( ‘horizontal-b’, 220, 152, true ); … Read more

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