This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
class HtmlDownloader(object): | |
def download(self, url): | |
if url is None: | |
return None | |
response = urllib.request.urlopen(url) | |
if response.getcode() != 200: | |
return None | |
return response.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACF | |
https://wordpress.org/support/topic/conflict-with-gutenberg-4/ | |
https://wordpress.org/support/topic/acf-field-groups-wsod-when-classic-editor-is-active/ | |
https://github.com/WordPress/gutenberg/issues/12571 | |
https://www.advancedcustomfields.com/blog/acf-5-7-9-release/ | |
https://www.advancedcustomfields.com/blog/acf-5-7-8-release/ | |
https://www.advancedcustomfields.com/blog/the-night-before-gutenberg/ | |
WooCommerce | |
https://github.com/woocommerce/woocommerce/issues/22279 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Remove type from script and style tags | |
Plugin URI: https://www.damiencarbery.com/2018/11/remove-type-from-script-and-style-markup/ | |
Description: Remove 'type="text/javascript"' from 'script' tags and 'type="text/css"' from 'style' tags. | |
Author: Damien Carbery | |
Author URI: https://www.damiencarbery.com | |
Version: 0.2 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ec_child_wpml_switcher() { | |
echo do_shortcode('[wpml_language_switcher type="widget" flags=1]'); | |
do_action('wcml_currency_switcher', array('format' => '%symbol% %code%')); | |
} | |
add_action( 'electro_mobile_header_v1', 'ec_child_wpml_switcher', 25 ); | |
add_action( 'electro_mobile_header_v2', 'ec_child_wpml_switcher', 25 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WeAreWP Gutenberg | |
Description: Disable Gutenberg in WordPress 5.0 | |
Plugin URI: https://www.wearewp.pro | |
Version: 1.0 | |
Author: WeAre[WP] | |
Author URI: https://www.wearewp.pro | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Añadir Shortcode | |
function dummyimage_shortcode_function( $atts ) { | |
// Atributos | |
$atts = shortcode_atts( | |
array( | |
'width' => '600', | |
'height' => '300', | |
'background' => 'eeeeee', | |
'text' => 'ffffff', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Tell WordPress SEO to use only full featured image for og:image output... and nothing else on singular | |
function only_full_og_featured_image() { | |
global $post; | |
if ( is_singular() ) { | |
if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) { | |
$featured_image_url = wp_get_attachment_image_src(get_post_thumbnail_ID( $post->ID ), 'full' ); | |
return $featured_image_url[0]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Edit these to suit your needs | |
add_image_size( 'og-image', 1200, 630, true ); | |
add_image_size( 'twitter-image', 1024, 512, true ); | |
/** | |
* Limit The SEO Framework og:image and twitter:image sizes. | |
* | |
* For: https://fi.wordpress.org/plugins/autodescription/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Add impreza images to Yoast sitemap, since Yoast doesn't read impreza's Page | |
* Builder code - borrowed from (https://github.com/Yoast/wordpress-seo/issues/4808) */ | |
function impreza_filter_wpseo_sitemap_urlimages($images, $post_id) | |
{ | |
$post = get_post($post_id); | |
if (is_object($post)) { | |
$content = $post->post_content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************** | |
* VC ACF GRID ITEM W/ RELATIONSHIP | |
***************************************/ | |
add_filter( 'vc_grid_item_shortcodes', 'vc_grid_item_shortcode_acf_extra' ); | |
function vc_grid_item_shortcode_acf_extra( $shortcodes ) { | |
$groups = function_exists( 'acf_get_field_groups' ) ? acf_get_field_groups() : apply_filters( 'acf/get_field_groups', array() ); | |
$groups_param_values = $fields_params = array(); | |
foreach ( $groups as $group ) { | |
$id = isset( $group['id'] ) ? 'id' : ( isset( $group['ID'] ) ? 'ID' : 'id' ); | |
$groups_param_values[ $group['title'] ] = $group[ $id ]; |
NewerOlder