Remove Body Classes

One (untested) suggestion is to replace: unset( $classes[array_search($body_classes, $classes)] ); with $classes = array_diff( $classes, wp_parse_slug_list( $body_classes ) ); assuming the classes survive sanitize_title from wp_parse_slug_list(). It should also be alright with empty arrays. We also note that wp_parse_slug_list() is using wp_parse_list() to parse the comma separated string.

Stuck with a Custom Field Check box Array

It’s a serialized string. Use Unserialize to get an array out of this. Also checkout WP’s maybe_unserialize method. <?php $string = “s:19.a:1:{i:0;s2”; //Using WP maybe_unserialize $result1 = maybe_unserialize($string); //Using PHP unserialize $result2 = unserialize($string); echo “<pre>”; print_r($result1); print_r($result2) echo “</pre>”; ?> $result will hold what you want.

How to store multiple values in 1 meta_key with radio input?

John, I’m not sure how you have the radio button set up, but WordPress easily handles multiple values in one meta_key. You simply need to place the values in an array before sending it to update_post_meta. For instance: $array = array( ‘foo’ => ‘foo_value’, ‘bar’ => ‘bar_value’ ); update_post_meta( $id, ‘my_meta_key’, $array ); WordPress automatically … Read more

Echoing a variable inside a function

Use the Settings API. A look at my latest plugin may help you to understand how to register a save function for your fields. Most relevant excerpt: /** * Register custom settings for the fields. * * @see save_settings() * @see print_input_field() * @return void */ public function add_contact_fields() { register_setting( ‘general’, $this->option_name, array ( … Read more

Create an Array of Specific Custom Post Meta

If I’m understanding your issue correctly, and if by ‘project title’ you mean the content of the post_title field, then it’ll look something like this: $post_data = array(); $my_query = new WP_Query( $whatever_your_args_are ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); $post_data[] = array( ‘project_title’ => get_the_title(), ‘latitude’ => get_post_meta( get_the_ID(), … Read more

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