meaning of (array)function()

You are looking at type casting: http://php.net/manual/en/language.types.type-juggling.php What the code does is caste the value returned by get_option() to an array. It is being done so that array_merge() works correctly and doesn’t trigger warnings/errors. That much is pure PHP and is off-topic. The only reason I chose to answer rather than to post a comment … Read more

post_parent array doesn’t work

It’s not recommended to use query_posts(), check for example this warning note in the Codex: This function isn’t meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. query_posts() is overly simplistic and problematic way to modify main query of a page by … Read more

Save meta value as an array of arrays

If you don’t need to query on the data, you can pass arrays directly to the post meta functions, WordPress will automatically serialize/unserialize the data for you. $your_array = array( array( ‘title’ => ‘something’, ‘price’ => ‘something’, ), array( ‘title’ => ‘something’, ‘price’ => ‘something’, ), ); update_post_meta( $post_id, ‘your_key’, $your_array );

Website Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘Wppr_Public’ does not have a method ‘amp_support’

The warning message is pretty clear. You’re passing method amp_support from class Wppr_Public as callback, but this class doesn;t have such method… So how to fix it? You should find that class and look for this function. Maybe it’s some typo or that method changed its name or moved to another class or something like … Read more

how to get post order by post id wp_query?

OK, so you want to define posts order by yourself. WP_Query allows you to do that – you’ll have to use orderby => post__in to achieve it. And that’s what you do. So why isn’t it working? Because of a typo 😉 Ordering posts by post__in preserves post ID order given in the ‘post__in’ array. … Read more