update_option is not saving an array, but saving the string ‘Array’

It sounds like your array isn’t being serialized before updating the option for whatever reason. Perhaps due to ajax or just your particular situation. Try this: // … $option[ ‘apps’ ][] = $new_app; if( ! is_serialized( $option ) ) $option = maybe_serialize( $option ); $data = update_option( ‘vm_fbconnect’, $option ); // …

Google fonts dropdown in Options Framework

Should be very easy since its has a hook right in place so something like, add_filter(‘of_recognized_font_faces’,’add_google_fonts_list’); function add_google_fonts_list($defaults){ //add as many as you want $mine = array( ‘Ubuntu’ => “‘Ubuntu’, sans-serif”, ‘Lobster’ => “‘Lobster’, cursive”, ); return array_merge($mine,$defaults); } and when you render the css make sure to add the right import ex: @import url(http://fonts.googleapis.com/css?family=Ubuntu);

The Correct Way to Use Nonce Field without Settings API

This is a very basic nonce setup for a plugin: Create your nonce input in the form: wp_nonce_field( basename(__FILE__), $nonce_key ); Then check your nonce once submitted: if ( empty($_POST[$nonce_key]) || ! wp_verify_nonce( $_POST[$nonce_key], basename(__FILE__) ) ) return; basename(FILE) just uses the current filename (eg: plugin_options.php) to create the nonce string. You need to provide … Read more

WordPress custom admin functions security

Read about “Nonces”. Create one and append it to your URL: $url=”example.php?filename=whatever&nonce=” . wp_create_nonce(‘my_sensitive_action’); When your request is fulfilled check for it: // here verify if the nonce was used before if(wp_verify_nonce($_GET[‘nonce’], ‘my_sensitive_action’)){ // it’s ok, it wasn’t used before } Also the validity of these nonces has a time limit, like one day or … Read more

populate array with posts

After getting the posts you can easily put them in another array & then return that array function get_sponsors() { $args = array( ‘numberposts’ => -1, ‘post_type’ => ‘movies’ ); $my_movies = get_posts($args); $options = array(); foreach($my_movies as $m) $options[$m->ID] = array( ‘label’ => $m->post_title, ‘value’ => $m->ID ); return $options; }

Saving widget options from class method

Why are you writing your own save handlers for widgets? The update method your widget class will take care of this. You’re saving per widget settings, exactly what the Widget API was designed to do. <?php class WPSE76224_Widget extends WP_Widget { public function __construct() { // Create the widget options and such here, then call … Read more

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