{"id":62729,"date":"2020-07-13T17:39:22","date_gmt":"2020-07-13T12:09:22","guid":{"rendered":"https:\/\/git-staging.wpastra.com\/?post_type=docs&#038;p=62729"},"modified":"2021-09-08T21:17:28","modified_gmt":"2021-09-08T15:47:28","slug":"deprecated-google-fonts-filter","status":"publish","type":"docs","link":"https:\/\/git-staging.wpastra.com\/es\/docs\/deprecated-google-fonts-filter\/","title":{"rendered":"Filtro Google Fonts obsoleto"},"content":{"rendered":"<p>Desde el <strong>Tema Astra versi\u00f3n 2.5.0<\/strong>estamos haciendo algunos cambios en la forma en que se servir\u00e1 el archivo de Google Fonts. Anteriormente, esto sol\u00eda causar un error raro con WP_Filesystem() en algunos servidores.<\/p>\n\n\n\n<p>Por lo mismo, estamos desaprobando el filtro:&nbsp;<code>astra_google_fonts_json_file<\/code><\/p>\n\n\n\n<p>Ahora, en lugar del filtro anterior, los usuarios utilizar\u00e1n un nuevo filtro:&nbsp;<code>astra_google_fonts_php_file<\/code><\/p>\n\n\n\n<p style=\"background-color:#e7cdff\" class=\"has-background\">Nota: Para los usuarios que est\u00e1n recibiendo este aviso de PHP despu\u00e9s de la actualizaci\u00f3n -<\/p>\n\n\n\n<p><code>Obsoleto: \u00a1astra_google_fonts_json_file est\u00e1 obsoleto desde la versi\u00f3n 2.5.0! Util\u00edcelo en su lugar. astra_google_fonts_php_file`.<\/code><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Si necesitas cambiar su archivo de Google Fonts de JSON a PHP puedes hacerlo simplemente usando este nuevo filtro -<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>add_filter('astra_google_fonts_php_file', 'asrta_add_new_google_php_file');\n\nfunction asrta_add_new_google_php_file() {\n    return get_stylesheet_directory() . '\/google-new-fonts.php';\n}<\/code><\/pre>\n\n\n\n<p>Y aqu\u00ed est\u00e1 el enlace a la <a href=\"https:\/\/gist.github.com\/premanshup\/1f2cd7c4fd337b2664fbc181ac113137\">archivo de fuentes de demostraci\u00f3n<\/a> y la matriz de c\u00f3mo debe agregar e insertar nuevas fuentes de Google. Puede modificar la ruta del archivo en el filtro anterior basado en el nombre del archivo - google-new-fonts.php.<\/p>\n\n\n\n<p style=\"background-color:#e7cdff\" class=\"has-background\"><strong>Nota:<\/strong> A\u00f1ada el c\u00f3digo anterior en el campo<a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/add-custom-php-code\/#3.-in-child-theme\">\u00a0archivo functions.php del tema hijo<\/a><strong>.<\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>A partir de la versi\u00f3n 2.5.0 del tema Astra, estamos realizando algunos cambios en la forma de servir el archivo de Google Fonts. Anteriormente, esto sol\u00eda causar un raro error con WP_Filesystem() en algunos servidores. Por ello, estamos dejando obsoleto el filtro: astra_google_fonts_json_file Ahora, en lugar del filtro anterior, los usuarios utilizar\u00e1n el nuevo filtro: astra_google_fonts_php_file Nota: [...]<\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"docs_category":[2109],"docs_tag":[1990,1991],"class_list":{"0":"post-62729","1":"docs","2":"type-docs","3":"status-publish","5":"docs_category-astra-theme-pro-filters","6":"docs_tag-deprecating-google-fonts-filter","7":"docs_tag-resolve-wp_filesystem-error"},"spectra_custom_meta":{"_edit_lock":["1631116048:70"],"_edit_last":["70"],"tap_disable_autolinker":["no"],"tap_autolink_inside_heading":["global"],"tap_autolink_random_placement":["global"],"tap_post_autolinker_limit":["0"],"site-sidebar-layout":["default"],"site-content-layout":["default"],"theme-transparent-header-meta":["default"],"_yoast_wpseo_content_score":["90"],"_wp_page_template":["default"],"_ht_kb_post_views_count":["5"],"_ht_kb_usefulness":["0"],"_ht_article_order_103":["62729"],"wp_last_modified_info":["September 8, 2021 @ 9:17 PM"],"wplmi_shortcode":["[lmt-post-modified-info]"],"views":["4907"],"helpful":["0"],"unhelpful":["0"],"redirects":["0"],"_lmt_disableupdate":["no"],"_wplmi_last_modified":["2021-09-08 21:17:28"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"rank_math_analytic_object_id":["592"],"rank_math_internal_links_processed":["1"],"_trp_automatically_translated_slug_es_ES":["filtro-google-fonts-obsoleto"],"_uag_page_assets":["a:9:{s:3:\"css\";s:2495:\".wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-top svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-top .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-bottom svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-bottom .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__video-wrap video{opacity: 1;}.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1200px);max-width: var(--inner-content-custom-width);width: 100%;flex-direction: column;align-items: center;justify-content: center;flex-wrap: nowrap;row-gap: 0px;column-gap: 0px;}.wp-block-uagb-container.uagb-block-debf2792{box-shadow: 0px 0px   #00000070 ;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;overflow: visible;border-color: inherit;row-gap: 0px;column-gap: 0px;}@media only screen and (max-width: 976px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1024px);max-width: var(--inner-content-custom-width);width: 100%;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}@media only screen and (max-width: 767px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 767px);max-width: var(--inner-content-custom-width);width: 100%;flex-wrap: wrap;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}\";s:2:\"js\";s:0:\"\";s:18:\"current_block_list\";a:5:{i:0;s:14:\"core\/paragraph\";i:1;s:14:\"core\/separator\";i:2;s:9:\"core\/code\";i:3;s:14:\"uagb\/container\";i:4;s:14:\"core\/shortcode\";}s:8:\"uag_flag\";b:1;s:11:\"uag_version\";s:10:\"1777217615\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false},"uagb_author_info":{"display_name":"Suman","author_link":"https:\/\/git-staging.wpastra.com\/es\/author\/sumand\/"},"uagb_comment_info":0,"uagb_excerpt":"From the Astra theme version 2.5.0, we are making some changes on how the Google Fonts file will be served. Previously, this used to cause a rare error with WP_Filesystem() on some servers. For the same, we are deprecating the filter:&nbsp;astra_google_fonts_json_file Now, instead of the above filter, users will now be using new filter:&nbsp;astra_google_fonts_php_file Note:&hellip;","_links":{"self":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/62729"}],"collection":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/comments?post=62729"}],"version-history":[{"count":0,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/62729\/revisions"}],"wp:attachment":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/media?parent=62729"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_category?post=62729"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_tag?post=62729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}