woocommerce_product_downloads_approved_directory_validation_for_shortcodes

woocommerce_product_downloads_approved_directory_validation_for_shortcodes

Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.6.9.0

apply_filters('woocommerce_product_downloads_approved_directory_validation_for_shortcodes') is found 2 times:

  • /includes/class-wc-product-download.php line 222
    		 * Controls whether shortcodes should be resolved and validated using the Approved Download Directory feature.
    		 *
    		 * @param bool $should_validate
    		 */
    		if ( apply_filters( 'woocommerce_product_downloads_approved_directory_validation_for_shortcodes', true ) && 'shortcode' === $this->get_type_of_file_path() ) {
    			$download_file = do_shortcode( $download_file );
    		}
    
    		$is_site_administrator   = is_multisite() ? current_user_can( 'manage_sites' ) : current_user_can( 'manage_options' );
    		$valid_storage_directory = $download_directories->is_valid_path( $download_file );
    
    
  • /src/Internal/ProductDownloads/ApprovedDirectories/Synchronize.php line 229
    				 * Controls whether shortcodes should be resolved and validated using the Approved Download Directory feature.
    				 *
    				 * @param bool $should_validate
    				 */
    				if ( apply_filters( 'woocommerce_product_downloads_approved_directory_validation_for_shortcodes', true ) && 'shortcode' === $downloadable->get_type_of_file_path() ) {
    					$download_file = do_shortcode( $download_file );
    				}
    
    				$parent_url = ( new URL( $download_file ) )->get_parent_url();
    				$this->register->add_approved_directory( $parent_url, false );
    			} catch ( Exception $e ) {