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
<? | |
/** | |
* Carrega a API do WordPress | |
*/ | |
define('WP_USE_THEMES', false); // Não utiliza nenhum tema | |
require('./wordpress/wp-load.php'); | |
$query = new WP_Query( 'page_id=7' ); | |
if ( $the_query->have_posts() ) { |
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
Original: | |
LOAD * INLINE [ | |
Objeto, ID | |
Ref1, 13 | |
Ref1, 16 | |
Ref1, 19 | |
Ref1, 32 | |
]; | |
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
<? | |
//$this->Importacao->recursive = -1 | |
//$this->Filter->setPaginate('contain', array('Importacaodado')); | |
// ou | |
$this->Importacao->recursive = 1; | |
$this->Filter->addFilters(array('filter1' => array( ect.....))); | |
$this->Filter->setPaginate('order', array('Importacao.id' => 'desc')); |
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 | |
// Filter Results | |
$this->FilterResults->addFilters( | |
array( | |
'filter1' => array( | |
'User.name' => array( | |
'operator' => 'LIKE', | |
'beforeValue' => '%', | |
'afterValue' => '%' | |
), |
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 $procurar = htmlspecialchars($_GET['procurar']); ?> |
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 | |
// Importa a classe necessária | |
require_once('sanitize.php'); | |
// Filtra HTML e SQL Injection em todos os campos | |
$_GET = Sanitize::filter($_GET); | |
$_POST = Sanitize::filter($_POST); | |
// Somente HTML Injection | |
$_POST = Sanitize::filter($_POST, array('html')); |
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 | |
/** | |
* Função que adiciona o texto "Hello World!" ao conteudo do post | |
* | |
* @param string $content | |
* @return string | |
*/ | |
function hello_world_content_filter ( $content ) { | |
$content .= '<strong>Hello World!</strong>'; | |
return $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
<?php | |
// Adiciona/Atualiza valor da variável | |
update_post_meta( $post_id, $meta_key, $meta_value, $prev_value ); | |
// Retorna o valor da variável | |
get_post_meta( $post_id, $meta_key, $single ) | |
// Apaga a variável | |
delete_post_meta( $post_id, $meta_key, $meta_value ); | |
?> |
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 | |
/** | |
* Função que exibe o conteúdo do quadro | |
*/ | |
function hello_world_meta_box() { | |
global $post; | |
echo '<input id="hello_world_nonce" name="hello_world_nonce" type="hidden" value="' . wp_create_nonce( plugin_basename(__FILE__) ) . '" />'; | |
echo '<input id="hello_world_opt_mostrar_mensagem" name="hello_world_opt_mostrar_mensagem" type="checkbox" />'; |
OlderNewer