' . esc_textarea($value) . ''; echo '

Cole aqui o código do anúncio (HTML/JS) que aparecerá acima do botão de download.

'; } add_action( 'after_setup_theme', 'px_theme_setup' ); function px_theme_setup() { add_theme_support( 'nav-menus' ); add_theme_support( 'post-thumbnails' ); add_image_size( 'miniatura', 75, 75, true ); add_image_size( 'medio', 128, 128, true ); add_theme_support( 'title-tag' ); add_theme_support( 'woocommerce' ); add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', ) ); $languages_folder = get_template_directory() . '/languages'; $locale = get_locale(); if (strpos($locale, 'es_') === 0) { if (file_exists("$languages_folder/$locale.mo")) { load_textdomain(THEMEPX, "$languages_folder/$locale.mo"); } else { load_textdomain(THEMEPX, "$languages_folder/es_ES.mo"); } } else { if (file_exists("$languages_folder/$locale.mo")) { load_textdomain(THEMEPX, "$languages_folder/$locale.mo"); } else { load_textdomain(THEMEPX, "$languages_folder/en_US.mo"); } } global $wpdb; $v = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %s LIMIT 1" , '_wp_page_template', 'template-most-viewed-apps.php' ) ); if( empty($v) ) { $postarr = array( 'post_title' => __( 'Apps más vistas', 'appyn' ), 'post_type' => 'page', 'post_status' => 'publish', 'page_template' => 'template-most-viewed-apps.php', ); $insert = wp_insert_post($postarr); update_post_meta( $insert, '_wp_page_template', 'template-most-viewed-apps.php' ); update_post_meta( $insert, 'appyn_hidden_sidebar', 1 ); } $v = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %s LIMIT 1" , '_wp_page_template', 'template-most-rated-apps.php' ) ); if( empty($v) ) { $postarr = array( 'post_title' => __( 'Apps más calificadas', 'appyn' ), 'post_type' => 'page', 'post_status' => 'publish', 'page_template' => 'template-most-rated-apps.php', ); $insert = wp_insert_post($postarr); update_post_meta( $insert, '_wp_page_template', 'template-most-rated-apps.php' ); update_post_meta( $insert, 'appyn_hidden_sidebar', 1 ); } $v = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %s LIMIT 1" , '_wp_page_template', 'template-mod-apps.php' ) ); if( empty($v) ) { $postarr = array( 'post_title' => __( 'Apps modificadas', 'appyn' ), 'post_type' => 'page', 'post_status' => 'publish', 'page_template' => 'template-mod-apps.php', ); $insert = wp_insert_post($postarr); update_post_meta( $insert, '_wp_page_template', 'template-mod-apps.php' ); update_post_meta( $insert, 'appyn_hidden_sidebar', 1 ); } } add_action( 'init', 'px_theme_menus' ); function px_theme_menus() { $locations = array( 'menu' => __( 'Menú', 'appyn' ), 'menu-mobile' => __( 'Menú movil', 'appyn' ), 'menu-footer' => __( 'Menú footer', 'appyn' ), 'menu-fixed-bottom' => __( 'Menú inferior fijo (Móvil)', 'appyn' ), ); register_nav_menus( $locations ); } add_action( 'widgets_init', 'px_widget_init' ); function px_widget_init() { register_sidebar(array( 'name' => 'Sidebar', 'id' => 'sidebar-1', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar(array( 'name' => 'Footer', 'id' => 'sidebar-footer', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); if( appyn_options( 'blog_sidebar' ) ) { register_sidebar(array( 'name' => 'Sidebar Blog', 'id' => 'sidebar-blog', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } if( appyn_options( 'og_sidebar' ) ) { register_sidebar(array( 'name' => 'Sidebar General', 'id' => 'sidebar-general', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } } function all_options() { $url = get_bloginfo('template_url'); $options = array( 'logo' => $url.'/images/logo.png', 'favicon' => $url.'/images/favicon.ico', 'home_show_subheader' => 1, 'single_show_subheader' => 1, 'titulo_principal' => __( 'Theme Appyn para aplicaciones Android', 'appyn' ), 'descripcion_principal' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer fermentum erat ut massa venenatis, vitae ultrices sem dictum. Aliquam leo ipsum, bibendum nec dolor et.', 'image_header1' => $url.'/images/plantasvszombies2.png', 'image_header2' => $url.'/images/lords-mobile.png', 'image_header3' => $url.'/images/pokemon-go.png', 'image_header4' => $url.'/images/roblox.png', 'image_header5' => $url.'/images/free-fire.png', 'social_single_color' => 'default', 'social_facebook' => '#', 'social_twitter' => '#', 'social_instagram' => '#', 'social_youtube' => '#', 'social_pinterest' => '#', 'social_telegram' => '#', 'footer_texto' => '© '.date('Y').' - '.__( 'Derechos reservados', 'appyn' ).' - Appyn Theme', 'home_limite' => 40, 'categories_home_limite' => 6, 'blog_posts_limite' => 10, 'mas_calificadas' => 1, 'mas_calificadas_limite' => 5, 'blog_posts_home_limite' => 4, 'comments' => 'wp', 'color_theme' => 'oscuro', 'color_theme_user_select' => 1, 'readmore_single' => 0, 'color_theme_principal' => '#1bbc9b', 'color_download_button' => '#1bbc9b', 'color_new_ribbon' => '#d22222', 'color_update_ribbon' => '#19b934', 'color_stars' => '#f9bd00', 'color_tag_mod' => '#20a400', 'download_links' => 0, 'social_single_color' => 'default', 'appyn_amp' => 0, 'redirect_timer' => 5, 'download_timer' => 5, 'edcgp_sapk_server' => 1, 'edcgp_rating' => 1, 'apps_info_download_apk' => sprintf( "

    %s

    %s

    %s

    %s

    ", __( '¿Cómo instalar [Title] APK?', 'appyn' ), __( '1. Toca el archivo [Title] APK descargado.', 'appyn' ), __( '2. Toca instalar.', 'appyn' ), __( '3. Sigue los pasos que aparece en pantalla.', 'appyn' ) ), 'apps_info_download_zip' => sprintf( "

    %s

    %s

    %s

    %s

    %s

    %s

    ", __( '¿Cómo instalar [Title]?', 'appyn' ), __( '1. Descargar el archivo ZIP.', 'appyn' ), sprintf( __( '2. Instale la aplicación %s', 'appyn' ), 'Split APKs Installer'), __( '3. Abra la aplicación y pulse en "Instalar APKs".', 'appyn' ), __( '4. Busque la carpeta donde se encuentra el ZIP descargado y selecciónelo.', 'appyn' ), __( '5. Sigue los pasos que aparece en pantalla.', 'appyn' ) ), 'apps_info_download_mod' => sprintf( "

    %s

    %s

    %s

    %s

    ", __( '¿Cómo instalar [Title] MOD?', 'appyn' ), __( '1. Toca el archivo [Title] MOD descargado.', 'appyn' ), __( '2. Toca instalar.', 'appyn' ), __( '3. Sigue los pasos que aparece en pantalla.', 'appyn' ) ), 'general_text_edit' => array( 'amc' => __( 'Aplicaciones más calificadas', 'appyn' ), 'uadnw' => __( 'Últimas aplicaciones de nuestra web', 'appyn' ), 'bua' => __( 'Buscar una aplicación', 'appyn' ), 'bda' => __( 'Descargar APK', 'appyn' ), ), 'home_posts_orden' => 0, 'home_mod_apps' => 0, 'edcgp_extracted_images' => 5, 'apps_per_row_pc' => 10, 'apps_per_row_movil' => 3, 'mod_apps_data_gpl' => array( 'short_description', 'requirements', 'rating', 'downloads', 'category', 'developer', 'whats_new', 'video', 'screenshots', ), 'home_show_subheader' => 2, 'single_show_subheader' => 2, 'width_page' => 1, 'design_rounded' => 1, ); return $options; } add_action( 'after_switch_theme', 'px_default_options' ); function px_default_options(){ $options = all_options(); foreach( $options as $key => $value ){ $getoption = get_option( 'appyn_'.$key ); if( empty($getoption) ) { update_option( 'appyn_'.$key, $value ); } } wp_redirect( admin_url('admin.php?page=appyn_panel') ); } add_action( 'init', 'default_info_download_apk_zip' ); function default_info_download_apk_zip() { update_option( 'appyn_apps_default_info_download_apk', sprintf( "

    %s

    %s

    %s

    %s

    ", __( '¿Cómo instalar [Title] APK?', 'appyn' ), __( '1. Toca el archivo [Title] APK descargado.', 'appyn' ), __( '2. Toca instalar.', 'appyn' ), __( '3. Sigue los pasos que aparece en pantalla.', 'appyn' ) ) ); update_option( 'appyn_apps_default_info_download_zip', sprintf( "

    %s

    %s

    %s

    %s

    %s

    %s

    ", __( '¿Cómo instalar [Title]?', 'appyn' ), __( '1. Descargar el archivo ZIP.', 'appyn' ), sprintf( __( '2. Instale la aplicación %s', 'appyn' ), 'Split APKs Installer'), __( '3. Abra la aplicación y pulse en "Instalar APKs".', 'appyn' ), __( '4. Busque la carpeta donde se encuentra el ZIP descargado y selecciónelo.', 'appyn' ), __( '5. Sigue los pasos que aparece en pantalla.', 'appyn' ) ) ); update_option( 'appyn_apps_default_info_download_mod', sprintf( "

    %s

    %s

    %s

    %s

    ", __( '¿Cómo instalar [Title] APK?', 'appyn' ), __( '1. Toca el archivo [Title] APK descargado.', 'appyn' ), __( '2. Toca instalar.', 'appyn' ), __( '3. Sigue los pasos que aparece en pantalla.', 'appyn' ) ) ); } add_action( 'init', 'blog_register' ); function blog_register(){ $labels = array( 'name' => 'Blog', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => 'blog'), 'has_archive' => true, 'show_in_rest' => true, 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('title','editor','thumbnail','comments'), ); register_post_type('blog', $args ); } add_action( 'init', 'dev_taxonomy_register' ); function dev_taxonomy_register() { register_taxonomy( 'dev', 'post', array( 'label' => __( 'Desarrollador', 'appyn' ), 'sort' => true, 'args' => array( 'orderby' => 'term_order' ), 'show_in_rest' => true, 'rewrite' => array( 'slug' => 'dev' ), 'labels' => array( 'menu_name' => __( 'Desarrollador', 'appyn' ) ) ) ); register_taxonomy( 'cblog', 'blog', array( 'label' => __( 'Categorías', 'appyn' ), 'sort' => true, 'args' => array( 'orderby' => 'term_order' ), 'show_in_rest' => true, 'rewrite' => array( 'slug' => 'cblog' ), 'labels' => array( 'menu_name' => __( 'Categorías', 'appyn' ) ) ) ); register_taxonomy( 'tblog', 'blog', array( 'label' => __( 'Etiquetas', 'appyn' ), 'sort' => true, 'args' => array( 'orderby' => 'term_order' ), 'show_in_rest' => true, 'rewrite' => array( 'slug' => 'tblog' ), 'labels' => array( 'menu_name' => __( 'Etiquetas', 'appyn' ) ) ) ); } add_action( 'init', 'add_px_rewrite_rule' ); function add_px_rewrite_rule() { add_rewrite_rule( '^([^/]*)/versions/?$', 'index.php?name=$matches[1]§ion=versions', 'top' ); if( appyn_options( 'download_links_permalinks' ) == 1 ) { add_rewrite_rule( '^([^/]*)/download/?$', 'index.php?name=$matches[1]&download=links', 'top' ); add_rewrite_rule( '^([^/]*)/download/([0-9]+)/?$', 'index.php?name=$matches[1]&download=links&opt=$matches[2]', 'top' ); } } add_filter( 'query_vars', 'add_px_rewrite_var'); function add_px_rewrite_var( $vars ) { $vars[] = 'section'; $vars[] = "download"; $vars[] = "download_link"; $vars[] = "opt"; return $vars; } add_action( 'wp', 'px_404_versiones' ); function px_404_versiones() { global $post; if( get_query_var( 'section' ) == __( 'versiones', 'appyn' ) && $post->post_parent ) { global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( 'wp', 'px_wp_post_views'); function px_wp_post_views(){ global $post; if( !is_single() ) { return; } setPostViews( $post->ID ); } add_action( 'wp', 'new_rating_db' ); function new_rating_db() { global $wpdb; $table_name = $wpdb->prefix."ap_rating"; if ( $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $table_name ) ) != $table_name ) return; $results = $wpdb->get_results( "SELECT *, COUNT(rating_count) users, SUM(rating_count) total_rating FROM $table_name GROUP BY post_id", 'OBJECT' ); if( $results ) { $wpdb->query( "DROP TABLE IF EXISTS $table_name"); foreach( $results as $r ) { update_post_meta( $r->post_id, 'new_rating_users', $r->users ); update_post_meta( $r->post_id, 'new_rating_count', $r->total_rating ); update_post_meta( $r->post_id, 'new_rating_average', number_format(($r->total_rating / $r->users), 1, ".", "") ); } } } add_action( 'wp', 'new_views' ); function new_views() { global $wpdb; $table_name = $wpdb->prefix."views"; if ( $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $table_name ) ) != $table_name ) return; $wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix."views_temp"); $results = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix."views" ); if( !$results ) return; foreach( $results as $r ) { update_post_meta( $r->post_id, 'px_views', $r->total ); } $wpdb->query( "DROP TABLE $table_name" ); } remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('wp_print_styles', 'print_emoji_styles'); remove_action('wp_head', 'rest_output_link_wp_head'); remove_action('wp_head', 'wp_oembed_add_discovery_links'); remove_action('template_redirect', 'rest_output_link_header', 11, 0); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_shortlink_wp_head'); remove_action('wp_head', 'wp_oembed_add_discovery_links'); remove_action('wp_head', 'wp_oembed_add_host_js'); add_filter( 'posts_where', 'wpse18703_posts_where', 10, 2 ); function wpse18703_posts_where($where, $wp_query){ global $wpdb; if ( $wpse18703_title = $wp_query->get( 'wpse18703_title' ) ) { $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'%' . esc_sql( $wpdb->esc_like( $wpse18703_title ) ) . '%\''; } return $where; } add_action( 'add_meta_boxes', 'datos_meta_boxes', 10, 2 ); function datos_meta_boxes( $post_type, $post ){ $app_type = get_post_meta( $post->ID, 'app_type', true ); if( $app_type == 1 ) { add_meta_box('app_update', __( 'Actualizar app', 'appyn' ), 'callback_app_update', 'post', 'normal', 'high'); } add_meta_box('versions', __( 'Versiones', 'appyn' ), 'callback_versions', 'post', 'normal'); add_meta_box('datos_informacion', __( 'Información de la aplicación', 'appyn' ), 'callback_informacion', 'post', 'normal'); add_meta_box('datos_video', __( 'Video de la aplicación', 'appyn' ), 'callback_video', 'post', 'normal'); add_meta_box('datos_imagenes', __( 'Imágenes de la aplicación', 'appyn' ), 'callback_imagenes', 'post', 'normal'); add_meta_box('datos_download', __( 'Enlaces de descarga de la aplicación', 'appyn' ), 'datos_download', 'post', 'normal'); add_meta_box('custom_boxes', __( 'Cajas personalizadas', 'appyn' ), 'custom_boxes', 'post', 'normal'); add_meta_box('permanent_custom_boxes', __( 'Cajas personalizadas permanentes', 'appyn' ), 'permanent_custom_boxes', 'post', 'normal'); add_meta_box('box_ads_control', __( 'Control de anuncios', 'appyn' ), 'callback_box_ads_control', array('post', 'page', 'blog'), 'normal'); add_meta_box('control_elements', __( 'Control de elementos', 'appyn' ), 'callback_control_elements', array('page'), 'normal'); } function callback_app_update($post) { echo '
    '; } function callback_versions($post) { echo ' '; $date_change = array( 'enero' => '01', 'febrero' => '02', 'marzo' => '03', 'abril' => '04', 'mayo' => '05', 'junio' => '06', 'julio' => '07', 'agosto' => '08', 'setiembre' => '09', 'octubre' => '10', 'noviembre' => '11', 'diciembre' => '12', ' de ' => '-', ); $args = array( 'post_parent' => $post->ID, 'posts_per_page' => -1, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, ); if( $post->post_parent != 0 ) { $args['post_parent'] = $post->post_parent; $args['post__not_in'] = array($post->ID); $post_add = get_post($post->post_parent); } $versions = get_posts( $args ); if( $versions || isset($post_add) ) : if( $post->post_parent != 0 ) { $pid = wp_get_post_parent_id($post->ID); $inf = get_post_meta( $pid, 'datos_informacion', true ); echo ''; } foreach( $versions as $post ) : setup_postdata($post); $inf = get_post_meta( $post->ID, 'datos_informacion', true ); echo ''; endforeach; else : echo ''; endif; echo '
    '.__( 'Versión', 'appyn' ).' '.__( 'Título', 'appyn' ).' '.__( 'Fecha de actualización', 'appyn' ).'
    '.(( !empty($inf['version']) ) ? $inf['version'] : '-').' '.get_the_title( $pid ).' '.(( !empty($inf['fecha_actualizacion']) ) ? date_i18n( 'd/m/Y', strtotime(strtr($inf['fecha_actualizacion'], $date_change)) ) : '-').'
    '.(( !empty($inf['version']) ) ? $inf['version'] : '-').' '.$post->post_title.' '.(( !empty($inf['fecha_actualizacion']) ) ? date_i18n( 'd/m/Y', strtotime(strtr($inf['fecha_actualizacion'], $date_change)) ) : '-').'
    '.__( 'No hay versiones', 'appyn' ).'
    '; wp_reset_postdata(); } function callback_box_ads_control( $post ){ $ac = appyn_gpm( $post->ID, 'appyn_ads_control' ); echo '

    '; } function callback_control_elements( $post ){ $ac = appyn_gpm( $post->ID, 'appyn_hidden_sidebar' ); $ac2 = appyn_gpm( $post->ID, 'appyn_hidden_post_meta' ); $ac3 = appyn_gpm( $post->ID, 'appyn_hidden_social_buttons' ); echo '

    '; echo '

    '; echo '

    '; } function permanent_custom_boxes( $post ){ $pcb = get_option( 'permanent_custom_boxes' ); echo '
    '; if( !empty($pcb) && is_array($pcb) ) { $i = 0; foreach($pcb as $box_key => $box_value) : $i++; if( !empty( $box_value['title'] ) || !empty( $box_value['content'] ) ) { ?>

    'permanent_custom_boxes['.$box_key.'][content]', 'textarea_rows' => 5)); ?>

    '; echo '+ '.__( 'Añadir caja', 'appyn' ).''; ?> ID, 'custom_boxes', true); echo '
    '; if(!empty($custom_boxes)) { foreach($custom_boxes as $box_key => $box_value) : if( !empty( $box_value['title'] ) || !empty( $box_value['content'] ) ) { ?>

    'custom_boxes['.$box_key.'][content]', 'textarea_rows' => 5)); ?>

    '; echo '+ '.__( 'Añadir caja', 'appyn' ).''; } function px_label_help( $t, $a = false ) { return '
    '.$t.'
    '; } function callback_informacion( $post ){ ?>
    :

    :

    :

    :

    :

    :

    :

    :

    :

    ID, 'new_rating_average', true ) ) ? get_post_meta( $post->ID, 'new_rating_average', true ) : 0; $new_rating_users = ( get_post_meta( $post->ID, 'new_rating_users', true ) ) ? get_post_meta( $post->ID, 'new_rating_users', true ) : 0; ?>

    ():

    ():

    :

    :

    :        

     

    :
    'datos_informacion[novedades]', 'textarea_rows' => 5)); ?>

    ID, 'datos_video', true); $vid_embed = isset($datos_video['embed']) ? $datos_video['embed'] : ''; $vid_thumb = isset($datos_video['thumbnail']) ? $datos_video['thumbnail'] : ''; ?>

    Embed do vídeo (HTML ou ID YouTube):
    Aceita código iframe completo ou somente o ID do YouTube

    Capa do vídeo (thumbnail):


    Capa

    ID, 'datos_imagenes', true); $datos_imagenes = !empty($datos_imagenes) ? $datos_imagenes : array(); $c = 4; $input_upload = ''; ?>
    10){ foreach($datos_imagenes as $elemento) { echo '

    '.$input_upload.'

    '; $n++; } } else { for($i=0;$i<10;$i++) { echo '

    '.$input_upload.'

    '; } } ?>

    +

    • ">
    • ">
    • ">
    Ver/Editar los pasos', 'appyn' ), admin_url('admin.php?page=appyn_panel#general') ) ); ?>

    >APK   >APK + OBB   >ZIP

    >

    .
    .

    >


    >


    $dw ) { if( isset($dw['link']) && isset($datos_download_d['links_options'][$key]['link']) ) { if( $dw['link'] != $datos_download_d['links_options'][$key]['link'] ) { $datos_download[$key]['link_original'] = $dw['link']; $pdls4 = get_option( 'posts_download_links_status_404', array('') ); $arr = array_values(array_diff($pdls4 ,[$id])); update_option( 'posts_download_links_status_404', $arr ); } } } update_post_meta( $id, "datos_download", $datos_download ); } if(isset($_POST['custom_boxes'])) { update_post_meta( $id, "custom_boxes", $_POST['custom_boxes'] ); } else { delete_post_meta( $id, "custom_boxes" ); } if( isset($_POST['permanent_custom_boxes']) ) { $pcb = $_POST['permanent_custom_boxes']; array_multisort($pcb); update_option( "permanent_custom_boxes", stripslashes_deep($pcb) ); $oc = get_option( 'appyn_orden_cajas', null ); if( $oc ) { $add = array(); foreach( $pcb as $k => $p ) { if( !array_key_exists('permanent_custom_box_'.$k, $oc ) ) $oc['permanent_custom_box_'.$k] = stripslashes_deep($pcb)[$k]['title']; } update_option( 'appyn_orden_cajas', $oc ); } } if( isset($_POST['new_rating_users']) || isset($_POST['new_rating_average']) ) { update_post_meta( $id, "new_rating_users", @$_POST['new_rating_users'] ); update_post_meta( $id, "new_rating_average", @$_POST['new_rating_average'] ); $nru = (empty($_POST['new_rating_users']) ? 0 : $_POST['new_rating_users'] ); $nra = (empty($_POST['new_rating_average']) ? 0 : $_POST['new_rating_average'] ); update_post_meta( $id, "new_rating_count", ceil($nru * $nra)); } delete_post_meta( $id, "app_type" ); if( isset($_POST['app_type']) ) { update_post_meta( $id, "app_type", $_POST['app_type'] ); } delete_post_meta( $id, "appyn_ads_control" ); if( isset($_POST['appyn_ads_control']) ) { update_post_meta( $id, "appyn_ads_control", $_POST['appyn_ads_control'] ); } delete_post_meta( $id, "appyn_hidden_sidebar" ); if( isset($_POST['appyn_hidden_sidebar']) ) { update_post_meta( $id, "appyn_hidden_sidebar", $_POST['appyn_hidden_sidebar'] ); } delete_post_meta( $id, "appyn_hidden_post_meta" ); if( isset($_POST['appyn_hidden_post_meta']) ) { update_post_meta( $id, "appyn_hidden_post_meta", $_POST['appyn_hidden_post_meta'] ); } delete_post_meta( $id, "appyn_hidden_social_buttons" ); if( isset($_POST['appyn_hidden_social_buttons']) ) { update_post_meta( $id, "appyn_hidden_social_buttons", $_POST['appyn_hidden_social_buttons'] ); } } add_action( 'trashed_post', 'px_delete_post' ); function px_delete_post( $id ) { $pdls4 = get_option( 'posts_download_links_status_404', array('') ); $arr = array_values(array_diff($pdls4 ,[$id])); update_option( 'posts_download_links_status_404', $arr ); } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); function custom_excerpt_length($length) { return 5; } add_filter( 'excerpt_more', 'new_excerpt_more' ); function new_excerpt_more( $more ) { return '... '; } add_filter( 'image_size_names_choose', 'px_image_sizes' ); function px_image_sizes( $sizes ) { $addsizes = array( "minimo" => "Mínimo", "medio" => "Medio" ); $newsizes = array_merge($sizes, $addsizes); return $newsizes; } add_filter( 'comment_text', 'div_comment_content' ); function div_comment_content( $comment_text ) { $comment_text = '
    '.wpautop($comment_text).'
    '; return $comment_text; } require_once( TEMPLATEPATH . '/includes/template-functions.php' ); require_once( TEMPLATEPATH . '/includes/template-actions.php' ); require_once( TEMPLATEPATH . '/includes/template-tags.php' ); require_once( TEMPLATEPATH . '/includes/admin.php' ); require_once( TEMPLATEPATH . '/includes/ajax.php' ); require_once( TEMPLATEPATH . '/includes/widget-ultimos-posts.php' ); require_once( TEMPLATEPATH . '/includes/widget-mejor-calificados.php' ); require_once( TEMPLATEPATH . '/includes/widget-mas-vistos.php' ); require_once( TEMPLATEPATH . '/includes/widget-facebook.php' ); require_once( TEMPLATEPATH . '/includes/widget-twitter.php' ); require_once( TEMPLATEPATH . '/includes/widget-youtube.php' ); require_once( TEMPLATEPATH . '/includes/widget-ultimos-posts-blog.php' ); require_once( TEMPLATEPATH . '/includes/widget-mas-vistos-blog.php' ); require_once( TEMPLATEPATH . '/includes/widget-mas-calificados.php' ); require_once( TEMPLATEPATH . '/includes/widget-categories.php' ); require_once( TEMPLATEPATH . '/includes/widget-fixed.php' ); require_once( TEMPLATEPATH . '/includes/class-list-table-atul.php' ); require_once( TEMPLATEPATH . '/includes/class-list-table-modapps.php' ); require_once( TEMPLATEPATH . '/includes/class-list-table-latestapps.php' ); require_once( TEMPLATEPATH . '/includes/class-list-table-searchapps.php' ); require_once( TEMPLATEPATH . '/includes/class-upload-apk.php' ); require_once( TEMPLATEPATH . '/includes/class-google-drive.php' ); require_once( TEMPLATEPATH . '/includes/class-dropbox.php' ); require_once( TEMPLATEPATH . '/includes/class-ftp.php' ); require_once( TEMPLATEPATH . '/includes/class-1fichier.php' ); require_once( TEMPLATEPATH . '/includes/class-onedrive.php' ); require_once( TEMPLATEPATH . '/includes/class-shortlinks.php' ); require_once( TEMPLATEPATH . '/admin/class-eps.php' ); add_action( 'wp_head', 'add_my_favicon' ); add_action( 'admin_head', 'add_my_favicon' ); function add_my_favicon() { global $post; $favicon = get_option( 'appyn_favicon' ); $favicon = ( !empty($favicon) ) ? $favicon: get_bloginfo('template_url').'/images/favicon.ico'; echo ''; } add_action( 'wp_head', 'add_head', 1 ); function add_head() { global $post; if( wp_is_mobile() ) { $styles = str_replace("url(images/", "url(".get_bloginfo('template_directory')."/images/", file_get_contents( TEMPLATEPATH . '/style.min.css') ); echo ''; } $color_theme_principal = str_replace('#', '',get_option( 'appyn_color_theme_principal' )); if($color_theme_principal){ echo ''; } else { echo ''; } echo ""; $script_loadfont = " "; echo ( ! httuachl() ) ? str_replace(array("\n", "\t"), "", str_replace(" ", " ", $script_loadfont)) : ''; $header_codigos = stripslashes(get_option('appyn_header_codigos')); echo $header_codigos; px_data_structure(); } function px_css_dark_theme() { $css = "body, .wrapper-inside { color: #d8d2d2; background: #1d222d; } table thead th, #versiones table tbody > tr:nth-child(odd) td, .pxtd .table tr:nth-child(odd) td { background: rgba(255,255,255,0.05); } table tbody td, table tfoot td, table tfoot th, #versiones table tbody tr td { background: rgba(255,255,255,0.02); } #versiones table tbody tr td { background: transparent; } #header, #header menu .menu .sub-menu, #header menu .menu .sub-menu li a, #footer, #px-bottom-menu { background: #13161d; } .box-rating .rating { background-color: #7c7f84; } table td, table th, .box .box-title::before, .section.blog .bloques li, .section.blog .title-section, .box .comments-title, #versiones table thead tr th, #slideimages .item img, .pxtd .table td, .loading, .g-recaptcha::before { border-color: #232834; } html .section .bav2>a::before { background: rgb(31 34 39 / 30%); } html .section .bav a, .section a.more:hover, .section .bloque-blog, .widget .widget-content ul li:hover a::before, .w75.bloque-imagen.bi_ll, .pxtd .entry.bx-info-install, .fp_box a, .catbar li a { background-color: #282d3a; } table tr:nth-child(even), table tbody th { background: #252a37; } #versiones table thead tr th { background: #1f2430; } html .section .bav a, html .gsc-control-cse, .bloque-blog { box-shadow:2px 2px 2px 0px #1a1c1f; } .rating-loading { background-color:rgba(0,0,0,0.5); } a, a:hover, .botones_sociales.v2 a i, .app-s #download.box ul li a, #comments ol.comment-list .comment .comment-body > p, .box .box-title, .app-p .box h1.box-title, .app-p .box h2 #reply-title, .bav .title, h1.main-box-title, #subheader.np .searchBox ul li a, .section.blog .bloques li a.title, .section .bloque-blog a.title, .single-product .product, .single-product .product a, .single-product .product a:hover, .app-s .bx-download, .bxt, #breadcrumbs a:hover, #main-site .error404 h1, #main-site .error404 h2, .app-s .da-s b, .widget-title h2, .dl-verified, #comments ol.comment-list .trackback, #comments ol.comment-list .pingback, .widget a, .pxtd h3, .catbar li a { color: #FFF; } .px-carousel-nav .px-prev i, .px-carousel-nav .px-next i { color: #8a8a8a; } .entry, .section.blog .bloques li .excerpt, .app-s .entry, .app-s .box .box-content { color:#d4d4d4; } #comments ol.comment-list .comment .comment-body .reply a { color:#1bbc9b; } .app-s .box, #subheader.np, .section.blog, .app-p .box, .single-product .product { background: #282d3a; box-shadow: 2px 2px 2px 0px #1a1c1f; } .app-s .entry.bx-info-install { background: #303542; } .botones_sociales.v2 a, #comments textarea, #comments input[type=text], #comments input[type=email], #comments input[type=url], #comments textarea, .botones_sociales a { background: #1d222d; color: #FFF; } .pagination .page-numbers, .pagination .current, .section.blog .pagination .current, .section.blog .pagination .page-numbers { color:#FFF; background: #282d3a; } .wb .title, #comments ol.comment-list .comment .comment-body .comment-content p { color:#bfbfbf; } #subheader.np .searchBox ul, .widget { background:#1d222d; box-shadow:none; } .section .title-section, .widget .widget-title, .widget_block h2, .widget .widget-content ul li a, #slideimages .px-prev i, #slideimages .px-next i, .app-s .entry.bx-info-install { border-color: #282d3a; } #breadcrumbs, #breadcrumbs a, .wb .developer, .wb .app-date, .wb .version, .wb .size { color: #6d6d6d; } main .error404 { color:#FFF; } main .error404 h1 { text-shadow: 10px 10px 8px rgba(0,0,0,0.4); } .entry blockquote { border-color: #4c5160; } .ratingBoxMovil .box-rating.movil { background: #252935; } .link-report { color: #bfbfbf; } .link-report:hover, .px-carousel-nav .px-prev i:hover, .px-carousel-nav .px-next i:hover { color: #FFF; } #box-report > div { color: #4c4c4c; } .wp-caption-text { background: rgba(0,0,0,0.1); color: #d8d2d2; } .app-s .entry.limit::before { background: -moz-linear-gradient(top, rgba(0,0,0,0), rgba(40,45,58,1)); background: -webkit-linear-gradient(top, rgba(0,0,0,0),rgba(40,45,58,1)); background: linear-gradient(to bottom, rgba(40,45,58,0),rgba(40,45,58,1)); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\"#00ffffff\", endColorstr=\"#282d3a\",GradientType=0 ); } .buttond:not(.danv):hover:not(.t):hover, .buttond.danv:hover, .buttond.t:hover, .app-s .s2 .meta-cats a:hover, .app-s .readmore:hover, .tags a:hover, #comments input[type=submit]:hover, .section a.more:hover, .sb_submit[type=submit]:hover, .widget.widget_tag_cloud a:hover, .bloque-imagen.bi_ll, #backtotop:hover, .botones_sociales.color span:hover, .botones_sociales.color a:hover, .widget .search-form input[type=submit]:hover, .widget .wp-block-search .wp-block-search__button:hover, #dl-telegram:hover, #dasl:not([disabled]):hover, .catbar li a:hover { background: #41495d; } .sdl-bar { background: rgba(0,0,0,0.2); } /*Woocommerce*/ .select2-container { color:#000; } .woocommerce div.product .woocommerce-tabs ul.tabs::before, .woocommerce div.product .woocommerce-tabs ul.tabs li, .woocommerce div.product .woocommerce-tabs ul.tabs li.active, .woocommerce #reviews #comments ol.commentlist li .comment-text, #add_payment_method #payment ul.payment_methods, .woocommerce-cart #payment ul.payment_methods, .woocommerce-checkout #payment ul.payment_methods, #add_payment_method .cart-collaterals .cart_totals tr td, #add_payment_method .cart-collaterals .cart_totals tr th, .woocommerce-cart .cart-collaterals .cart_totals tr td, .woocommerce-cart .cart-collaterals .cart_totals tr th, .woocommerce-checkout .cart-collaterals .cart_totals tr td, .woocommerce-checkout .cart-collaterals .cart_totals tr th { border-color: rgba(255,255,255,0.1); } #subheader.np .searchBox ul li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li, .woocommerce div.product .woocommerce-tabs ul.tabs li.active, #add_payment_method #payment, .woocommerce-cart #payment, .woocommerce-checkout #payment, fieldset { background: rgba(255,255,255,0.1); } .woocommerce div.product .woocommerce-tabs ul.tabs li.active, fieldset legend { background: #282d3a; } .woocommerce div.product .woocommerce-tabs ul.tabs li a { color: rgba(255,255,255,0.3); } /**/ @media screen and (max-width:500px){ .botones_sociales li { border:none; } .app-s .box-data-app { background:#1d222d; } .app-s .da-s { border-bottom-color:#282d3a; } }"; if( is_rtl() ) { $css .= ' html .gsc-control-cse, .app-s .box, #subheader.np, .section.blog, .app-p .box, .bloque-blog { box-shadow: -2px 2px 2px 0px #1a1c1f; }'; } $css = str_replace(array("\n", "\r", "\t", " "), "", $css); return $css; } function is_dark_theme_active() { if( isset($_COOKIE['px_light_dark_option']) ) { return ($_COOKIE['px_light_dark_option'] == 1) ? true : false; } else { $color_theme = str_replace('#', '', get_option( 'appyn_color_theme' )); return ($color_theme == "oscuro") ? true : false; } } add_action( 'wp_head', 'add_color_theme', 99 ); function add_color_theme() { global $post; if( !is_amp_px() ) { if( is_dark_theme_active() ) { echo ''; } else { echo ''; } } if( is_dark_theme_active() && is_amp_px() ) { echo px_css_dark_theme(); } if( !is_amp_px() ) { echo ''; } } add_action( 'wp_enqueue_scripts', 'theme_scripts' ); function theme_scripts() { if( !wp_is_mobile() ) { wp_enqueue_style( 'style', get_bloginfo( "template_directory" ).'/style.min.css', false, VERSIONPX, 'all' ); } if( appyn_options( 'infinite_scroll' ) ) wp_enqueue_script( 'px-infinite-scroll', get_bloginfo("template_directory").'/assets/js/infinite-scroll.pkgd.min.js', false, VERSIONPX, true ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'px-js', get_bloginfo( "template_directory" ).'/assets/js/js.min.js', array('jquery'), VERSIONPX, true ); $readmore_single = stripslashes(get_option( 'appyn_readmore_single' )); $o = ''; if( $readmore_single == 1 ) { $o .= 'var text_ = false;'; } else { $o .= 'var text_ = true;'; } $o .= ' var ajaxurl = "' . admin_url('admin-ajax.php') . '"; var text_votar = "'.__( 'Votar', 'appyn' ).'"; var text_votos = "'.__( 'Votos', 'appyn' ).'"; var text_leer_mas = "'.__( 'Leer más', 'appyn' ).'"; var text_leer_menos = "'.__( 'Leer menos', 'appyn' ).'"; var text_de = "'.__( 'de', 'appyn' ).'"; var text_reporte_gracias = "'.__( 'Gracias por enviarnos su reporte.', 'appyn' ).'";'; $recaptcha_site = get_option( 'appyn_recaptcha_site' ); $recaptcha_secret = get_option( 'appyn_recaptcha_secret' ); if( $recaptcha_site && $recaptcha_secret ) { $o .= 'var recaptcha_site = "'.$recaptcha_site.'"'; } wp_add_inline_script( 'px-js', $o, 'before' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { add_action('wp_footer', function(){ echo ''; }); } } function paginador( $query = false, $num = false, $args = null ) { if( !empty($query) ) { $wp_query = $query; $numposts = $query->found_posts; $max_page = $query->max_num_pages; $posts_per_page = intval($num); } else { global $wp_query; $max_page = $wp_query->max_num_pages; } if( appyn_options( 'infinite_scroll' ) == 1 && $wp_query->max_num_pages > 1 && ! is_amp_px() ) { echo '
    '; } $big = 999999999; $pages = paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $max_page, 'type' => 'array', ) ); if( is_array( $pages ) ) { $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); echo '
      '; foreach ( $pages as $page ) { echo "
    • ".str_replace('page-numbers dots', 'dots', $page)."
    • "; } echo '
    '; } } add_action( 'pre_get_posts', 'function_pregetposts' ); function function_pregetposts( $query ) { if ( !is_admin() && $query->is_main_query() ) { if( $query->is_post_type_archive('blog') ) { $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $blog_posts_limite = get_option( 'appyn_blog_posts_limite' ); $blog_posts_limite = (empty($blog_posts_limite)) ? '10' : $blog_posts_limite; $query->set('post_type', 'blog'); $query->set('posts_per_page', $blog_posts_limite); $query->set('paged', $paged); } if( $query->is_search() ) { $query->set('post_type', array('post', 'blog')); if( get_option( 'appyn_versiones_mostrar_buscador') == 1 ) { $query->set('post_parent', 0); } } if( $query->is_tax('dev') ) { if( get_option( 'appyn_versiones_mostrar_tax_desarrollador') == 1 ) { $query->set('post_parent', 0); } } if( $query->is_tax('cblog') ) { $query->set('post_type', 'blog'); } if( $query->is_tax('tblog') ) { $query->set('post_type', 'blog'); } if( $query->is_category() ) { if( get_option( 'appyn_versiones_mostrar_categorias') == 1 ) { $query->set('post_parent', 0); } } if( $query->is_tag() ) { if( get_option( 'appyn_versiones_mostrar_tags') == 1 ) { $query->set('post_parent', 0); } } if( $query->is_home() && 'posts' === get_option( 'show_on_front' ) ) { $home_limite = get_option( 'appyn_home_limite' ); $home_limite = ( empty( $home_limite ) ) ? '12' : $home_limite; $query->set('posts_per_page', $home_limite); $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $query->set('paged', $paged); $home_posts_orden = get_option( 'appyn_home_posts_orden' ); $home_posts_versiones = get_option( 'appyn_versiones_mostrar_inicio', 0 ); if( $home_posts_orden == 'modified' ){ $query->set('orderby', 'modified'); } elseif( $home_posts_orden == 'rand' ){ $query->set('orderby', 'rand'); } if( $home_posts_versiones == 1 ){ $query->set('post_parent', 0); } } if( $query->is_home() && 'page' === get_option( 'show_on_front' ) ) { $query->set('post_type', 'page'); $query->set('page_id', get_option( 'page_on_front' )); } } if(is_admin()){ $query->set('orderby', ''); $query->set('order', ''); } } add_action( 'wp_head', 'download_opts' ); function download_opts() { if( !is_singular('post') ) return; global $post; $adl = get_option( 'appyn_download_links' ); $redirect_timer = get_option( 'appyn_redirect_timer' ); $get_download = get_query_var( 'download', null ); $datos_download = get_datos_download(); if( !isset($datos_download['option']) ) return; if( $adl == 1 || $adl == 2 || $adl == 3 || $adl == 4 ) { $error_script = ""; $option = $datos_download['option']; $get_opt = get_query_var( 'opt' ); if( $option == "direct-link" && $get_download ) { if( ($adl == 2 && $get_opt == 1) || (($adl == 1 || $adl == 3) && !$get_opt) ) { if( isset( $datos_download['direct-link'] ) ) { echo ''; } } } else { echo $error_script; } } } add_action( 'template_redirect', 'download_file' ); function download_file(){ if( !is_single() ) return; global $post; $get_download = get_query_var( 'download', null ); if( $get_download == "file") { $post_id = $post->ID; $datos_download = get_post_meta($post_id, 'datos_download', true); $url = $datos_download['direct-download']; header("Location: $url"); exit(); } } add_action( 'registered_post_type', 'igy2411_make_posts_hierarchical', 10, 2 ); function igy2411_make_posts_hierarchical( $post_type, $pto ){ if ($post_type != 'post') return; global $wp_post_types; $wp_post_types['post']->hierarchical = 1; add_post_type_support( 'post', 'page-attributes' ); } add_filter( 'post_thumbnail_html', 'modify_post_thumbnail_html', 99, 5 ); function modify_post_thumbnail_html( $html, $post_id, $post_thumbnail_id, $size, $attr ) { $appyn_lazy_loading = ( get_option('appyn_lazy_loading') ) ? get_option('appyn_lazy_loading') : NULL; if( $appyn_lazy_loading == 1 ) { $id = get_post_thumbnail_id(); $src = wp_get_attachment_image_src($id, $size); $alt = get_the_title($id); $class = ''; if( !empty($attr['class']) ) { $class = $attr['class']; } $image_blank = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI4AAACNAQMAAABbp9DlAAAAA1BMVEX///+nxBvIAAAAGUlEQVRIx+3BMQEAAADCIPunNsU+YAAA0DsKdwABBBTMnAAAAABJRU5ErkJggg=="; $color_theme = str_replace('#', '', get_option( 'appyn_color_theme' )); if($color_theme == "oscuro") { $image_blank = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI4AAACNAQMAAABbp9DlAAAAA1BMVEUUHCkYkPNHAAAAGUlEQVRIx+3BMQEAAADCIPunNsU+YAAA0DsKdwABBBTMnAAAAABJRU5ErkJggg=="; } $html = '' . $alt . ''; } return $html; } add_filter( 'upload_mimes', 'allow_custom_mimes' ); function allow_custom_mimes( $existing_mimes=array() ) { $existing_mimes['apk'] = 'application/vnd.android.package-archive'; return $existing_mimes; } add_rewrite_endpoint( PX_AMP_QUERY_VAR, EP_PERMALINK ); add_filter( 'template_include', 'amp_page_template', 99 ); function amp_page_template( $template ) { $section = get_query_var( 'section' ); if( is_amp_px() ) { if( $section == 'versions' ) { $template = get_template_directory() . '/amp/single-versions.php'; } else { if ( is_home() ) { if ( 'page' === get_option( 'show_on_front' ) ) $template = get_template_directory() . '/amp/page.php'; else $template = get_template_directory() . '/amp/index.php'; } elseif ( is_singular('post') ) { $template = get_template_directory() . '/amp/single.php'; } } } else { if( $section == 'versions' ) { $template = get_template_directory() . '/single-versions.php'; } } return $template; } add_action( 'get_header', function($name){ return "header-amp"; } ); add_action('wp_head', function(){ global $wp_query; if( is_404() || !appyn_options( 'amp' ) ) return; if( is_home() || is_single() || is_archive() ) { if( is_home() ) { echo ''; } elseif( is_single() ) { global $post; echo ''; } elseif( is_archive() ) { $obj = get_queried_object(); if( isset($obj->rewrite['slug']) ) { $l = get_post_type_archive_link($obj->rewrite['slug']); echo ''; } } else { $obj = get_queried_object(); if( !empty($obj->term_id) ) echo ''; } } }); add_filter( 'post_link', 'px_filter_post_link_amp', 10, 2 ); add_filter( 'post_type_link', 'px_filter_post_link_amp', 10, 2 ); function px_filter_post_link_amp( $link, $post ){ if( is_amp_px() ) { return $link.'?amp'; } return $link; } add_filter( 'post_thumbnail_html', 'modify_post_thumbnail_amp', 99, 5 ); function modify_post_thumbnail_amp( $html, $post_id, $post_thumbnail_id, $size, $attr ) { if( is_amp_px() ) { $id = get_post_thumbnail_id(); $src = wp_get_attachment_image_src($id, $size); $alt = get_the_title($id); $class = ''; if( !empty($attr['class']) ) { $class = $attr['class']; } $html = ''; } return $html; } add_filter( 'comment_reply_link', function($args_before_link_args_after){ if( is_amp_px() ) { return false; } else { return $args_before_link_args_after; } } ); add_filter( 'get_avatar_url', 'wpua_get_avatar_url', 50, 3 ); function wpua_get_avatar_url( $url, $id_or_email, $args ){ if( class_exists('WP_User_Avatar_Functions') && $id_or_email != 'unknown@gravatar.com' ) { global $wpua_functions; $url = $wpua_functions->get_wp_user_avatar_src( $id_or_email, $args['size'] ); } return $url; } add_filter( 'locale_stylesheet_uri', function ($localized_stylesheet_uri) { if( strpos($localized_stylesheet_uri, 'rtl.css') !== false ) { return add_query_arg( array('ver' => VERSIONPX), $localized_stylesheet_uri ); } }); add_action( 'wp_head', function(){ echo ''; }); add_action( 'wp_enqueue_scripts', 'dequeue_gutenberg_theme_css', 100); function dequeue_gutenberg_theme_css() { wp_dequeue_style( 'wp-block-library' ); wp_dequeue_style( 'classic-theme-styles' ); } add_filter('request', 'px_change_term_request', 1, 1 ); function px_change_term_request( $query ){ foreach( array( 'cblog', 'tblog' ) as $tax_name ) { if( isset($query['attachment']) ) : $include_children = true; $name = $query['attachment']; else: $include_children = false; $name = isset($query['name']) ? $query['name'] : ''; endif; $term = get_term_by('slug', $name, $tax_name); if (isset($name) && $term && !is_wp_error($term)): if( $include_children ) { unset($query['attachment']); $parent = $term->parent; while( $parent ) { $parent_term = get_term( $parent, $tax_name); $name = $parent_term->slug . '/' . $name; $parent = $parent_term->parent; } } else { unset($query['name']); } switch( $tax_name ): case 'category':{ $query['category_name'] = $name; break; } case 'post_tag':{ $query['tag'] = $name; break; } default:{ $query[$tax_name] = $name; break; } endswitch; endif; } return $query; } add_filter( 'term_link', 'px_term_permalink', 10, 3 ); function px_term_permalink( $url, $term, $taxonomy ){ if( get_option( 'permalink_structure' ) != '/%postname%/' ) return $url; $taxonomy_name = 'cblog'; $taxonomy_slug = 'cblog'; if ( strpos($url, $taxonomy_slug) === FALSE || $taxonomy != $taxonomy_name ) return $url; $url = str_replace('/' . $taxonomy_slug, '', $url); return $url; } add_filter( 'term_link', 'px_term_permalink_tag_blog', 10, 3 ); function px_term_permalink_tag_blog( $url, $term, $taxonomy ){ if( get_option( 'permalink_structure' ) != '/%postname%/' ) return $url; $taxonomy_name = 'tblog'; $taxonomy_slug = 'tblog'; if ( strpos($url, $taxonomy_slug) === FALSE || $taxonomy != $taxonomy_name ) return $url; $url = str_replace('/' . $taxonomy_slug, '', $url); return $url; } add_filter( 'manage_post_posts_columns', 'set_custom_edit_version_columns' ); function set_custom_edit_version_columns( $columns ) { $new = array(); foreach($columns as $key => $title) { if( $key == 'title' ) { $new['icon'] = ''; } if( $key == 'author' ) { $new['version'] = __( 'Versión', 'appyn' ); } $new[$key] = $title; } return $new; } add_action( 'manage_post_posts_custom_column' , 'custom_version_column', 10, 2 ); function custom_version_column( $column, $post_id ) { global $wpdb; switch ( $column ) { case 'icon' : $icon = get_the_post_thumbnail_url( $post_id, 'thumbnail' ); $icon = ( $icon ) ? $icon : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACqBAMAAADPWMmxAAAAElBMVEXu7u7////09PT7+/v39/fx8fFOJAxSAAABPklEQVRo3u3YQW6DMBCFYYLjAzxM9iRK9tA2e2h6ACP1/mcpFDlQNVTQGdpEvO8Av62RDYKIiIiIiIiIiIj+THyY4TS1usEMjlVW/7+aTLourK60ai+v+lVbAGf1ao2G164WaOTKVYtWolyN0UqVq1u03F3u9enmXHeyqkW2wBkw32Zh2pSXVffhxPcU7lYRZtizx1Mkq8ZoeO1nlkHjrF2t0HBeuYpPedS5eJXq9ss732KnUq3RycOQM41qgY4LayQKVYsgD2uU8qpBkIaz6+TVGldlWCMXVwsMN1uh5bywGmMgs+jshFWDgcRc+7LqHkNVPwxRtcBtpaS6xQgnqW4w5iyoVhjj/BJVJItUkS1STRepIl+k6n5bfX/7SfYQ3zArqaaHCY738deB1XVXzfMMLxERERERERERET24D8nRkAcrLOazAAAAAElFTkSuQmCC'; echo ''; break; case 'version' : $datos_informacion = get_post_meta( $post_id, 'datos_informacion', true ); echo ( isset($datos_informacion['version']) ) ? $datos_informacion['version'] : '--'; break; } } add_filter( 'body_class', function( $classes ) { $add_class = array(); if( is_dark_theme_active() ) { $add_class[] = 'theme-dark'; } if( appyn_options( 'sidebar_active' ) == 1 ) { $add_class[] = 'no-sidebar'; } if( appyn_options( 'design_rounded' ) ) { $add_class[] = 'rounded'; } if( appyn_options( 'og_sidebar' ) || ( is_singular( 'post' ) || is_page() ) && appyn_options( 'sidebar_active' ) == 0 ) { $add_class[] = 'sidg'; } if( appyn_options( 'blog_mn_sidebar' ) && ( is_singular( 'blog' ) || is_post_type_archive('blog') || is_tax('cblog') || is_tax('tblog')) ) { $add_class[] = 'sidg'; } global $post; if( isset($post->ID) ) { if( appyn_gpm( $post->ID, 'appyn_hidden_sidebar' ) ) { $add_class = array_diff($add_class, array('sidg')); } } $aprmv = appyn_options( 'apps_per_row_movil', 2 ); $add_class[] = 'aprm-'.$aprmv; if( appyn_options( 'width_page' ) ) { $add_class[] = 'full-width'; } if( appyn_options( 'view_apps' ) == 1 ) { $add_class[] = 'vah'; } else { $add_class[] = 'vav'; } if( count($add_class) > 0 ) return array_merge( $classes, $add_class ); else return $classes; } ); if( !is_dir( WP_TEMP_DIR ) ) { mkdir( WP_TEMP_DIR, 0755, true ); } function disabled_lazyload() { if( is_amp_px() ) return false; } add_filter( 'wp_lazy_loading_enabled', 'disabled_lazyload' ); function wp_editor_fix( $content, $editor_id, $settings = array() ){ ob_start(); wp_editor($content, $editor_id, $settings); $out = ob_get_contents(); $js = json_encode($out); $id_editor_ctn = $editor_id.'-ctn'; ob_clean(); ?>
    __( 'Versión', 'appyn' ), 'variable' => 'px_rms_get_version', 'description' => '', 'example' => px_rms_callback(), ], 'px_rms_callback' ); }); function single_info_title( $version ) { $title = get_the_title(); $version = $version ?? ''; $filter_rvt = apply_filters( 'px_remove_version_title', '__return_true' ); if( $filter_rvt ) { $output = '

    '. str_replace( $version, '', $title ) . '

    '; $output .= ( ! empty ( $version ) ? '
    '.$version.'
    ' : '' ); } else { $output = '

    '. $title . '

    '; } return $output; } add_filter('wp_generate_tag_cloud', 'na_tag_cloud',10,1); function na_tag_cloud($string){ return preg_replace("/style=\"font-size:.+pt;\"/", '', $string); } add_action( 'template_redirect', function(){ ob_start( function( $buffer ){ $buffer = str_replace( array( ' type="text/css"', " type='text/css'" ), '', $buffer ); $buffer = str_replace( array( ' type="text/javascript"', " type='text/javascript'" ), '', $buffer ); return $buffer; }); }); class PX_Menu_AMP extends Walker_Nav_Menu { function start_el(&$output, $item, $depth = 0, $args = NULL, $id = 0) { global $wpdb, $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="' . esc_attr( $class_names ) . '"'; $has_children = $wpdb->get_var( $wpdb->prepare(" SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %d ", '_menu_item_menu_item_parent', $item->ID) ); $output .= $indent . '