This file contains hidden or 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 like_title_posts_where($where, &$wp_query) { | |
global $wpdb; | |
if ( $like_title = $wp_query->get('like_title')) { | |
$where .= ' AND '.$wpdb->posts.'.post_title LIKE \''.esc_sql(like_escape($like_title)).'\''; | |
} | |
return $where; | |
} |
This file contains hidden or 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 | |
// Seleciona todos os posts publicados | |
$query = new WP_query( | |
array( | |
'post_type' => 'post', | |
'post_status' => 'publish' | |
) | |
); |
This file contains hidden or 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 | |
/** | |
* belongsTo associations | |
* | |
* @var array | |
*/ | |
public $belongsTo = array( | |
'Conta' => array( | |
'className' => 'Conta', | |
'foreignKey' => 'conta_id', |
This file contains hidden or 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 | |
$this->FilterResults->addFilters( | |
array( | |
'OR' => array( | |
'perfil' => array( | |
'Vaga.perfil' => array( | |
'select' => $this->FilterResults->select('Perfil', array('1' => 'select 1')) | |
) | |
), | |
'cidade_id' => array( |
This file contains hidden or 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 | |
try{ | |
$webservice = new novw_webservice(); | |
$result = $webservice->LerCadastro(array('cpf' => '000.000.000-00')); | |
unset($webservice); | |
} catch (exception $e) { | |
wp_redirect(home_url() . '/error?description=' . $e->faultstring); | |
exit(); | |
} |
This file contains hidden or 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 include(TEMPLATEPATH . '/includes/need_login.php'); ?> | |
<?php get_header(); ?> | |
<div class="ym-wrapper wrapper-content"> | |
<div class="ym-wbox"> | |
<h1 class="area-title area-idenfiticacao"><?php echo wp_title(); ?></h1> |
This file contains hidden or 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 my_template_redirect() { | |
global $wpdb; | |
global $wp_query; | |
global $current_user; | |
if ($wp_query->get('custom_page') == 'contato') { | |
// Definimos o título da página | |
add_filter('wp_title', create_function('$a', 'return "Contato «";'), 100); |
This file contains hidden or 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 my_query_vars($query_vars) { | |
$query_vars[] = "custom_page"; | |
return $query_vars; | |
} | |
add_filter('query_vars', 'my_query_vars'); |
This file contains hidden or 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 my_rules_array($rules_array) { | |
global $my_rewrite_rules_array; | |
return $my_rewrite_rules_array + $rules_array; | |
} | |
add_action('rewrite_rules_array', 'my_rules_array'); |
This file contains hidden or 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 load_my_rewrite_rules() { | |
// Carrega nossa variável | |
global $my_rewrite_rules_array; | |
// Carrega as regras do WP | |
$wp_rules = get_option('rewrite_rules'); | |
/** |