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 | |
function get_estimated_reading_time( $content = '', $wpm = 250 ) { | |
$content = strip_tags( $content ); | |
$word_count = str_word_count( $content ); | |
return ceil( $word_count / $wpm ); | |
} |
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
# Export all pages | |
wp export --post_type=page | |
# Delete all pages from staging | |
wp post delete $(wp post list --post_type='page' --format=ids) | |
# Import XML in staging | |
wp import example.wordpress.2016-06-21.xml --authors=skip |
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_action( 'wp_loaded', 'rmr_export_page_templates' ); | |
function rmr_export_page_templates() { | |
$pages = get_posts( array( | |
'numberposts' => -1, | |
'post_type' => 'page', | |
) ); |
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: Disable Plugin | |
Plugin URI: https://roelmagdaleno.com | |
Description: Disable Plugin | |
Version: 0.1.0 | |
Author: Roel Magdaleno | |
Author URI: https://roelmagdaleno.com | |
*/ |
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
curl -X POST \ | |
'https://api.mercadopago.com/checkout/preferences?access_token=[ACCESS_TOKEN]' \ | |
-H 'content-type:application/json' \ | |
-d '{ | |
"items": [ | |
{ | |
"title": "Dummy Item", | |
"description": "Multicolor Item", | |
"quantity": 1, | |
"currency_id": "ARS", |
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: WP CoinMarketCap | |
Plugin URI: https://roelmagdaleno.com/ | |
Description: Get the latest cryptocurrency data. | |
Version: 2.0 | |
Author: Roel Magdaleno | |
Author URI: https://roelmagdaleno.com/ | |
License: GPL2 |