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 windowWidth = $( window ).width(); | |
$(window).scroll(function() { | |
var winLeft = $(this).scrollLeft(); | |
var left = $.grep($('.section'), function(item) { | |
return $(item).position().left <= winLeft + windowWidth/2; | |
}); | |
var current = left.slice(-1)[0]; | |
var currentId = $(current).attr('id'); | |
if(!$('a[href$="'+currentId+'"]').hasClass('ativo')){ |
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
/** | |
* override output of author drop down to include ALL user roles | |
*/ | |
add_filter('wp_dropdown_users', 'include_all_users'); | |
function include_all_users($output) | |
{ | |
//set the $post global for checking user against author | |
global $post; | |
$users = get_users(); |
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 | |
/** | |
* BuddyPress - Members Home | |
* | |
* @package BuddyPress | |
* @subpackage bp-legacy | |
*/ | |
?> |
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
require_once('PagSeguroLibrary/PagSeguroLibrary.php'); | |
function generate_pagseguro($user_id){ | |
// Instantiate a new payment request | |
$paymentRequest = new PagSeguroPaymentRequest(); | |
// Set the currency | |
$paymentRequest->setCurrency("BRL"); |
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
add_filter('wp_audio_shortcode', function ($html, $atts, $audio, $post_id, $library) { | |
$media_id = attachment_url_to_postid($atts['mp3']); | |
if (0 !== $media_id) { | |
$content = get_post_field('post_content', $media_id); | |
$content = apply_filters('the_content', $content); | |
if (!empty($content)) { | |
$html = $html.'<div class="audio-description">'.$content.'</div>'; | |
} | |
} |
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
/** | |
* Replace <p> by <figure> around images and make tables responsive using table-responsive Bootstrap class | |
*/ | |
add_filter( 'the_content', function($content) { | |
$content = preg_replace('/<p>\\s*?(<a .*?><img.*?><\\/a>|<img.*?>)?\\s*<\\/p>/s', '<figure class="content-image">$1</figure>', $content); | |
// Run only if is a singular post page | |
if (is_singular()) { | |
$content = preg_replace("/(<table(?s).*<\/table>)/i", "<div class='table-responsive'>$1</div>", $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
/** | |
* Add parameter to Recent post widget | |
*/ | |
add_filter('widget_posts_args', function($params){ | |
$categories = get_the_category(get_the_ID()); | |
$params['cat'] = $categories[0]->term_id; | |
return $params; | |
}); |
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
<div class="dropdown"> | |
<button class="dropdown-toggle" type="button">Dropdown</button> | |
<div class="dropdown-menu"> | |
<a class="dropdown-item" href="#">Item 1</a> | |
<a class="dropdown-item" href="#">Item 2</a> | |
</div> | |
</div> |
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
// more options here: https://codex.wordpress.org/Function_Reference/paginate_links | |
public static function getPagination($pages = null) | |
{ | |
$args = array( | |
'prev_next' => false, | |
'type' => 'list' | |
); | |
if ($pages) { |
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
/** | |
* Register new status | |
* | |
**/ | |
add_action('init', function() { | |
register_post_status('wc-producao', array( | |
'label' => 'Em produção', | |
'public' => true, | |
'exclude_from_search' => false, | |
'show_in_admin_all_list' => true, |
OlderNewer