Title: Function does not fill zero values (All Import Pro)
Last modified: November 8, 2017

---

# Function does not fill zero values (All Import Pro)

 *  Resolved [covacs77](https://wordpress.org/support/users/covacs77/)
 * (@covacs77)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/function-does-not-fill-zero-values-all-import-pro/)
 * Hello!
 * I created the code so as not to fill empty lines when importing
 *     ```
       <?php
       $mass = {column_5[1]};
       if ( !empty ($mass)) {
       echo "<p>Author: ".$mass[0]."</p>";
       }
       ?>
       ```
   
 * It is not right to insert this into the visual editor window. How to correctly
   create a function to use when importing to not insert empty and zero values?

Viewing 1 replies (of 1 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/function-does-not-fill-zero-values-all-import-pro/#post-9668205)
 * Hi [@covacs77](https://wordpress.org/support/users/covacs77/)
 * You can either use an XPath IF statement for this, example:
 * `[IF({column_5[1][.!="0" and .!=""]})]<p>Author: {column_5[1]}</p>[ELSE][ENDIF]`
 * Or, you can pass the element to a PHP function in the import template like so:[
   my_check_author({column_5[1]})]. Then, add this code to the Function Editor:
 *     ```
       function my_check_author( $author = '' ) {
           return ( empty( $author ) ) ? null : "<p>Author: " . $author . "</p>";
       }
       ```
   
 * Read more here: [http://www.wpallimport.com/documentation/developers/execute-php/](http://www.wpallimport.com/documentation/developers/execute-php/).

Viewing 1 replies (of 1 total)

The topic ‘Function does not fill zero values (All Import Pro)’ is closed to new
replies.

 * ![](https://ps.w.org/wp-all-export/assets/icon-256x256.png?rev=2570162)
 * [WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel](https://wordpress.org/plugins/wp-all-export/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-export/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-export/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-export/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-export/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-export/reviews/)

## Tags

 * [empty lines](https://wordpress.org/support/topic-tag/empty-lines/)
 * [Import](https://wordpress.org/support/topic-tag/import/)

 * 1 reply
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/function-does-not-fill-zero-values-all-import-pro/#post-9668205)
 * Status: resolved