Submit
Path:
~
/
/
home
/
getwphos
/
public_html
/
techniquetechs
/
wp-content
/
themes
/
plexify
/
inc
/
theme-options
/
File Content:
option-functions.php
<?php /** * Get Post List */ if(!function_exists('plexify_list_post')){ function plexify_list_post($post_type = 'post', $default = false, $exclude_post = 0){ $post_list = array(); $posts = get_posts(array('post_type' => $post_type, 'orderby' => 'date', 'order' => 'ASC', 'posts_per_page' => '-1')); if($default){ $post_list[-1] = esc_html__( 'Inherit', 'plexify' ); } foreach($posts as $post){ $post_list[$post->ID] = $post->post_title; } if( (int)$exclude_post > 0 ){ unset($post_list[(int)$exclude_post]); } return $post_list; } } if(!function_exists('plexify_get_templates_option')){ function plexify_get_templates_option($meta_value = 'df', $default = false){ $post_list = array(); if($default && !is_array($default)){ $post_list[-1] = esc_html__('Inherit','plexify'); } if(is_array($default)){ $key = isset($default['key']) ? $default['key'] : '0'; $post_list[$key] = !empty($default['value']) ? $default['value'] : esc_html__('None','plexify'); } if( is_array($meta_value)){ $args = array( 'post_type' => 'pxl-template', 'posts_per_page' => '-1', 'orderby' => 'date', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'template_type', 'value' => $meta_value, 'compare' => 'IN' ) ) ); }else{ $args = array( 'post_type' => 'pxl-template', 'posts_per_page' => '-1', 'orderby' => 'date', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'template_type', 'value' => $meta_value, 'compare' => '=' ) ) ); } $posts = get_posts($args); foreach($posts as $post){ $template_type = get_post_meta( $post->ID, 'template_type', true ); if($template_type == 'df') continue; $post_list[$post->ID] = $post->post_title; } return $post_list; } } if(!function_exists('plexify_get_templates_option_slug')){ function plexify_get_templates_option_slug($meta_value = 'df'){ $post_list = array(); $args = array( 'post_type' => 'pxl-template', 'posts_per_page' => '-1', 'orderby' => 'date', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'template_type', 'value' => $meta_value, 'compare' => '=' ) ) ); $posts = get_posts($args); foreach($posts as $post){ $template_type = get_post_meta( $post->ID, 'template_type', true ); if($template_type == 'df') continue; $keys = [$post->post_name, $post->ID]; $key = implode('||', $keys); $post_list[$key] = $post->post_title; } return $post_list; } } if(!function_exists('plexify_get_slider_option')){ function plexify_get_slider_option(){ $post_list = array(); $args = array( 'post_type' => 'pxl-slider', 'posts_per_page' => '-1', 'orderby' => 'date', 'order' => 'ASC', ); $posts = get_posts($args); foreach($posts as $post){ $post_list[$post->ID] = $post->post_title; } return $post_list; } } if(!function_exists('plexify_get_templates_slug')){ function plexify_get_templates_slug($meta_value = 'df'){ $post_list = array(); $posts = get_posts( array( 'post_type' => 'pxl-template', 'orderby' => 'date', 'order' => 'ASC', 'posts_per_page' => '-1', 'meta_query' => array( array( 'key' => 'template_type', 'value' => $meta_value, 'compare' => '=' ) ) ) ); foreach($posts as $post){ $template_type = get_post_meta( $post->ID, 'template_type', true ); $template_position = get_post_meta( $post->ID, 'template_position', true ); $pos = !empty($template_position) ? $template_position : ''; $template_custom_style = get_post_meta( $post->ID, 'template_custom_style', true ); $custom_style = !empty($template_custom_style) ? $template_custom_style : ''; if($template_type == 'df') continue; $value_args = [ 'post_id' => $post->ID, 'title' => $post->post_title, 'slug' => $post->post_name, 'position' => $pos, 'custom_style' => $custom_style ]; $post_list[$post->post_name] = $value_args; } return $post_list; } } if(!function_exists('plexify_header_opts')){ function plexify_header_opts($args=[]){ $args = wp_parse_args($args,[ 'default' => false, 'default_value' => '' ]); if($args['default']){ $options = [ '-1' => esc_html__('Default','plexify'), '1' => esc_html__('Yes','plexify'), '0' => esc_html__('No','plexify'), ]; $default_value = '-1'; } else { $options = [ '1' => esc_html__('Yes','plexify'), '0' => esc_html__('No','plexify'), ]; $default_value = '0'; } $opts = array( array( 'id' => 'header_layout', 'type' => 'select', 'title' => esc_html__('Header Layout', 'plexify'), 'desc' => sprintf(esc_html__('Please create your layout before choosing. %sClick Here%s','plexify'),'<a href="' . esc_url( admin_url( 'edit.php?post_type=pxl-template' ) ) . '">','</a>'), 'options' => plexify_get_templates_option('header',$args['default']), 'default' => $args['default_value'] ), array( 'id' => 'header_mobile_layout', 'type' => 'select', 'title' => esc_html__('Header Mobile Layout', 'plexify'), 'desc' => sprintf(esc_html__('Please create your layout before choosing. %sClick Here%s','plexify'),'<a href="' . esc_url( admin_url( 'edit.php?post_type=pxl-template' ) ) . '">','</a>'), 'options' => plexify_get_templates_option('header-mobile',$args['default']), 'default' => $args['default_value'], ), ); if(!$args['default']){ $opts[] = array( 'id' => 'logo_d', 'type' => 'media', 'title' => esc_html__('Logo', 'plexify'), 'default' => array( 'url'=>'' ), 'required' => array( 'header_layout' , '=', '' ) ); $opts[] = array( 'id' => 'logo_size', 'type' => 'dimensions', 'title' => esc_html__('Logo Size', 'plexify'), 'subtitle' => esc_html__('Enter demensions for your logo', 'plexify'), 'height' => false, 'unit' => 'px', 'required' => array( 'header_layout' , '=', '' ) ); $opts[] = array( 'id' => 'logo_m', 'type' => 'media', 'title' => esc_html__('Logo Mobile', 'plexify'), 'default' => array( 'url'=>'' ), 'required' => array( 'header_mobile_layout' , '=', '' ) ); $opts[] = array( 'id' => 'logo_mobile_size', 'type' => 'dimensions', 'title' => esc_html__('Logo Mobile Size', 'plexify'), 'subtitle' => esc_html__('Enter demensions for your logo mobile', 'plexify'), 'height' => false, 'unit' => 'px', 'required' => array( 'header_mobile_layout' , '=', '' ) ); } return $opts; } } if(!function_exists('plexify_page_title_opts')){ function plexify_page_title_opts($args=[]){ $args = wp_parse_args($args,[ 'default' => false, 'default_value' => '', 'output_prefix' => '' ]); if($args['default']){ $options = [ '-1' => esc_html__('Default','plexify'), '1' => esc_html__('Yes','plexify'), '0' => esc_html__('No','plexify'), ]; $default_value = '-1'; } else { $options = [ '1' => esc_html__('Yes','plexify'), '0' => esc_html__('No','plexify'), ]; $default_value = '0'; } if($args['default']){ $pt_mode_options = [ '-1' => esc_html__('Inherit', 'plexify'), 'bd' => esc_html__('Builder', 'plexify'), 'none' => esc_html__('Disable', 'plexify') ]; $pt_mode_default = '-1'; }else{ $pt_mode_options = [ 'df' => esc_html__('Default', 'plexify'), 'bd' => esc_html__('Builder', 'plexify'), 'none' => esc_html__('Disable', 'plexify') ]; $pt_mode_default = 'df'; } $opts = array( array( 'id' => 'pt_mode', 'type' => 'button_set', 'title' => esc_html__('Select Page title Mode', 'plexify'), 'options' => $pt_mode_options, 'default' => $pt_mode_default ), array( 'id' => 'ptitle_layout', 'type' => 'select', 'title' => esc_html__('Page Title Layout (not empty)', 'plexify'), 'subtitle' => esc_html__('Select a layout for page title.', 'plexify'), 'options' => plexify_get_templates_option('page-title',false), 'default' => $args['default_value'], 'required' => array( 'pt_mode', '=', 'bd' ) ), array( 'id' => 'ptitle_bg', 'type' => 'background', 'title' => esc_html__('Background', 'plexify'), 'subtitle' => esc_html__('Page title background.', 'plexify'), 'output' => array($args['output_prefix'].' .pxl-pagetitle .pxl-page-title-bg'), 'required' => array( 'pt_mode', '!=', 'none' ) ), array( 'id' => 'ptitle_overlay_color', 'type' => 'color_rgba', 'title' => esc_html__('Overlay Background Color', 'plexify'), 'output' => array('background-color' => $args['output_prefix'].' .pxl-pagetitle .pxl-page-title-overlay'), 'required' => array( 'pt_mode', '!=', 'none' ) ), ); if($args['default']){ $custom_opts = [ [ 'id' => 'pt_height', 'type' => 'dimensions', 'title' => esc_html__('Hight', 'plexify'), 'subtitle' => esc_html__('Enter demensions for page title height', 'plexify'), 'width' => false, 'unit' => 'px', 'required' => array( 'pt_mode', '=', 'bd' ) ], [ 'id' => 'custom_title', 'type' => 'text', 'title' => esc_html__( 'Custom Title', 'plexify' ), 'subtitle' => esc_html__( 'Custom heading text title', 'plexify' ), 'required' => array( 'pt_mode', '!=', 'none' ) ], [ 'id' => 'custom_sub_title', 'type' => 'textarea', 'title' => esc_html__( 'Custom Sub title', 'plexify' ), 'subtitle' => esc_html__( 'Add short description for page title', 'plexify' ), 'required' => array( 'pt_mode', '!=', 'none' ) ] ]; $opts = array_merge($opts,$custom_opts); } return $opts; } } if(!function_exists('plexify_footer_opts')){ function plexify_footer_opts($args=[]){ $args = wp_parse_args($args,[ 'default' => false, 'default_value' => '' ]); if($args['default']){ $options = [ '-1' => esc_html__('Inherit','plexify'), '1' => esc_html__('Yes','plexify'), '0' => esc_html__('No','plexify'), ]; $options_type = [ '-1' => esc_html__('Inherit','plexify'), '1' => esc_html__('Fixed','plexify'), '2' => esc_html__('Absoluted','plexify'), '0' => esc_html__('Nothing','plexify'), ]; $default_value = '-1'; } else { $options = [ '1' => esc_html__('Yes','plexify'), '0' => esc_html__('No','plexify'), ]; $options_type = [ '1' => esc_html__('Fixed','plexify'), '2' => esc_html__('Absoluted','plexify'), '0' => esc_html__('Nothing','plexify'), ]; $default_value = '0'; } $footer_layout_opts = plexify_get_templates_option('footer', $args['default']); if($args['default']) $footer_layout_opts[-2] = esc_html__( 'Disable', 'plexify' ); $opts = array( array( 'id' => 'footer_layout', 'type' => 'select', 'title' => esc_html__('Footer Layout', 'plexify'), 'desc' => sprintf(esc_html__('Please create your layout before choosing. %sClick Here%s','plexify'),'<a href="' . esc_url( admin_url( 'edit.php?post_type=pxl-template' ) ) . '">','</a>'), 'options' => $footer_layout_opts, 'default' => $args['default_value'], ), array( 'title' => esc_html__('Footer Position', 'plexify'), 'subtitle' => esc_html__('Make footer fixed or absoluted at bottom?', 'plexify'), 'id' => 'footer_position', 'type' => 'button_set', 'options' => $options_type, 'default' => $default_value, ), array( 'id' => 'back_totop_on', 'type' => 'button_set', 'title' => esc_html__('Enable Back to Top', 'plexify'), 'options' => $options, 'default' => $default_value, ) ); return $opts; } } if(!function_exists('plexify_sidebar_pos_opts')){ function plexify_sidebar_pos_opts($args=[]){ $args = wp_parse_args($args,[ 'prefix' => 'blog_', 'default' => false, 'default_value' => '0' ]); if($args['default']){ $options = [ '-1' => esc_html__('Inherit','plexify'), 'left' => esc_html__('Left','plexify'), 'right' => esc_html__('Right','plexify'), '0' => esc_html__('Disabled','plexify'), ]; } else { $options = [ 'left' => esc_html__('Left','plexify'), 'right' => esc_html__('Right','plexify'), '0' => esc_html__('Disabled','plexify'), ]; } $opts = array( array( 'id' => $args['prefix'].'sidebar_pos', 'type' => 'button_set', 'title' => esc_html__('Sidebar Position', 'plexify'), 'subtitle' => esc_html__('Select a sidebar position is displayed.', 'plexify'), 'options' => $options, 'default' => $args['default_value'], ), ); return $opts; } } /* Get list menu */ function plexify_get_nav_menu_locations(){ $menus_locations = array( '-1' => esc_html__('Inherit', 'plexify') ); $locations = get_registered_nav_menus(); foreach ($locations as $location => $location_name){ if( has_nav_menu( $location ) ){ $menus_locations[$location] = $location_name; } } return $menus_locations; } function plexify_get_nav_menu_slug(){ $menus = array( '-1' => esc_html__('Inherit', 'plexify') ); $obj_menus = wp_get_nav_menus(); foreach ($obj_menus as $obj_menu){ $menus[$obj_menu->slug] = $obj_menu->name; } return $menus; } /* Get list user */ function plexify_get_user_list(){ $users = get_users(); $list = array( '-1' => esc_html__('None', 'plexify') ); foreach ($users as $user) { $list[$user->ID] = $user->display_name; } return $list; } function plexify_product_single_opts_wishlist_compare(){ $arr = []; if(class_exists('WPCleverWoosw')) $arr[] = array( 'id' => 'product_wishlist', 'title' => esc_html__('Show Wishlist', 'plexify'), 'type' => 'switch', 'default' => '1', ); if(class_exists('WPCleverWoosc')) $arr[] = array( 'id' => 'product_compare', 'title' => esc_html__('Show compare', 'plexify'), 'type' => 'switch', 'default' => '1', ); return $arr; }
Submit
FILE
FOLDER
Name
Size
Permission
Action
option-functions.php
17583 bytes
0644
page-options.php
18292 bytes
0644
theme-options.php
62997 bytes
0644
N4ST4R_ID | Naxtarrr