esc_html__( 'Do Not Hide', 'absolute-weaver' ), 's-hide' => esc_html__( 'Hide: Phones', 'absolute-weaver' ), 'm-hide' => esc_html__( 'Hide: Small Tablets', 'absolute-weaver' ), 'm-hide s-hide' => esc_html__( 'Hide: Phones+Tablets', 'absolute-weaver' ), 'l-hide' => esc_html__( 'Hide: Desktop', 'absolute-weaver' ), 'l-hide m-hide' => esc_html__( 'Hide: Desktop+Tablets', 'absolute-weaver' ), 'hide' => esc_html__( 'Hide on All Devices', 'absolute-weaver' ), ); } function aweaver_cz_choices_hide_sanitize( $val ) { $choices = aweaver_cz_choices_hide(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_render_header() { // coordinate these options with generatecss.php! return array( 'header-as-img' => esc_html__( 'As img in header', 'absolute-weaver' ), 'header-as-bg' => esc_html__( 'As static BG image', 'absolute-weaver' ), 'header-as-bg-responsive' => esc_html__( 'As responsive BG image', 'absolute-weaver' ), 'header-as-bg-parallax' => esc_html__( 'As parallax BG image', 'absolute-weaver' ), ); } function aweaver_cz_choices_render_header_sanitize( $val ) { $choices = aweaver_cz_choices_render_header(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_render_header_video() { // coordinate these options with generatecss.php! return array( 'has-header-video' => esc_html__( 'As video in header only', 'absolute-weaver' ), 'has-header-video-cover' => esc_html__( 'As full cover Parallax BG Video', 'absolute-weaver' ), 'has-header-video-none' => esc_html__( 'Disable Header Video', 'absolute-weaver' ), ); } function aweaver_cz_choices_render_header_video_sanitize( $val ) { $choices = aweaver_cz_choices_render_header_video(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_header_video_aspect() { // coordinate these options with generatecss.php! return array( '16:9' => esc_html__( '16:9 HDTV', 'absolute-weaver' ), '4:3' => esc_html__( '4:3 Std TV', 'absolute-weaver' ), '3:2' => esc_html__( '3:2 35mm Photo', 'absolute-weaver' ), '5:3' => esc_html__( '5:3 Alternate Photo', 'absolute-weaver' ), '64:27' => esc_html__( '2.37:1 Cinemascope', 'absolute-weaver' ), '37:20' => esc_html__( '1.85:1 VistaVision', 'absolute-weaver' ), '3:1' => esc_html__( '3:1 Banner', 'absolute-weaver' ), '4:1' => esc_html__( '4:1 Banner', 'absolute-weaver' ), '9:16' => esc_html__( '9:16 Vertical HD (Please avoid!)', 'absolute-weaver' ), ); } function aweaver_cz_choices_header_video_aspect_sanitize( $val ) { $choices = aweaver_cz_choices_header_video_aspect(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_align() { return array( 'float-left' => esc_html__( 'Align Left', 'absolute-weaver' ), 'align-center' => esc_html__( 'Center', 'absolute-weaver' ), 'float-right' => esc_html__( 'Align Right', 'absolute-weaver' ), 'alignnone' => esc_html__( 'No Alignment', 'absolute-weaver' ), 'alignwide' => esc_html__( 'Align Wide', 'absolute-weaver' ), 'alignfull' => esc_html__( 'Align Full', 'absolute-weaver' ), ); } function aweaver_cz_choices_align_sanitize( $val ) { $choices = aweaver_cz_choices_align(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_align_standard() { return array( 'float-left' => esc_html__( 'Align Left', 'absolute-weaver' ), 'align-center' => esc_html__( 'Center', 'absolute-weaver' ), 'float-right' => esc_html__( 'Align Right', 'absolute-weaver' ), 'alignnone' => esc_html__( 'No Alignment', 'absolute-weaver' ), ); } function aweaver_cz_choices_align_standard_sanitize( $val ) { $choices = aweaver_cz_choices_align_standard(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_align_menu() { return array( 'left' => esc_html__( 'Align Left', 'absolute-weaver' ), 'center' => esc_html__( 'Center', 'absolute-weaver' ), 'right' => esc_html__( 'Align Right', 'absolute-weaver' ), 'alignwide' => esc_html__( 'Align Wide', 'absolute-weaver' ), 'alignwide left' => esc_html__( 'Align Wide, Items Left', 'absolute-weaver' ), 'alignwide center' => esc_html__( 'Align Wide, Items Center', 'absolute-weaver' ), 'alignwide right' => esc_html__( 'Align Wide, Items Right', 'absolute-weaver' ), 'alignfull' => esc_html__( 'Align Full', 'absolute-weaver' ), 'alignfull left' => esc_html__( 'Align Full, Items Left', 'absolute-weaver' ), 'alignfull center' => esc_html__( 'Align Full, Items Center', 'absolute-weaver' ), 'alignfull right' => esc_html__( 'Align Full, Items Right', 'absolute-weaver' ), ); } function aweaver_cz_choices_align_menu_sanitize( $val ) { $choices = aweaver_cz_choices_align_menu(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_repeat() { return array( 'repeat' => esc_html__( 'Tile', 'absolute-weaver' ), 'repeat-x' => esc_html__( 'Tile Horizontally', 'absolute-weaver' ), 'repeat-y' => esc_html__( 'Tile Vertically', 'absolute-weaver' ), 'no-repeat' => esc_html__( 'No Tiling', 'absolute-weaver' ), ); } function aweaver_cz_choices_repeat_sanitize( $val ) { $choices = aweaver_cz_choices_repeat(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_border_style() { return array( 'solid' => esc_html__( 'Solid', 'absolute-weaver' ), 'dotted' => esc_html__( 'Dotted', 'absolute-weaver' ), 'dashed' => esc_html__( 'Dashed', 'absolute-weaver' ), 'double' => esc_html__( 'Double', 'absolute-weaver' ), 'groove' => esc_html__( 'Groove', 'absolute-weaver' ), 'ridge' => esc_html__( 'Ridge', 'absolute-weaver' ), 'inset' => esc_html__( 'Inset', 'absolute-weaver' ), 'outset' => esc_html__( 'Outset', 'absolute-weaver' ), ); } function aweaver_cz_choices_border_style_sanitize( $val ) { $choices = aweaver_cz_choices_border_style(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_nav_style() { return array( 'old_new' => esc_html__( 'Older/Newer', 'absolute-weaver' ), 'prev_next' => esc_html__( 'Previous/Next', 'absolute-weaver' ), 'paged_left' => esc_html__( 'Paged - Left', 'absolute-weaver' ), 'paged_right' => esc_html__( 'Paged - Right', 'absolute-weaver' ), ); } function aweaver_cz_choices_nav_style_sanitize( $val ) { $choices = aweaver_cz_choices_nav_style(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_single_nav_style() { return array( 'title' => esc_html__( 'Post Titles', 'absolute-weaver' ), 'prev_next' => esc_html__( 'Previous/Next', 'absolute-weaver' ), 'hide' => esc_html__( 'None - no display', 'absolute-weaver' ), ); } function aweaver_cz_choices_single_nav_style_sanitize( $val ) { $choices = aweaver_cz_choices_single_nav_style(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_columns() { return array( '1' => esc_html__( '1 Column', 'absolute-weaver' ), '2' => esc_html__( '2 Columns', 'absolute-weaver' ), '3' => esc_html__( '3 Columns', 'absolute-weaver' ), '4' => esc_html__( '4 Columns', 'absolute-weaver' ), ); } function aweaver_cz_choices_columns_sanitize( $val ) { $choices = aweaver_cz_choices_columns(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_post_columns() { return array( '1' => esc_html__( '1 Column', 'absolute-weaver' ), '2' => esc_html__( '2 Columns', 'absolute-weaver' ), '3' => esc_html__( '3 Columns', 'absolute-weaver' ), ); } function aweaver_cz_choices_post_columns_sanitize( $val ) { $choices = aweaver_cz_choices_post_columns(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_pointer() { return array( 'pointer' => esc_html__( 'Pointer ( ndicates link)', 'absolute-weaver' ), 'context-menu' => esc_html__( 'Context Menu available', 'absolute-weaver' ), 'text' => esc_html__( 'Text', 'absolute-weaver' ), 'none' => esc_html__( 'No pointer', 'absolute-weaver' ), 'not-allowed' => esc_html__( 'Action not allowed', 'absolute-weaver' ), 'default' => esc_html__( 'The default cursor', 'absolute-weaver' ), ); } function aweaver_cz_choices_pointer_sanitize( $val ) { $choices = aweaver_cz_choices_pointer(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_fi_location() { return array( 'content-top' => esc_html__( 'With Content - top', 'absolute-weaver' ), 'content-bottom' => esc_html__( 'With Content - bottom', 'absolute-weaver' ), 'title-before' => esc_html__( 'With Title', 'absolute-weaver' ), 'title-banner' => esc_html__( 'Banner above Title', 'absolute-weaver' ), 'header-image' => esc_html__( 'Header Image Replacement', 'absolute-weaver' ), 'post-before' => esc_html__( 'Before Page/Post, no wrap', 'absolute-weaver' ), 'post-bg' => esc_html__( 'As BG Image, Tile', 'absolute-weaver' ), 'post-bg-cover' => esc_html__( 'As BG Image, Cover', 'absolute-weaver' ), 'post-bg-parallax' => esc_html__( 'As BG Image, Parallax', 'absolute-weaver' ), 'post-bg-parallax-full' => esc_html__( 'As BG Image, Parallax Full', 'absolute-weaver' ), ); } function aweaver_cz_choices_fi_location_sanitize( $val ) { $choices = aweaver_cz_choices_fi_location(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_fi_size() { return array( 'thumbnail' => esc_html__( 'Thumbnail', 'absolute-weaver' ), 'medium' => esc_html__( 'Medium', 'absolute-weaver' ), 'large' => esc_html__( 'Large', 'absolute-weaver' ), 'full' => esc_html__( 'Full', 'absolute-weaver' ), ); } function aweaver_cz_choices_fi_size_sanitize( $val ) { $choices = aweaver_cz_choices_fi_size(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_fi_align() { return array( 'fi-alignleft' => esc_html__( 'Align Left', 'absolute-weaver' ), 'fi-aligncenter' => esc_html__( 'Center', 'absolute-weaver' ), 'fi-alignright' => esc_html__( 'Align Right', 'absolute-weaver' ), 'fi-alignnone' => esc_html__( 'No Align', 'absolute-weaver' ), ); } function aweaver_cz_choices_fi_align_sanitize( $val ) { $choices = aweaver_cz_choices_fi_align(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_show_avatar() { return array( 'hide' => esc_html__( 'Do Not Show', 'absolute-weaver' ), 'start' => esc_html__( 'Start of Info Line', 'absolute-weaver' ), 'end' => esc_html__( 'End of Info Line', 'absolute-weaver' ), ); } function aweaver_cz_choices_show_avatar_sanitize( $val ) { $choices = aweaver_cz_choices_show_avatar(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_post_icons() { return array( 'text' => esc_html__( 'Text Descriptions', 'absolute-weaver' ), 'fonticons' => esc_html__( 'Font Icons', 'absolute-weaver' ), 'graphics' => esc_html__( 'Graphic Icons', 'absolute-weaver' ), ); } function aweaver_cz_choices_post_icons_sanitize( $val ) { $choices = aweaver_cz_choices_post_icons(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_font_size() { return array( 'default' => esc_html__( 'Inherit', 'absolute-weaver' ), 'm-font-size' => esc_html__( 'Medium Font', 'absolute-weaver' ), 'xxs-font-size' => esc_html__( 'XX-Small Font', 'absolute-weaver' ), 'xs-font-size' => esc_html__( 'X-Small Font', 'absolute-weaver' ), 's-font-size' => esc_html__( 'Small Font', 'absolute-weaver' ), 'l-font-size' => esc_html__( 'Large Font', 'absolute-weaver' ), 'xl-font-size' => esc_html__( 'X-Large Font', 'absolute-weaver' ), 'xxl-font-size' => esc_html__( 'XX-Large Font', 'absolute-weaver' ), 'customA-font-size' => esc_html__( 'Custom Size A', 'absolute-weaver' ), 'customB-font-size' => esc_html__( 'Custom Size B', 'absolute-weaver' ), ); } function aweaver_cz_choices_font_size_sanitize( $val ) { $choices = aweaver_cz_choices_font_size(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_list_bullets() { return array( 'disc' => esc_html__( 'Filled Disc', 'absolute-weaver' ), 'circle' => esc_html__( 'Circle', 'absolute-weaver' ), 'square' => esc_html__( 'Square', 'absolute-weaver' ), 'none' => esc_html__( 'None', 'absolute-weaver' ), ); } function aweaver_cz_choices_list_bullets_sanitize( $val ) { $choices = aweaver_cz_choices_list_bullets(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_site_layout() { return array( '' => esc_html__( 'Custom: Use Full Width Checkbox Options ', 'absolute-weaver' ), 'fullwidth' => esc_html__( 'Full Width - Extend BG to full width', 'absolute-weaver' ), 'stretched' => esc_html__( 'Stretched - Expand to full width', 'absolute-weaver' ), //'boxed' => esc_html__( 'Boxed - Traditional constrained layout', 'absolute-weaver' ), //'custom' => esc_html__( 'Custom - Use Custom Full Width Options', 'absolute-weaver' ) //'custom' => esc_html__( 'Traditional - Use Full Width Checkbox Options ', 'absolute-weaver' ) ); } function aweaver_cz_choices_site_layout_sanitize( $val ) { $choices = aweaver_cz_choices_site_layout(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_fixed_menu() { return array( 'none' => esc_html__( 'Standard Position : Not Fixed', 'absolute-weaver' ), 'fixed-top' => esc_html__( 'Fixed to Top', 'absolute-weaver' ), 'scroll-fix' => esc_html__( 'Fix to Top on Scroll', 'absolute-weaver' ), ); } function aweaver_cz_choices_fixed_menu_sanitize( $val ) { $choices = aweaver_cz_choices_fixed_menu(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_font_family() { $base = array( 'inherit' => esc_html__( 'Inherit', 'absolute-weaver' ), ); $google = array( 'google' => esc_html__( '---* Google Fonts ( For All Browsers ) *', 'absolute-weaver' ), 'sans-g' => esc_html__( '--- -- Sans-Serif Google Fonts --', 'absolute-weaver' ), 'open-sans' => esc_html__( 'Open Sans', 'absolute-weaver' ), 'open-sans-condensed' => esc_html__( 'Open Sans Condensed', 'absolute-weaver' ), 'alegreya-sans' => esc_html__( 'Alegreya Sans', 'absolute-weaver' ), 'alegreya-sans-sc' => esc_html__( 'Alegreya Sans SC', 'absolute-weaver' ), 'archivo-black' => esc_html__( 'Archivo Black', 'absolute-weaver' ), 'arimo' => esc_html__( 'Arimo', 'absolute-weaver' ), 'droid-sans' => esc_html__( 'Droid Sans', 'absolute-weaver' ), 'exo-2' => esc_html__( 'Exo 2', 'absolute-weaver' ), 'lato' => esc_html__( 'Lato', 'absolute-weaver' ), 'roboto' => esc_html__( 'Roboto', 'absolute-weaver' ), 'roboto-condensed' => esc_html__( 'Roboto Condensed', 'absolute-weaver' ), 'source-sans-pro' => esc_html__( 'Source Sans Pro', 'absolute-weaver' ), 'serif-g' => esc_html__( '--- -- Serif Google Fonts --', 'absolute-weaver' ), 'alegreya' => esc_html__( 'Alegreya', 'absolute-weaver' ), 'alegreya-sc' => esc_html__( 'Alegreya SC', 'absolute-weaver' ), 'arvo' => esc_html__( 'Arvo Slab', 'absolute-weaver' ), 'droid-serif' => esc_html__( 'Droid Serif', 'absolute-weaver' ), 'lora' => esc_html__( 'Lora', 'absolute-weaver' ), 'roboto-slab' => esc_html__( 'Roboto Slab', 'absolute-weaver' ), 'source-serif-pro' => esc_html__( 'Source Serif Pro', 'absolute-weaver' ), 'tinos' => esc_html__( 'Tinos', 'absolute-weaver' ), 'vollkorn' => esc_html__( 'Vollkorn', 'absolute-weaver' ), 'ultra' => esc_html__( 'Ultra Black', 'absolute-weaver' ), 'mono-g' => esc_html__( '--- -- Monospace Google Fonts --', 'absolute-weaver' ), 'inconsolata' => esc_html__( 'Inconsolata', 'absolute-weaver' ), 'roboto-mono' => esc_html__( 'Roboto Mono', 'absolute-weaver' ), 'cursive-g' => esc_html__( '--- -- "Cursive" Google Fonts --', 'absolute-weaver' ), 'handlee' => esc_html__( 'Handlee', 'absolute-weaver' ), 'blank-w' => esc_html__( '--- ', 'absolute-weaver' ), ); $web = array( 'web' => esc_html__( '---* Web Fonts *', 'absolute-weaver' ), 'web-hote' => esc_html__( '--- - May not match on Android/iOS -', 'absolute-weaver' ), 'sans-w' => esc_html__( '--- -- Sans-Serif Web Fonts --', 'absolute-weaver' ), 'sans-serif' => esc_html__( 'Arial', 'absolute-weaver' ), 'arialBlack' => esc_html__( 'Arial Black', 'absolute-weaver' ), 'arialNarrow' => esc_html__( 'Arial Narrow', 'absolute-weaver' ), 'lucidaSans' => esc_html__( 'Lucida Sans', 'absolute-weaver' ), 'trebuchetMS' => esc_html__( 'Trebuchet MS', 'absolute-weaver' ), 'verdana' => esc_html__( 'Verdana', 'absolute-weaver' ), 'serif-w' => esc_html__( '--- -- Serif Web Fonts --', 'absolute-weaver' ), 'serif' => esc_html__( 'Times', 'absolute-weaver' ), 'cambria' => esc_html__( 'Cambria', 'absolute-weaver' ), 'garamond' => esc_html__( 'Garamond', 'absolute-weaver' ), 'georgia' => esc_html__( 'Georgia', 'absolute-weaver' ), 'lucidaBright' => esc_html__( 'Lucida Bright', 'absolute-weaver' ), 'palatino' => esc_html__( 'Palatino', 'absolute-weaver' ), 'mono-w' => esc_html__( '--- -- Monospace Web Fonts --', 'absolute-weaver' ), 'monospace' => esc_html__( 'Courier', 'absolute-weaver' ), 'consolas' => esc_html__( 'Consolas', 'absolute-weaver' ), 'cursive-w' => esc_html__( '--- -- "Cursive" Web Fonts --', 'absolute-weaver' ), 'papyrus' => esc_html__( 'Papyrus', 'absolute-weaver' ), 'comicSans' => esc_html__( 'Comic Sans MS', 'absolute-weaver' ), ); $gfonts = aweaver_getopt_array( 'fonts_added' ); if ( ! empty( $gfonts ) ) { foreach ( $gfonts as $gfont => $val ) { // $gfont has slug, $val has vals $base[ $gfont ] = $val['name'] . ' (' . AWEAVER_PLUS_ICON . 'font)'; } } if ( ! aweaver_getopt( 'disable_google_fonts' ) ) { $base = array_merge( $base, $google ); } $base = array_merge( $base, $web ); return $base; } function aweaver_cz_choices_font_family_sanitize( $val ) { $choices = aweaver_cz_choices_font_family(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_bold_italic() { return array( '' => esc_html__( 'Inherit', 'absolute-weaver' ), 'on' => esc_html__( 'On', 'absolute-weaver' ), 'off' => esc_html__( 'Off', 'absolute-weaver' ), ); } function aweaver_cz_choices_bold_italic_sanitize( $val ) { $choices = aweaver_cz_choices_bold_italic(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_sb_layout() { return array( 'right' => esc_html__( 'Sidebars on Right', 'absolute-weaver' ), 'right-top' => esc_html__( 'Sidebars on Right (stack top)', 'absolute-weaver' ), 'left' => esc_html__( 'Sidebars on Left', 'absolute-weaver' ), 'left-top' => esc_html__( 'Sidebars on Left (stack top)', 'absolute-weaver' ), 'split' => esc_html__( 'Split - Sidebars on Right and Left', 'absolute-weaver' ), 'split-top' => esc_html__( 'Split (stack top)', 'absolute-weaver' ), 'one-column' => esc_html__( 'No sidebars, content only', 'absolute-weaver' ), ); } function aweaver_cz_choices_sb_layout_sanitize( $val ) { $choices = aweaver_cz_choices_sb_layout(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_elementor_pages() { $pargs = array( 'post_type' => 'page', ); $posts = get_pages( $pargs ); $post_list = array(); $post_list[''] = esc_html__( 'None', 'absolute-weaver' ); foreach ( $posts as $post ) { if ( ! ! get_post_meta( $post->ID, '_elementor_edit_mode', true ) ) { $post_list[ $post->ID ] = substr( $post->post_title, 0, 60 ); } } $posts = get_posts( array( 'post_type' => 'post', ) ); foreach ( $posts as $post ) { if ( ! ! get_post_meta( $post->ID, '_elementor_edit_mode', true ) ) { $post_list[ $post->ID ] = substr( $post->post_title, 0, 60 ) . esc_html__( ' (post)', 'absolute-weaver' ); } } $posts = ''; return $post_list; } function aweaver_cz_choices_elementor_pages_sanitize( $val ) { return $val; } function aweaver_cz_choices_siteorigin_pages() { $pargs = array( 'post_type' => 'page', ); $posts = get_pages( $pargs ); $post_list = array(); $post_list[''] = esc_html__( 'None', 'absolute-weaver' ); foreach ( $posts as $post ) { if ( ! ! get_post_meta( $post->ID, 'panels_data', true ) ) { $post_list[ $post->ID ] = substr( $post->post_title, 0, 60 ); } } $posts = get_posts( array( 'post_type' => 'post', ) ); foreach ( $posts as $post ) { if ( ! ! get_post_meta( $post->ID, 'panels_data', true ) ) { $post_list[ $post->ID ] = substr( $post->post_title, 0, 53 ) . esc_html__( ' (post)', 'absolute-weaver' ); } } $posts = ''; return $post_list; } function aweaver_cz_choices_siteorigin_pages_sanitize( $val ) { return $val; } function aweaver_cz_choices_sb_layout_default() { return array( 'default' => esc_html__( 'Sidebars Use Default', 'absolute-weaver' ), 'right' => esc_html__( 'Sidebars on Right', 'absolute-weaver' ), 'right-top' => esc_html__( 'Sidebars on Right (stack top)', 'absolute-weaver' ), 'left' => esc_html__( 'Sidebars on Left', 'absolute-weaver' ), 'left-top' => esc_html__( 'Sidebars on Left (stack top)', 'absolute-weaver' ), 'split' => esc_html__( 'Split - Sidebars on Right and Left', 'absolute-weaver' ), 'split-top' => esc_html__( 'Split (stack top)', 'absolute-weaver' ), 'one-column' => esc_html__( 'No sidebars, content only', 'absolute-weaver' ), ); } function aweaver_cz_choices_layout_default_sanitize( $val ) { $choices = aweaver_cz_choices_layout_default(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_shadow() { return array( "-0" => esc_html__( 'No Shadow', 'absolute-weaver' ), "-1" => esc_html__( 'All Sides, 1px', 'absolute-weaver' ), "-2" => esc_html__( 'All Sides, 2px', 'absolute-weaver' ), "-3" => esc_html__( 'All Sides, 3px', 'absolute-weaver' ), "-4" => esc_html__( 'All Sides, 4px', 'absolute-weaver' ), "-rb" => esc_html__( 'Right + Bottom', 'absolute-weaver' ), "-lb" => esc_html__( 'Left + Bottom', 'absolute-weaver' ), "-tr" => esc_html__( 'Top + Right', 'absolute-weaver' ), "-tl" => esc_html__( 'Top + Left', 'absolute-weaver' ), "-custom" => esc_html__( 'Custom Shadow', 'absolute-weaver' ), ); } function aweaver_cz_choices_shadow_sanitize( $val ) { $choices = aweaver_cz_choices_shadow(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_rounded() { return array( "none" => esc_html__( 'None', 'absolute-weaver' ), "-all" => esc_html__( 'All Corners', 'absolute-weaver' ), "-left" => esc_html__( 'Left Corners', 'absolute-weaver' ), "-right" => esc_html__( 'Right Corners', 'absolute-weaver' ), "-top" => esc_html__( 'Top Corners', 'absolute-weaver' ), "-bottom" => esc_html__( 'Bottom Corners', 'absolute-weaver' ), ); } function aweaver_cz_choices_rounded_sanitize( $val ) { $choices = aweaver_cz_choices_rounded(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } function aweaver_cz_choices_tables() { return array( 'default' => esc_html__( 'Theme Default', 'absolute-weaver' ), 'bold' => esc_html__( 'Bold Headings', 'absolute-weaver' ), 'noborders' => esc_html__( 'No Border', 'absolute-weaver' ), 'fullwidth' => esc_html__( 'Wide', 'absolute-weaver' ), 'wide' => esc_html__( 'Wide 2', 'absolute-weaver' ), 'plain' => esc_html__( 'Minimal', 'absolute-weaver' ), ); } function aweaver_cz_choices_tables_sanitize( $val ) { $choices = aweaver_cz_choices_tables(); return ( isset( $choices[ $val ] ) ) ? $val : ''; } // utility function aweaver_cz_get_admin_page( $link = 'default', $section = '', $target = '_self' ) { // eventually we might be able to link to a $section of the Absolute Weaver Admin page if ( $link == 'default' ) { $link = esc_html__( 'Absolute Weaver Admin Panel', 'absolute-weaver' ); } return '' . $link . ''; } function aweaver_cz_line() { return array( 'control' => array( 'control_type' => 'AWeaver_Misc_Control', 'type' => 'line', ), ); } // other sanitization ************************ /** * Sanitize a string to ensure that it is a float number. * */ function aweaver_cz_sanitize_float( $value ) { if ( ! $value ) { return '0'; } // need to be able detect '0' vs 0 or false else { return floatval( $value ); } } function aweaver_cz_sanitize_int( $value ) { if ( ! $value ) { return '0'; } else { return absint( $value ); } } function aweaver_default_sanitize( $in ) { // called for checkboxes, which must be okay return $in; } if ( ! function_exists( 'aweaver_cz_sanitize_text' ) ) : /** * Allow HTML markup and content */ function aweaver_cz_sanitize_text( $string ) { return aweaver_sanitize_markup( $string ); } endif; if ( ! function_exists( 'aweaver_cz_sanitize_html' ) ) : /** * Allow any HTML or code for admins, otherwise restrict content */ function aweaver_cz_sanitize_html( $string ) { return aweaver_filter_code( $string ); } endif; if ( ! function_exists( 'aweaver_cz_sanitize_head_code' ) ) : /** * Allow any HTML or code for admins, otherwise restrict content */ function aweaver_cz_sanitize_head_code( $string ) { return aweaver_filter_code( $string ); } endif; if ( ! function_exists( 'aweaver_cz_sanitize_code' ) ) : /** * Allow only certain tags and attributes in a string. */ function aweaver_cz_sanitize_code( $string ) { return aweaver_filter_code( $string ); } endif; if ( ! function_exists( 'aweaver_cz_sanitize_css' ) ) : /** * Allow only certain tags and attributes in a string. */ function aweaver_cz_sanitize_css( $string ) { return aweaver_filter_code( $string ); } endif; function aweaver_cz_sanitize_color( $color ) { // sanitize color - allow rgb, rgba, color names, otherwise force to hashed hex $color_names = array( 'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen', 'inherit', 'transparent', ); $color = str_replace( ' ', '', strtolower( $color ) ); if ( ! $color ) { return 'inherit'; } if ( strpos( $color, 'rgb' ) === 0 ) { // rgb value return $color; } elseif ( in_array( $color, $color_names ) ) { // CSS color names return $color; } else { // force leading # // 3 or 6 hex digits, or the empty string. if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { return ( $color[0] == '#' ) ? $color : '#' . $color; } else { return 'inherit'; } } } // Classes *********************************************** if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'AWeaver_Textarea_Control' ) ) : class AWeaver_Textarea_Control extends WP_Customize_Control { public $type = 'textarea'; public function render_content() { if ( isset( $this->input_attrs['rows'] ) ) { $rows = $this->input_attrs['rows']; } else { $rows = 4; } if ( isset( $this->input_attrs['placeholder'] ) ) { $placeholder = $this->input_attrs['placeholder']; } else { $placeholder = ''; } ?> type ) { case 'group-title' : echo '

' . esc_html( $this->label ) . '

'; if ( '' !== $this->description ) { echo '' . aweaver_sanitize_mixed( $this->description ) . ''; } break; case 'heading' : echo '' . esc_html( $this->label ) . ''; if ( '' !== $this->description ) { echo '' . esc_html( $this->description ) . ''; } break; case 'HTML': case 'html': echo '' . esc_html( $this->label ) . ''; if ( '' !== $this->description ) { echo '' . aweaver_sanitize_mixed( $this->description ) . ''; } break; case 'radio-icons': echo '' . esc_html( $this->label ) . ''; if ( '' !== $this->description ) { echo '' . esc_html( $this->description ) . ''; } if ( empty( $this->choices ) ) { return; } $name = '_customize-radio-' . $this->id; echo '
'; foreach ( $this->choices as $value => $label ) { ?> ' . esc_html( $this->label ) . ''; if ( '' !== $this->description ) { echo '' . esc_html( $this->description ) . ''; } if ( empty( $this->choices ) ) { return; } $name = '_customize-select-' . $this->id; echo '
link(); ?>> choices as $value => $label ) { $disabled = ''; if ( strpos( $label, '---' ) !== false ) { $disabled = ' disabled'; $label = str_replace( '---', '', $label ); } echo ''; } ?> input_attrs['after'] ) ) { echo esc_html( $this->input_attrs['after'] ); } } } endif; if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'AWeaver_Range_Control' ) ) : /** * Class AWeaver_Range_Control * * Specialized range control to enable a slider with an accompanying number field. * * Inspired by Kirki. * @link https://github.com/aristath/kirki/blob/0.5/includes/controls/class-Kirki_Customize_Sliderui_Control.php * */ class AWeaver_Range_Control extends WP_Customize_Control { public $type = 'range'; public $mode = 'slider'; public function enqueue() { wp_enqueue_script( 'jquery-ui-slider' ); } protected function render() { $id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); $class = 'customize-control customize-control-' . $this->type . ' customize-control-' . $this->type . '-' . $this->mode; ?>
  • render_content() ); ?>
  • initial_priority = absint( $initial_priority ); // Value to begin the counter. $this->increment = absint( $increment ); // Value to increment the counter by. $this->current_priority = $this->initial_priority; } public function get() { return $this->current_priority; // The current priority value. } public function inc( $increment = 0 ) { // Increment the priority. if ( 0 === $increment ) { $increment = $this->increment; } $this->current_priority += absint( $increment ); } public function add() { // Increment by the $this->increment value. $priority = $this->get(); $this->inc(); return $priority; } /** * Change the current priority and/or increment value. */ public function set( $new_priority = null, $new_increment = null ) { if ( ! is_null( $new_priority ) ) { $this->current_priority = absint( $new_priority ); } if ( ! is_null( $new_increment ) ) { $this->increment = absint( $new_increment ); } } /** * Reset the counter. */ public function reboot() { $this->current_priority = $this->initial_priority; } } endif; /** * custom Customize Setting class. * * Handles saving and sanitizing of settings - work around for O( n^2 ) issue in WP 4.3 and before * */ class AWeaver_Customize_Setting extends WP_Customize_Setting { static $cache = array(); static $filter_added = false; public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); // set up the id_data, etc. if ( ! AWeaver_Customize_Setting::$filter_added ) { add_filter( 'pre_option_' . $this->id_data['base'], 'AWeaver_Customize_Setting::_preview_filter_cache' ); add_filter( 'option_' . $this->id_data['base'], 'AWeaver_Customize_Setting::_preview_filter_cache' ); add_filter( 'default_option_' . $this->id_data['base'], 'AWeaver_Customize_Setting::_preview_filter_cache' ); AWeaver_Customize_Setting::$filter_added = true; } } public function preview() { if ( ! isset( $this->_original_value ) ) { $this->_original_value = $this->value(); } if ( ! isset( $this->_previewed_blog_id ) ) { $this->_previewed_blog_id = get_current_blog_id(); } switch ( $this->type ) { case 'theme_mod' : add_filter( 'theme_mod_' . $this->id_data['base'], array( $this, '_preview_filter' ) ); break; case 'option' : if ( ! is_array( AWeaver_Customize_Setting::$cache ) ) { AWeaver_Customize_Setting::$cache = array(); // make it an array once } AWeaver_Customize_Setting::$cache[] = $this; break; default : /** * Fires when the {@see WP_Customize_Setting::preview()} method is called for settings * not handled as theme_mods or options. * * The dynamic portion of the hook name, `$this->id`, refers to the setting ID. * * @since 3.4.0 * * @param WP_Customize_Setting $this {@see WP_Customize_Setting} instance. */ do_action( "customize_preview_{$this->id}", $this ); /** * Fires when the {@see WP_Customize_Setting::preview()} method is called for settings * not handled as theme_mods or options. * * The dynamic portion of the hook name, `$this->type`, refers to the setting type. * * @since 4.1.0 * * @param WP_Customize_Setting $this {@see WP_Customize_Setting} instance. */ do_action( "customize_preview_{$this->type}", $this ); } } static function _preview_filter_cache( $original ) { if ( ! isset( AWeaver_Customize_Setting::$cache ) || empty( $original ) ) // nothing to do { return $original; } foreach ( AWeaver_Customize_Setting::$cache as $set_this ) { $id = $set_this->id_data['keys'][0]; // may need to fix this if value is an array. $undefined = new stdClass(); // symbol hack $post_value = $set_this->post_value( $undefined ); if ( $undefined === $post_value ) { $value = $set_this->_original_value; } else { $value = $post_value; } if ( empty( $value ) ) // if new is empty, then unset the original, too. { unset( $original[ $id ] ); } else { $original[ $id ] = $value; } } return $original; } } // end AWeaver_Customize_Setting // ++++++++++++++++++++++++++++++++ setting helpers function aweaver_cz_select( $label, $description, $choices, $default = '', $transport = 'refresh', $input_attrs = array() ) { /* 'select' => aweaver_cz_select( label, description, 'choices', 'deflt', 'refresh' ), */ if ( $transport == 'refresh' && $label ) { $label .= AWEAVER_REFRESH_ICON; } if ( function_exists( $choices . AWEAVER_CHOICE_SANITIZE ) ) { $sanitize = $choices . AWEAVER_CHOICE_SANITIZE; } else { $sanitize = AWEAVER_DEFAULT_SANITIZE; } return array( 'setting' => array( 'default' => $default, 'sanitize_callback' => $sanitize, 'transport' => $transport, ), 'control' => array( 'control_type' => AWEAVER_SELECT_CONTROL, 'label' => esc_html( $label ), 'description' => aweaver_sanitize_markup( $description ), 'type' => 'select', 'choices' => $choices(), 'input_attrs' => $input_attrs, ), ); } function aweaver_cz_select_plus( $label, $description, $choices, $default = '', $transport = 'refresh', $input_attrs = array() ) { /* 'select_plus' => aweaver_cz_select_plus( label, description, 'choices', 'deflt' ), */ $label .= AWEAVER_PLUS_ICON; if ( $transport == 'refresh' ) { $label .= AWEAVER_REFRESH_ICON; } if ( function_exists( $choices . '_sanitize' ) ) { $sanitize = $choices . '_sanitize'; } else { $sanitize = AWEAVER_DEFAULT_SANITIZE; } return array( 'setting' => array( 'default' => $default, 'sanitize_callback' => $sanitize, 'transport' => $transport, ), 'control' => array( 'control_type' => AWEAVER_PLUS_SELECT_CONTROL, 'label' => esc_html( $label ), 'description' => aweaver_sanitize_markup( $description ), 'type' => 'select', 'choices' => $choices(), 'input_attrs' => $input_attrs, ), ); } function aweaver_cz_coloropt( $opt, $label, $description = '', $transport = AWEAVER_COLOR_TRANSPORT ) { /* 'coloropt' => aweaver_cz_coloropt( 'opt', label, description, transport ), */ if ( $transport == 'refresh' ) { $label .= AWEAVER_REFRESH_ICON; } $default = aweaver_cz_getopt( $opt ); if ( ! $default ) { $default = 'inherit'; } return array( 'setting' => array( 'sanitize_callback' => AWEAVER_CZ_SANITIZE_COLOR, 'transport' => $transport, 'default' => $default, ), 'control' => array( 'control_type' => AWEAVER_COLOR_CONTROL, 'label' => esc_html( $label ), 'description' => aweaver_sanitize_mixed( $description ), ), ); } function aweaver_cz_coloropt_plus( $opt, $label, $description = '', $transport = AWEAVER_COLOR_TRANSPORT ) { /* 'coloropt' => aweaver_cz_coloropt_plus( 'opt', label, description, transport ), */ $label .= AWEAVER_PLUS_ICON; if ( $transport == 'refresh' ) { $label .= AWEAVER_REFRESH_ICON; } $default = aweaver_cz_getopt( $opt ); if ( ! $default ) { $default = 'inherit'; } return array( 'setting' => array( 'sanitize_callback' => AWEAVER_CZ_SANITIZE_COLOR, 'transport' => $transport, 'default' => $default, ), 'control' => array( 'control_type' => AWEAVER_PLUS_COLOR_CONTROL, 'label' => esc_html( $label ), 'description' => aweaver_sanitize_mixed( $description ), ), ); } function aweaver_cz_group_title( $label, $description = '' ) { /* 'group_title' => aweaver_cz_group_title( label, description ), */ return array( 'control' => array( 'control_type' => 'AWeaver_Misc_Control', 'label' => esc_html( $label ), 'description' => aweaver_sanitize_mixed( $description ), 'type' => 'group-title', ), ); } function aweaver_cz_text( $description = '' ) { /* 'group_title' => aweaver_cz_group_title( label, description ), */ return array( 'control' => array( 'control_type' => 'AWeaver_Misc_Control', 'label' => '', 'description' => $description, 'type' => 'text', ), ); } function aweaver_cz_heading( $label, $description = '' ) { /* 'heading' => aweaver_cz_heading( label, description ), */ return array( 'control' => array( 'control_type' => 'AWeaver_Misc_Control', 'label' => esc_html( $label ), 'description' => aweaver_sanitize_mixed( $description ), 'type' => 'heading', ), ); } function aweaver_cz_html( $label, $description = '' ) { /* 'html' => aweaver_cz_heading( label, description ), */ return array( 'control' => array( 'control_type' => 'AWeaver_Misc_Control', 'label' => esc_html( $label ), 'description' => aweaver_sanitize_markup( $description ), 'type' => 'HTML', ), ); } function aweaver_cz_checkbox( $label, $description = '', $plus = '', $transport = 'postMessage' ) { /* 'checkbox' => aweaver_cz_checkbox( label, description ), */ if ( $transport == 'refresh' ) { $label .= AWEAVER_REFRESH_ICON; } $cb = null; if ( $plus != '' ) { $label .= AWEAVER_PLUS_ICON; $cb = AWEAVER_PLUS_CHECKBOX_CONTROL; } return array( 'setting' => array( 'sanitize_callback' => 'aweaver_cz_sanitize_int', 'transport' => $transport, ), 'control' => array( 'control_type' => $cb, 'label' => esc_html( $label ), 'description' => wp_strip_all_tags( aweaver_sanitize_mixed( $description ) ), // native checkbox does esc_html 'type' => 'checkbox', ), ); } function aweaver_cz_checkbox_refresh( $label, $description = '', $plus = '' ) { /* 'checkbox_refresh' => aweaver_cz_checkbox_refresh( label, description ), */ $cb = null; if ( $plus != '' ) { $label .= AWEAVER_PLUS_ICON; $cb = AWEAVER_PLUS_CHECKBOX_CONTROL; } $label .= AWEAVER_REFRESH_ICON; return array( 'setting' => array( 'sanitize_callback' => 'aweaver_cz_sanitize_int', 'transport' => 'refresh', ), 'control' => array( 'control_type' => $cb, 'label' => esc_html( $label ), 'description' => wp_strip_all_tags( aweaver_sanitize_mixed( $description ) ), 'type' => 'checkbox', ), ); } function aweaver_cz_text_int( $label, $description = '' ) { return array( 'setting' => array( 'sanitize_callback' => 'aweaver_cz_sanitize_int', 'transport' => 'refresh', 'default' => '' ), 'control' => array( 'control_type' => 'AWeaver_Textarea_Control', 'label' => esc_html( $label ) . AWEAVER_REFRESH_ICON, 'description' => aweaver_sanitize_mixed( $description ), 'type' => 'text', ), ); } function aweaver_cz_css( $label, $description = '' ) { return array( 'setting' => array( 'sanitize_callback' => 'aweaver_cz_sanitize_css', 'transport' => 'postMessage', 'default' => '' ), 'control' => array( 'control_type' => 'AWeaver_Textarea_Control', 'label' => esc_html( $label ), 'description' => aweaver_sanitize_mixed( $description ), 'type' => 'textarea', 'input_attrs' => array( 'rows' => '2', 'placeholder' => esc_html__( '{font-size:150%;font-weight:bold;} /* for example */', 'absolute-weaver' ), ), ), ); } function aweaver_cz_add_class( $label, $description = '' ) { if ( $description == '' ) { $description = esc_html__( 'Space separated class names to add to this area.', 'absolute-weaver' ); } return array( 'setting' => array( 'sanitize_callback' => 'aweaver_cz_sanitize_css', 'transport' => 'refresh', 'default' => '' ), 'control' => array( 'control_type' => AWEAVER_PLUS_TEXT_CONTROL, 'label' => esc_html( $label ) . AWEAVER_PLUS_ICON . AWEAVER_REFRESH_ICON, 'description' => esc_html( $description ), 'type' => 'text', 'input_attrs' => array( 'style' => 'width:85%;', ), ), ); } function aweaver_cz_textarea( $label, $description = '', $rows = '1', $placeholder = '', $transport = 'postMessage', $plus = false, $sanitize = 'aweaver_cz_sanitize_html' ) { /* aweaver_cz_textarea( $label, $description, $rows , $placeholder, $refresh, $plus ), */ if ( $plus ) { $control_type = AWEAVER_PLUS_TEXTAREA_CONTROL; } else { $control_type = 'AWeaver_Textarea_Control'; } if ( $plus ) { $label .= AWEAVER_PLUS_ICON; } if ( $transport == 'refresh' ) { $label .= AWEAVER_REFRESH_ICON; } return array( 'setting' => array( 'sanitize_callback' => $sanitize, 'transport' => $transport, 'default' => '', ), 'control' => array( 'control_type' => $control_type, 'label' => esc_html( $label ), 'description' => aweaver_sanitize_mixed( $description ), 'type' => 'textarea', 'input_attrs' => array( 'rows' => $rows, 'placeholder' => aweaver_sanitize_mixed( $placeholder ), // might want markup in description ), ), ); } function aweaver_cz_html_textarea( $label, $description = '', $rows = '1', $transport = 'postMessage' ) { /* aweaver_cz_html_textarea( $label, $description, $rows ), */ if ( $transport == 'refresh' ) { $label .= AWEAVER_REFRESH_ICON; } return array( 'setting' => array( 'sanitize_callback' => 'aweaver_cz_sanitize_html', 'transport' => $transport, 'default' => '', ), 'control' => array( 'control_type' => 'AWeaver_Textarea_Control', 'label' => esc_html( $label ), 'description' => aweaver_sanitize_mixed( $description ), 'type' => 'textarea', 'input_attrs' => array( 'rows' => $rows, 'placeholder' => esc_html__( 'Any HTML, including shortcodes.', 'absolute-weaver' ), ), ), ); } function aweaver_cz_add_image( $root, $label = '', $description = '', $transport = 'postMessage', $version = 'XPlus' ) { $opt = array(); if ( $version == 'XPlus' ) { $label .= AWEAVER_PLUS_ICON; } if ( $transport == 'refresh' ) { $label .= AWEAVER_REFRESH_ICON; } $opt[ $root . '-heading' ] = aweaver_cz_group_title( $label ); if ( $description ) { $opt[ $root . '-desc' ] = array( 'control' => array( 'control_type' => 'AWeaver_Misc_Control', 'description' => aweaver_sanitize_mixed( $description ), 'type' => 'text', ), ); } $opt["_bg_{$root}_url"] = array( 'setting' => array( 'transport' => $transport, 'sanitize_callback' => 'esc_url_raw', ), 'control' => array( 'control_type' => AWEAVER_PLUS_IMAGE_CONTROL, 'label' => '', //'type' => 'checkbox', ), ); $opt["_bg_{$root}_rpt"] = array( 'setting' => array( 'transport' => $transport, 'default' => 'repeat', ), 'control' => array( 'control_type' => AWEAVER_PLUS_SELECT_CONTROL, 'label' => esc_html__( 'Tile BG Image', 'absolute-weaver' ), 'type' => 'select', 'choices' => aweaver_cz_choices_repeat(), ), ); $opt["_bg_{$root}_rpt_css"] = array( 'setting' => array( 'sanitize_callback' => 'aweaver_cz_sanitize_css', 'transport' => 'refresh', 'default' => '' ), 'control' => array( 'control_type' => AWEAVER_PLUS_TEXT_CONTROL, 'label' => esc_html__( 'Additional CSS', 'absolute-weaver' ) . AWEAVER_PLUS_ICON . AWEAVER_REFRESH_ICON, 'type' => 'text', ), ); return $opt; } function aweaver_cz_add_fonts( $root, $label = '', $description = '', $transport = 'refresh', $bold = 'bold' ) { $opt = array(); if ( $root != 'm_primary' && $root != 'wrapper' ) // add a line except top { $opt[ $root . '-headingline' ] = aweaver_cz_line(); } $glabel = $label; if ( $transport == 'refresh' ) { $glabel .= AWEAVER_REFRESH_ICON; } $opt[ $root . '-font-hdrm' ] = aweaver_cz_group_title( $glabel, $description ); // Font Size $opt[ $root . '_font_size' ] = aweaver_cz_select( '', '' . __( 'Select Font Size for ', 'absolute-weaver' ) . esc_html( $label) . '', 'aweaver_cz_choices_font_size', '', $transport ); // Font Family /* for future - add more fonts... *$opt[$root . '_font_family'] = array( 'setting' => array( 'transport' => 'refresh', 'default' => 'sans-serif' ), 'control' => array( 'control_type' => 'AWeaver_Misc_Control', 'label' => esc_html__( 'Font Family', 'absolute-weaver' ) . AWEAVER_REFRESH_ICON, 'description' => '', 'type' => 'select-fontfamily', 'choices' => aweaver_cz_choices_font_family() ), ); */ $t_dir = aweaver_relative_url( '' ) . 'help/font-demo.html'; $opt[ $root . '_font_family' ] = aweaver_cz_select( '', '' . __( 'Select Font Family for ', 'absolute-weaver' ) . "{$label}  ", 'aweaver_cz_choices_font_family', '', $transport ); // Bold / Normal if ( $root == 'tagline' || $root == 'content_h' || strpos( $root, '_title' ) > 0 ) { if ( $transport == 'refresh' ) { $opt[ $root . '_normal' ] = aweaver_cz_checkbox_refresh( __( 'Normal Weight for ', 'absolute-weaver' ) . $label, '' //'' . esc_html__( 'Normal Weight for ', 'absolute-weaver' ) . $label . '' ); } else { $opt[ $root . '_normal' ] = aweaver_cz_checkbox( __( 'Normal Weight for ', 'absolute-weaver' ) . $label, ''// '' . esc_html__( 'Normal Weight for ', 'absolute-weaver' ) . $label . '' ); } } else { $opt[ $root . '_bold' ] = aweaver_cz_select( '', '' . __( 'Use Bold for ', 'absolute-weaver' ) . '' . $label , 'aweaver_cz_choices_bold_italic', '', $transport ); } // Italic $opt[ $root . '_italic' ] = aweaver_cz_select( '', '' . __( 'Use Italic for ', 'absolute-weaver' ) . '' . $label, 'aweaver_cz_choices_bold_italic', '', $transport ); return $opt; } function aweaver_cz_add_link_fonts( $root, $label = '', $description = '', $transport = 'postMessage' ) { // called for: link, ibarlink, contentlink, ilink, wlink, footerlink $opt = array(); $tlabel = ( $transport == 'postMessage' ) ? '' : AWEAVER_REFRESH_ICON; $opt[ $root . '-fontlink-hdm' ] = aweaver_cz_group_title( $label, $description ); // Bold $opt[ $root . '_strong' ] = aweaver_cz_select( '', '' . __( 'Use Bold for ', 'absolute-weaver' ) . $label . '' . $tlabel, 'aweaver_cz_choices_bold_italic', '', $transport ); // Italic $opt[ $root . '_em' ] = aweaver_cz_select( '', '' . __( 'Use Italic for ', 'absolute-weaver' ) . $label . '' . $tlabel, 'aweaver_cz_choices_bold_italic', '', $transport ); // Underline $opt[ $root . '_u' ] = array( 'setting' => array( 'transport' => $transport, ), 'control' => array( 'label' => __( 'Underline Link', 'absolute-weaver' ) . $tlabel, 'description' => '' . __( 'Use Underline link for ', 'absolute-weaver' ) . $label . '', 'type' => 'checkbox', ), ); // Underline $opt[ $root . '_u_h' ] = array( 'setting' => array( 'transport' => 'refresh' // this one is refresh ), 'control' => array( 'label' => esc_html__( 'Underline Hover', 'absolute-weaver' ) . AWEAVER_REFRESH_ICON, 'description' => '' . __( 'Use Underline on Hover.', 'absolute-weaver' ) . '', 'type' => 'checkbox', ), ); return $opt; } function aweaver_check_customizer_memory() { global $wp_customize; if ( isset( $wp_customize ) && ! $wp_customize->is_theme_active() ) { return; } // Not for preview! if ( isset( $wp_customize ) && ! aweaver_getopt( '_ignore_PHP_memory' ) && ! aweaver_getopt( '_PHP_warning_displayed' ) ) { $memlim = get_cfg_var( 'memory_limit' ); // the server memory limit. $memlim = str_ireplace( 'M', '', $memlim ); // kill the M if ( $memlim < AWEAVER_PHP_MEMORY_LIMIT ) { // show if not set // translators: %1: memory limit value aweaver_alert( sprintf( esc_html__( ' **** WARNING! ****\r\n\r\nYour WP host server has only %s of PHP Memory. Depending on your WordPress configuration, this could cause settings made in the Absolute Weaver Customizer Interface to fail to be saved and applied to your live site.\r\n\r\nPlease verify that settings you make in the Customizer are being applied to your live site.\r\n\r\nThere are solutions if this issue applies to you. Please see the [Appearance : Absolute Weaver Admin : Help] tab for more information about the possible PHP Memory problem.\r\n\r\n *** IMPORTANT! ***\r\nThis warning will be displayed only ONCE! The information will be displayed on the Help tab until you resolve the problem.', 'absolute-weaver' ), $memlim . 'M' ) ); aweaver_setopt( '_PHP_warning_displayed', true ); } } } function aweaver_get_logo_html() { $wp_logo = aweaver_sanitize_markup( aweaver_get_wp_custom_logo_url() ); if ( $wp_logo ) { return '
    ' . esc_html__( 'Current Site Logo: ', 'absolute-weaver' ) . ""; } else { return '
    ' . aweaver_esc_markdown( __( '***Site Logo has not been set.*** You can set the Site Logo on the *General Options & Admin → Site Identity* menu.', 'absolute-weaver' ) ); } }