"; } $output = ""; $output .= "
" class="widefat edit-menu-item-target" name=""> > > >
:
$key) { $selected = ""; if($key == $mailchimp_list) $selected = 'selected="selected"'; $list .= "$answer"; } $list .= ""; echo $list; ?>
"", __('Boxed','avia_framework') => "boxed_form", ); $list = ""; foreach ($answers as $answer => $key) { $selected = ""; if($key == $styling) $selected = 'selected="selected"'; $list .= "$answer"; } $list .= ""; echo $list; ?>
"true", __('No','avia_framework') => "", ); $list = ""; foreach ($answers as $answer => $key) { $selected = ""; if($key == $double_optin) $selected = 'selected="selected"'; $list .= "$answer"; } $list .= ""; echo $list; ?>
true, '_builtin' => false ); $cpts = get_post_types( $args, 'names', 'and' ); if ( isset( $request->query_vars['post_type'] ) && in_array( $request->query_vars['post_type'], $cpts ) && true === $request->is_singular && - 1 == $request->current_post && true === $request->is_paged ) { add_filter( 'redirect_canonical', '__return_false' ); } return $request; } add_action( 'parse_query', 'avia_wp_cpt_request_redirect_fix' ); } /** * mobile sizes that overwrite elements default sizes */ if( ! function_exists( 'av_print_custom_font_size' ) ) { function av_print_custom_font_size( $request ) { echo AviaHelper::av_print_mobile_sizes(); } add_action( 'wp_footer', 'av_print_custom_font_size' ); } /** * disable element live preview */ if( ! function_exists( 'av_disable_live_preview' ) ) { function av_disable_live_preview( $data ) { if(avia_get_option('preview_disable') == "preview_disable") { $data['preview'] = 0; } return $data; } add_filter( 'avb_backend_editor_element_data_filter', 'av_disable_live_preview' ); } /** * enable developer options */ if( ! function_exists( 'av_enable_dev_options' ) ) { function av_enable_dev_options() { if(avia_get_option('developer_options') == "developer_options") { add_theme_support('avia_template_builder_custom_css'); } } add_action( 'init', 'av_enable_dev_options' ); } /** * Adds a copyright field to the upload and edit dialogue of the media manager * * @author tinabillinger * @since 4.3 */ if( ! function_exists( 'av_attachment_copyright_field_edit' ) ) { function av_attachment_copyright_field_edit($form_fields, $post) { $form_fields['av_copyright_field'] = array( 'label' => __('Copyright'), 'input' => "text", 'value' => get_post_meta( $post->ID, '_avia_attachment_copyright', true ), ); return $form_fields; } add_filter( 'attachment_fields_to_edit', 'av_attachment_copyright_field_edit', null, 2 ); } /** * Saves the copyright field created by filter above * * @author tinabillinger * @since 4.3 */ if( ! function_exists( 'av_attachment_copyright_field_save' ) ) { function av_attachment_copyright_field_save($post, $attachment) { if ( ! empty( $attachment['av_copyright_field'] ) ) { update_post_meta( $post['ID'], '_avia_attachment_copyright', $attachment['av_copyright_field'] ); } else { delete_post_meta( $post['ID'], '_avia_attachment_copyright' ); } return $post; } add_filter( 'attachment_fields_to_save', 'av_attachment_copyright_field_save', null, 2 ); } /** * Attaches the information from the copyright field to get_the_post_thumbnail() * The added tag is initally hidden by CSS, and can be made visible by choice * * @author tinabillinger * @since 4.3 */ /* * Add 'copyright info to get_the_post_thumbnail() */ if( ! function_exists( 'avia_post_thumbnail_html' ) ) { function avia_post_thumbnail_html($html, $post_id, $post_thumbnail_id, $size, $attr) { $attachment_id = get_post_thumbnail_id($post_id); $copyright_text = get_post_meta($attachment_id, '_avia_attachment_copyright', true ); if ($copyright_text) { $html .= "{$copyright_text}"; } return $html; } if (! is_admin()){ add_filter('post_thumbnail_html', 'avia_post_thumbnail_html', 99, 5); } } /** * Creates a modal window informing the user about the use of cookies on the site * Sets a cookie when the confirm button is clicked, and hides the box. * Resets the cookie once either of the text in the box is changed in theme options * * @author tinabillinger * @since 4.3 */ if( ! function_exists( 'av_cookie_consent' ) ) { function av_cookie_consent(){ if(avia_get_option('cookie_consent') == "cookie_consent") { $message = do_shortcode(avia_option('cookie_content', false, false, true)); $position = avia_get_option('cookie_position'); $buttontext = avia_option('cookie_buttontext', false, false, true); $body_layout = avia_option('color-body_style', false, false, true); $style = ""; if ($body_layout == 'av-framed-box') { $frame_width = avia_option('color-frame_width', false, false, true); $atts = array( 'width' => 'calc(100% - '.($frame_width*2).'px)', 'left' => $frame_width, 'bottom' => $frame_width, 'top' => $frame_width, 'left' => $frame_width, 'right' => $frame_width, ); if ($position == 'top' || $position == 'bottom') { $style .= AviaHelper::style_string($atts, 'width', 'width', ""); $style .= AviaHelper::style_string($atts, 'left', 'left', "px"); } if ($position == 'top-left') { $style .= AviaHelper::style_string($atts, 'left', 'left', "px"); $style .= AviaHelper::style_string($atts, 'top', 'top', "px"); } if ($position == 'top-right') { $style .= AviaHelper::style_string($atts, 'right', 'right', "px"); $style .= AviaHelper::style_string($atts, 'top', 'top', "px"); } if ($position == 'bottom-right') { $style .= AviaHelper::style_string($atts, 'right', 'right', "px"); $style .= AviaHelper::style_string($atts, 'bottom', 'bottom', "px"); } if ($position == 'bottom-left') { $style .= AviaHelper::style_string($atts, 'left', 'left', "px"); $style .= AviaHelper::style_string($atts, 'bottom', 'bottom', "px"); } if ($position == 'top') { $style .= AviaHelper::style_string($atts, 'top', 'top', "px"); } else if ($position == 'bottom') { $style .= AviaHelper::style_string($atts, 'bottom', 'bottom', "px"); } $style = AviaHelper::style_string($style); } ?>