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 | |
$host = 'http://tudominio.com/wp-json/wp/v2/posts/123'; | |
$data = array('title' => 'Titulo Post Nuevo Modif', 'content' => 'Contenido de prueba Modif', 'status' => 'publish'); | |
$data_string = json_encode($data); | |
$headers = array( | |
'Content-Type:application/json', | |
'Content-Length: ' . strlen($data_string), |
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 | |
$host = 'http:/tudominio.com/wp-json/wp/v2/posts/123'; | |
$headers = array( | |
'Content-Type:application/json', | |
'Authorization: Basic '. base64_encode('admin:clave') | |
); | |
$ch = curl_init($host); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); |
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 | |
header( $_SERVER["SERVER_PROTOCOL"] . ' 503 Service Temporarily Unavailable', true, 503 ); | |
header( 'Content-Type: text/html; charset=utf-8' ); | |
header( 'Retry-After: 600' ); | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> |
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 | |
// $list_subcat = get_terms( ['taxonomy' => 'category', 'hide_empty' => false, 'parent' => $cat] ); | |
// $list_subcat = get_categories( ['hide_empty' => false, 'parent' => $cat] ); | |
$list_subcat = array(); | |
if ( !empty($cat) ) $list_subcat = get_categories( ['hide_empty' => false, 'parent' => $cat] ); | |
if ( count($list_subcat)): | |
echo "<div class='subcat'>"; |
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 | |
// Unfilter Description | |
foreach ( array( 'pre_term_description' ) as $filter ) { | |
remove_filter( $filter, 'wp_filter_kses' ); | |
} | |
foreach ( array( 'term_description' ) as $filter ) { | |
remove_filter( $filter, 'wp_kses_data' ); | |
} |
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 | |
require __DIR__ . '/vendor/autoload.php'; | |
use Automattic\WooCommerce\Client; | |
use Automattic\WooCommerce\HttpClient\HttpClientException; | |
try { | |
$woocommerce = new Client( |
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 | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
if ( $paged == 1 && is_home() ) { | |
$idPage = 2; | |
$page = get_post( $idPage ); | |
$title = $page->post_title; |
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 | |
require_once( realpath( dirname( __FILE__ ) ) . '/srdb.class.php' ); | |
if (array_key_exists("step",$_REQUEST) && $_REQUEST["step"] == 2){ | |
add_action("shutdown", "dcms_install_data"); | |
} | |
function dcms_install_data() { | |
global $wpdb, $wp_rewrite; |
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( 'init', 'dcms_agregar_shortcode' ); | |
function dcms_agregar_shortcode(){ | |
add_shortcode('EntradasRecientes', 'dcms_entradasrecientes'); | |
} | |
function dcms_entradasrecientes( $atts , $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
var pressed = []; | |
var secretcode = 'navidad'; | |
window.addEventListener('keyup', function (e) { | |
pressed.push(e.key); | |
pressed.splice(-secretcode.length -1, pressed.length - secretcode.length); | |
if (pressed.join('') == secretcode) { | |
console.log('Se usó el código secreto :)'); | |
} |