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
@for $i from 1 through 13 { | |
@media (min-width: 576px) { | |
.grid-start-sm-#{$i} { | |
grid-column-start: #{$i}; | |
} | |
.grid-end-sm-#{$i} { | |
grid-column-end: #{$i}; | |
background: blue; |
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
/** | |
* Use Lite YouTube in posts embeds | |
* https://github.com/paulirish/lite-youtube-embed | |
*/ | |
add_filter('embed_oembed_html', function($cached_html, $url, $attr, $post_id) { | |
$querystring = parse_url($url, PHP_URL_QUERY); | |
parse_str($querystring, $params); | |
if (isset($params['v'])) { | |
$format = '<lite-youtube videoid="%s"></lite-youtube>'; |
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, |
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
<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
/** | |
* 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
/** | |
* 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_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
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
<?php | |
/** | |
* BuddyPress - Members Home | |
* | |
* @package BuddyPress | |
* @subpackage bp-legacy | |
*/ | |
?> |
NewerOlder