• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_Register_Meta::remove_blank_rows() – Don’t save blank rows.

You appear to be a bot. Output may be restricted

Description

Don't save blank rows.

When saving, check the price and file table for blank rows. If the name of the price or file is empty, that row should not be saved.

Usage

$array = EDD_Register_Meta::remove_blank_rows( $new );

Parameters

$new
( array ) required – Array of all the meta values

Returns

array $new New meta value with empty keys removed

Source

File name: easy-digital-downloads/includes/class-edd-register-meta.php
Lines:

1 to 12 of 12
  private function remove_blank_rows( $new ) {

    if ( is_array( $new ) ) {
      foreach ( $new as $key => $value ) {
        if ( empty( $value['name'] ) && empty( $value['amount'] ) && empty( $value['file'] ) ) {
          unset( $new[ $key ] );
        }
      }
    }

    return $new;
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 26th November 2019

Primary Sidebar

Information

Function name: EDD_Register_Meta::remove_blank_rows
Class ref: EDD_Register_Meta
Plugin ref: Easy Digital Downloads
Version: 2.9.26
Sourcefile: includes/class-edd-register-meta.php
File ref: includes/class-edd-register-meta.php
Deprecated?: No
API Letters: B,E,M,R

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.6.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites