Multipe array in meta_input

In your 2nd code snippet, you’re redefining $post_args for each $movie. Try this instead: $post_args = array(); foreach($movies as $movie) { $i++; $post_args[] = array( array( ‘key’ => ‘title’ . $i, ‘value’ => $movie[‘title’] ), array( ‘key’ => ‘qty’ . $i, ‘value’ => $movie[‘qty’] ), array( ‘key’ => ‘desc’ . $i, ‘value’ => $movie[‘desc’] ) … Read more

How to get files from loop for zip

As the files are within the same WP installation (not a remote), you don’t need to download the file using get_file_contents(), try to add the file using its absolute path of the attachment. if(isset($_POST[‘download’])){ $tmpFile = tempnam(‘/tmp’, ”); $zip = new ZipArchive(); $zip->open($tmpFile, ZipArchive::CREATE); foreach( $list_posts as $list_item ) : if ( $list_item->post_type == ‘crb_photo’ … Read more

Order Categories by Character Count

This is probably more a question about PHP rather than WordPress, and as such may be closed as off-topic for this site. That said, you can usort() to sort an array using a custom comparison function: usort( $listings->loop[‘cats’], function( $a, $b ){ return strlen( $a->name ) – strlen( $b->name ); } ); After the call … Read more

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