PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/photostockmall.online/wp-content/plugins/edd-wish-lists/includes/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //home/trave494/photostockmall.online/wp-content/plugins/edd-wish-lists/includes/shortcodes.php

<?php
/**
 * Shortcodes
 *
 * @since 1.0
*/

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * View wishlist shortcode
 *
 * @since 1.0
*/
function edd_wl_view_shortcode( $atts, $content = null ) {
	extract( shortcode_atts( array(
			'id' => '',
			'title' => '',
		), $atts, 'edd_wish_lists_view' )
	);

  	// prevent list from displaying if it's private
	if ( edd_wl_is_private_list() ) {
		return;
	}

	$content = '<div class="edd-wl-view">' . edd_wl_load_template( 'view' ) . '</div>';

	return $content;
}
add_shortcode( 'edd_wish_lists_view', 'edd_wl_view_shortcode' );

/**
 * Wishlist edit shortcode
 *
 * @since 1.0
*/
function edd_wl_edit_shortcode( $atts, $content = null ) {
	extract( shortcode_atts( array(
			'id' => '',
			'title' => '',
		), $atts, 'edd_wish_lists_edit' )
	);

	// prevent list from displaying if it's private
	if ( edd_wl_is_private_list() ) {
		return;
	}

	$content = '<div class="edd-wl-edit">' . edd_wl_load_template( 'edit' ) . '</div>';

	return $content;
}
add_shortcode( 'edd_wish_lists_edit', 'edd_wl_edit_shortcode' );

/**
 * Add wishlist shortcode
 *
 * @since 1.0
*/
function edd_wl_create_shortcode( $atts, $content = null ) {
	extract( shortcode_atts( array(
			'id' => '',
			'title' => '',
		), $atts, 'edd_wish_lists_create' )
	);

	// exit if no wish list create page is set
	if ( 'none' == edd_get_option( 'edd_wl_page_create' ) ) {
		return;
	}

	$content = '<div class="edd-wl-create">' . edd_wl_load_template( 'create' ) . '</div>';

	return $content;
}
add_shortcode( 'edd_wish_lists_create', 'edd_wl_create_shortcode' );


/**
 * View Wish Lists shortcode
 *
 * @param  array $atts
 * @param  $content
 * @return object
 * @since  1.0
 */
function edd_wl_shortcode( $atts, $content = null ) {
	extract( shortcode_atts( array(
			'id' => '',
			'title' => '',
		), $atts, 'edd_wish_lists' )
	);

	// exit if no wish list page is set
	if ( 'none' == edd_get_option( 'edd_wl_page' ) ) {
		return;
	}	

	$content = '<div class="edd-wl-wish-lists">' . edd_wl_wish_list() . '</div>';

	return $content;
}
add_shortcode( 'edd_wish_lists', 'edd_wl_shortcode' );

/**
 * Add to wish list shortcode
 *
 * @param  array $atts
 * @param  $content
 * @return object
 * @since  1.0
 */
function edd_wl_add_to_list_shortcode( $atts, $content = null ) {
	global $post, $edd_options;

	extract( shortcode_atts( array(
			'id' 		=> $post->ID,
			'text' 		=> ! empty( $edd_options[ 'edd_wl_add_to_wish_list' ] ) ? $edd_options[ 'edd_wl_add_to_wish_list' ] : __( 'Add to wish list', 'edd-wish-lists' ),
			'icon'		=> $edd_options[ 'edd_wl_icon' ] ? $edd_options[ 'edd_wl_icon' ] : 'star',
			'option'	=> 1, 		// default variable pricing option
			'style'		=> $edd_options[ 'edd_wl_button_style' ] ? $edd_options[ 'edd_wl_button_style' ] : 'button',
		), $atts, 'edd_wish_lists_add' )
	);

    $args = apply_filters( 'edd_wl_add_to_list_shortcode', array(
		'download_id' 	=> $id,
		'text' 			=> $text,
		'icon'			=> $icon,
		'style'			=> $style,
		'action'		=> 'edd_wl_open_modal',
		'class'			=> 'edd-wl-open-modal edd-wl-action before',
		'price_option'	=> $option,
		'shortcode'		=> true // used to return the links, not echo them in edd_wl_wish_list_link()
	), $id, $option );

	$content = edd_wl_wish_list_link( $args );

	// load required scripts for this shortcode
	wp_enqueue_script( 'edd-wl' );
	wp_enqueue_script( 'edd-wl-modal' );

	return $content;
}
add_shortcode( 'edd_wish_lists_add', 'edd_wl_add_to_list_shortcode' );